admins-components 1.3.1 → 2.0.1
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/admins-components.cjs +1 -1
- package/dist/admins-components.js +766 -651
- package/dist/src/components/DateRangePicker.vue.d.ts +16 -0
- package/dist/src/components/FilterCompact.vue.d.ts +1 -1
- package/dist/src/components/FilterControl.vue.d.ts +4 -4
- package/dist/src/components/TableToList.vue.d.ts +1 -0
- package/dist/src/components/TableToListOptions.vue.d.ts +2 -0
- package/dist/src/utils/TableToListColumnOptionsPersister.d.ts +1 -1
- package/dist/style.css +5 -1
- package/package.json +2 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var W=Object.defineProperty;var A=(d,l,o)=>l in d?W(d,l,{enumerable:!0,configurable:!0,writable:!0,value:o}):d[l]=o;var h=(d,l,o)=>A(d,typeof l!="symbol"?l+"":l,o);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),J={class:"form-check"},q=["checked","id"],K=["for"],N=e.defineComponent({__name:"CheckBox",props:{id:{},label:{},checked:{type:Boolean}},emits:["changed"],setup(d){return(l,o)=>(e.openBlock(),e.createElementBlock("div",J,[e.createElementVNode("input",{class:"form-check-input",type:"checkbox",checked:l.checked,value:"",id:l.id,onChange:o[0]||(o[0]=t=>l.$emit("changed",{id:l.id,checked:t.target.checked}))},null,40,q),e.createElementVNode("label",{class:"form-check-label",for:l.id},e.toDisplayString(l.label),9,K)]))}}),U={class:"cbl-childrend-container"},Q=e.defineComponent({__name:"CheckBoxList",props:{items:{},callback:{type:Function}},setup(d){return(l,o)=>{const t=e.resolveComponent("CheckBoxList",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,n=>(e.openBlock(),e.createElementBlock("div",{key:n.id,class:"cbl-container"},[e.createVNode(N,{id:n.id,label:n.label,checked:n.checked,onChanged:o[0]||(o[0]=r=>l.callback(r.id,r.checked))},null,8,["id","label","checked"]),e.createElementVNode("div",U,[n.childrend?(e.openBlock(),e.createBlock(t,{key:0,items:n.childrend,callback:l.callback},null,8,["items","callback"])):e.createCommentVNode("",!0)])]))),128)}}}),X=(d,l)=>{const o=d.__vccOpts||d;for(const[t,n]of l)o[t]=n;return o},z=X(Q,[["__scopeId","data-v-ae2832c5"]]),Y=["id"],Z=["disabled"],ee={class:"dd-label"},te={class:"dd-item-list"},oe=["onClick"],E=e.defineComponent({__name:"DropDown",props:{id:{},label:{},selected:{},options:{},opentop:{type:Boolean},disableFilter:{type:Boolean},storeselected:{type:Boolean},filterevent:{type:Boolean},disabled:{type:Boolean}},emits:["selected","filtered"],setup(d,{emit:l}){const o=d;e.watch(o.options,()=>{o.filterevent&&(c.value=o.options.value)}),e.watch(()=>o.selected,()=>{u()}),e.watch(()=>o.label,()=>{u()});const t=l,n=k=>{o.storeselected||(p.value=k.label),t("selected",k)},r="törlés",p=e.ref(""),u=()=>{if(o.options.value){const k=o.options.value.find(v=>v.id==o.selected);k?p.value=k.label:(a(""),p.value=o.label)}};e.onMounted(()=>{o.label&&(p.value=o.label),u(),m="",document.addEventListener("click",function(){b.value=="block"&&(b.value="none")}),window.addEventListener("scrolled",function(){b.value=="block"&&(b.value="none")}),f()});let m="";const a=k=>{m=k,o.filterevent?t("filtered",k):k==""?c.value=o.options.value:c.value=o.options.value.filter(v=>v.label.toLowerCase().includes(k.toLowerCase()))},c=e.ref([]),s=()=>{n({label:o.label,id:""}),a("")},i=()=>{if(b.value=="block"){b.value="none";return}setTimeout(()=>{b.value="block"},10),setTimeout(f,20)},f=()=>{const k=g.value,v=C.value;o.opentop?v.style.top=k.getBoundingClientRect().y-v.offsetHeight+"px":(v.style.top=k.getBoundingClientRect().y+k.offsetHeight+"px",k.getBoundingClientRect().y-v.getBoundingClientRect().y!=-k.offsetHeight&&(v.style.top=parseInt(v.style.top.substring(0,v.style.top.length-2))+(k.getBoundingClientRect().y-v.getBoundingClientRect().y)+k.offsetHeight+"px")),D.value&&D.value.focus()},g=e.ref(null),C=e.ref(null),b=e.ref("none"),D=e.ref(null);return(k,v)=>(e.openBlock(),e.createElementBlock("div",{id:k.id,class:"dd-flex"},[e.createElementVNode("button",{ref_key:"DropDownTriggerButton",ref:g,class:"btn btn-outline-secondary dd-toggle dd-flex",type:"button",disabled:k.disabled,onClick:v[0]||(v[0]=y=>{a(e.unref(m)),i()})},[e.createElementVNode("div",ee,e.toDisplayString(p.value),1)],8,Z),e.createElementVNode("div",{class:"dd-menu",style:e.normalizeStyle({display:b.value}),ref_key:"DropDownMenu",ref:C},[p.value!=o.label?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn-outline-secondary dd-button",onClick:v[1]||(v[1]=y=>s())},e.toDisplayString(r))):e.createCommentVNode("",!0),k.disableFilter?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"ddSearch",ref:D,type:"text ",class:"form-control",placeholder:"keresés",onInput:v[2]||(v[2]=y=>a(y.target.value)),onClick:v[3]||(v[3]=y=>y.stopPropagation())},null,544)),e.createElementVNode("div",te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,y=>(e.openBlock(),e.createElementBlock("div",{key:y.id,class:"dd-item",onClick:Vt=>n(y)},[y.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([y.icon,"dd-item__icon"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(e.toDisplayString(y.label),1)],8,oe))),128))])],4)],8,Y))}}),le=["id"],ne=["disabled"],se={class:"ddc-row"},ae={class:"ddc-label"},re={class:"dd-item-list"},ie=["onClick"],ce={class:"ddc-item"},de={class:"ddc-label"},ue="törlés",S=e.defineComponent({__name:"DropDownCallBack",props:{id:{},default:{},selected:{},enabled:{type:Boolean},options:{}},setup(d){const l=d,o=c=>{c==l.default&&t.value.callback(""),t.value=c,t.value.callback(t.value.value)},t=e.ref(l.default),n=()=>{if(l.selected&&l.options.value){const c=l.options.value.find(s=>s.value==l.selected);c&&(t.value=c)}};e.onMounted(()=>{n(),document.addEventListener("click",function(){a.value=="block"&&(a.value="none")})});const r=()=>{setTimeout(()=>{a.value="block"},10),setTimeout(()=>{m.value=p.value.offsetHeight},20)},p=e.ref(null),u=e.ref(null),m=e.ref(0),a=e.ref("none");return(c,s)=>(e.openBlock(),e.createElementBlock("div",{class:"ddc-flex",id:c.id},[e.createElementVNode("button",{ref_key:"DropDownTriggerButton",ref:p,class:"btn btn-outline-secondary ddc-button",type:"button",disabled:!c.enabled,onClick:s[0]||(s[0]=i=>r())},[e.createElementVNode("span",se,[e.createElementVNode("i",{class:e.normalizeClass([t.value.icon,"ddc-icon"])},null,2),e.createElementVNode("span",ae,e.toDisplayString(t.value.label),1)])],8,ne),e.createElementVNode("div",{class:"ddc-menu",style:e.normalizeStyle({display:a.value,"margin-top":m.value+"px"}),ref_key:"DropDownMenu",ref:u},[t.value!=l.default?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn-outline-secondary ddc-button",onClick:s[1]||(s[1]=i=>o(l.default))},e.toDisplayString(ue))):e.createCommentVNode("",!0),e.createElementVNode("div",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.options.value,i=>(e.openBlock(),e.createElementBlock("div",{key:i.label,class:"ddc-item",onClick:f=>o(i)},[e.createElementVNode("span",ce,[e.createElementVNode("i",{class:e.normalizeClass([i.icon,"ddc-icon"])},null,2),e.createElementVNode("span",de,e.toDisplayString(i.label),1)])],8,ie))),128))])],4)],8,le))}}),pe=["id"],me={key:0,class:"ddm-label"},fe={key:1,class:"ddm-label"},ke=["onClick"],V=e.defineComponent({__name:"DropDownMenu",props:{label:{},icon:{},options:{},item:{},id:{},right:{type:Boolean}},setup(d){const l=d;e.onMounted(()=>{document.addEventListener("click",function(){o.value&&(o.value=!1)})});const o=e.ref(!1),t=()=>{setTimeout(()=>{o.value=!0},10),setTimeout(n,20)},n=()=>{const m=r.value,a=p.value;a.style.top=m.getBoundingClientRect().y+m.offsetHeight+"px",m.getBoundingClientRect().y-a.getBoundingClientRect().y!=-m.offsetHeight&&(a.style.top=parseInt(a.style.top.substring(0,a.style.top.length-2))+(m.getBoundingClientRect().y-a.getBoundingClientRect().y)+m.offsetHeight+"px"),a.style.left=m.getBoundingClientRect().x-(l.right?100:0)+"px"},r=e.ref(null),p=e.ref(null),u=e.ref(0);return(m,a)=>(e.openBlock(),e.createElementBlock("div",{class:"d-flex",id:m.id},[e.createElementVNode("button",{ref_key:"DropDownTriggerButton",ref:r,class:"btn btn-outline-secondary",type:"button",onClick:a[0]||(a[0]=c=>t())},[m.label?(e.openBlock(),e.createElementBlock("span",me,e.toDisplayString(m.label),1)):e.createCommentVNode("",!0),m.icon?(e.openBlock(),e.createElementBlock("span",fe,[e.createElementVNode("i",{class:e.normalizeClass(m.icon)},null,2)])):e.createCommentVNode("",!0)],512),o.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"ddm-menu",ref_key:"DropDownMenu",ref:p,style:e.normalizeStyle({"margin-top":u.value+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.options,c=>(e.openBlock(),e.createElementBlock("div",{key:c.icon,class:"ddm-item",onClick:s=>c.command(m.item)},[e.createElementVNode("i",{class:e.normalizeClass(c.icon)},null,2),e.createTextVNode(e.toDisplayString(c.label),1)],8,ke))),128))],4)):e.createCommentVNode("",!0)],8,pe))}}),ve={class:"fltrc-container"},ge={class:"fltrc-container"},ye=["placeholder","value"],Be={key:1,class:"d-flex flex-row input-group align-items-center"},be=["value"],he=["value"],T=e.defineComponent({__name:"FilterCompact",props:{items:{}},setup(d){const l=d,o=e.ref(0),t=e.ref(0),n=e.computed(()=>l.items[o.value].filter),r=c=>{let s=l.items[t.value];s.filter.filtered(s.filter.key,""),o.value=c,t.value=c,a.value+=1},p=e.ref(void 0);e.onMounted(()=>{let c=[];for(let s=0;s<l.items.length;s++)c.push({icon:l.items[s].icon,label:l.items[s].label,command:()=>r(s)});p.value=c});const u=e.ref({}),m=e.ref(void 0),a=e.ref(0);return(c,s)=>(e.openBlock(),e.createElementBlock("div",ve,[p.value?(e.openBlock(),e.createBlock(V,{key:0,id:"ddm",icon:c.items[o.value].icon,item:c.items[o.value],label:"",options:p.value},null,8,["icon","item","options"])):e.createCommentVNode("",!0),e.createElementVNode("div",ge,[n.value.type=="text"?(e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"form-control",placeholder:n.value.placeholder,value:n.value.defaultv??"",onInput:s[0]||(s[0]=i=>{n.value.filtered(n.value.key,i.target.value),n.value.defaultv=i.target.value})},null,40,ye)):e.createCommentVNode("",!0),n.value.type=="date"?(e.openBlock(),e.createElementBlock("div",Be,[e.createElementVNode("input",{type:"date",class:"form-control",value:n.value.defFrom??"",onInput:s[1]||(s[1]=i=>{u.value.from=i.target.value==""?null:i.target.value,n.value.defFrom=i.target.value==""?null:i.target.value,n.value.filtered(n.value.key,u.value)})},null,40,be),s[5]||(s[5]=e.createElementVNode("span",{class:"input-group-text"},"-",-1)),e.createElementVNode("input",{type:"date",class:"form-control",value:n.value.defTill??"",onInput:s[2]||(s[2]=i=>{u.value.untill=i.target.value==""?null:i.target.value,n.value.defTill=i.target.value==""?null:i.target.value,n.value.filtered(n.value.key,u.value)})},null,40,he)])):e.createCommentVNode("",!0),n.value.type=="dropdown"?(e.openBlock(),e.createBlock(E,{key:a.value,selected:m.value,options:n.value.options,filterevent:n.value.filterevent,onFiltered:s[3]||(s[3]=i=>{n.value.onfiltered&&n.value.onfiltered(i)}),id:n.value.key,label:n.value.label,onSelected:s[4]||(s[4]=i=>n.value.filtered(n.value.key,i.id))},null,8,["selected","options","filterevent","id","label"])):e.createCommentVNode("",!0)])]))}}),Ce={class:"fltrctrl-container"},Ee=["placeholder","value"],_e={key:1,class:"d-flex flex-row input-group align-items-center"},Ne=["value"],Ve=["value"];class $e{constructor(l,o,t){h(this,"type");this.key=l,this.placeholder=o,this.filtered=t,this.type="text"}}class De{constructor(l,o,t,n,r,p){h(this,"type");this.key=l,this.label=o,this.options=t,this.filterevent=n,this.onfiltered=r,this.filtered=p,this.type="dropdown"}}class we{constructor(l,o,t,n,r){h(this,"type");this.key=l,this.label=o,this.filtered=t,this.defFrom=n,this.defTill=r,this.type="date"}}const _=e.ref({}),L=e.defineComponent({__name:"FilterControl",props:{item:{}},setup(d){const l=d;e.onMounted(()=>{var t;if(l.item.type=="dropdown"){const n=l.item;o.value=(t=n.options.value.find(r=>r.id==l.item.defaultv))==null?void 0:t.id}});const o=e.ref(void 0);return(t,n)=>(e.openBlock(),e.createElementBlock("div",Ce,[t.item.type=="text"?(e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"form-control",placeholder:t.item.placeholder,value:t.item.defaultv??"",onInput:n[0]||(n[0]=r=>t.item.filtered(t.item.key,r.target.value))},null,40,Ee)):e.createCommentVNode("",!0),t.item.type=="date"?(e.openBlock(),e.createElementBlock("div",_e,[e.createElementVNode("input",{type:"date",class:"form-control",value:t.item.defFrom??"",onInput:n[1]||(n[1]=r=>{_.value.from=r.target.value==""?null:r.target.value,t.item.filtered(t.item.key,_.value)})},null,40,Ne),n[5]||(n[5]=e.createElementVNode("span",{class:"input-group-text"},"-",-1)),e.createElementVNode("input",{type:"date",class:"form-control",value:t.item.defTill??"",onInput:n[2]||(n[2]=r=>{_.value.untill=r.target.value==""?null:r.target.value,t.item.filtered(t.item.key,_.value)})},null,40,Ve)])):e.createCommentVNode("",!0),t.item.type=="dropdown"?(e.openBlock(),e.createBlock(E,{key:2,selected:o.value,options:e.ref(t.item.options),filterevent:t.item.filterevent,onFiltered:n[3]||(n[3]=r=>{t.item.onfiltered&&t.item.onfiltered(r)}),id:t.item.key,label:t.item.label,onSelected:n[4]||(n[4]=r=>t.item.filtered(t.item.key,r.id))},null,8,["selected","options","filterevent","id","label"])):e.createCommentVNode("",!0)]))}}),$=e.defineComponent({__name:"IconButton",props:{icon:{},active:{type:Boolean},big:{type:Boolean}},emits:["click"],setup(d,{emit:l}){const o=d,t=e.computed(()=>`${o.icon} ${o.big?"ib-button-big":""}`),n=l;return(r,p)=>(e.openBlock(),e.createElementBlock("div",{onClick:p[0]||(p[0]=u=>n("click")),class:"ib-container"},[e.createElementVNode("div",{class:e.normalizeClass(["ib-button",{"ib-button-active":r.active}])},[e.createElementVNode("i",{class:e.normalizeClass(t.value)},null,2)],2)]))}}),Se={class:"pc-container"},Te=["value","max"],F=e.defineComponent({__name:"PaginatorControl",props:{settings:{}},emits:["pagesize","page"],setup(d,{emit:l}){const o=d,t=l,n=()=>{let a=e.ref([]);return o.settings.value.sizes.forEach(c=>a.value.push({label:c.toString(),id:c.toString()})),a},r=e.ref(1);e.watch(()=>o.settings.value,()=>{r.value=1});const p=e.computed(()=>Math.floor(o.settings.value.total/o.settings.value.pagesize)+1),u=()=>{r.value>1&&(r.value-=1,t("page",r.value))},m=()=>{r.value<p.value&&(r.value+=1,t("page",r.value))};return(a,c)=>(e.openBlock(),e.createElementBlock("div",Se,[e.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:u},"<"),e.createElementVNode("input",{class:"form-control pc-input",type:"number",value:r.value,min:"1",max:p.value,onChange:c[0]||(c[0]=s=>a.$emit("page",s.target.value))},null,40,Te),e.createTextVNode("/"+e.toDisplayString(p.value)+" ",1),e.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:m},">"),e.createVNode(E,{opentop:!0,class:"pc-dropdown",id:"pagecount",label:"10",selected:a.settings.value.pagesize.toString(),options:n(),onSelected:c[1]||(c[1]=s=>{r.value=1,a.$emit("pagesize",parseInt(s.id))})},null,8,["selected","options"])]))}}),Le={class:"form-check"},Fe=["name","id","checked"],Ie=["for"],I=e.defineComponent({__name:"RadioButton",props:{group:{},label:{},id:{},selected:{type:Boolean}},emits:["selected"],setup(d){return(l,o)=>(e.openBlock(),e.createElementBlock("div",Le,[e.createElementVNode("input",{class:"form-check-input",type:"radio",name:l.group,id:l.id,checked:l.selected,onChange:o[0]||(o[0]=t=>l.$emit("selected",l.id))},null,40,Fe),e.createElementVNode("label",{class:"form-check-label",for:l.id},e.toDisplayString(l.label),9,Ie)]))}}),Me={class:"d-flex flex-column gap-2 justify-content-around"},R=e.defineComponent({__name:"RadioButtonGroup",props:{group:{},items:{}},emits:["selected"],setup(d){return(l,o)=>(e.openBlock(),e.createElementBlock("div",Me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,t=>(e.openBlock(),e.createBlock(I,{key:t.id,id:t.id,label:t.label,group:l.group,selected:t.selected,onSelected:o[0]||(o[0]=n=>l.$emit("selected",n))},null,8,["id","label","group","selected"]))),128))]))}}),xe={key:0,class:"spinner-border",role:"status"},H=e.defineComponent({__name:"SpinningProgress",props:{loading:{type:Boolean}},setup(d){return(l,o)=>l.loading?(e.openBlock(),e.createElementBlock("div",xe,o[0]||(o[0]=[e.createElementVNode("span",{class:"visually-hidden"},"Loading...",-1)]))):e.createCommentVNode("",!0)}}),ze={class:"t2l-table-view t2l-table-header-label"},Re={key:0,class:"t2l-select"},He={key:1,class:"t2l-cell"},Oe={class:"t2l-table-view t2l-table-header-filter"},Pe={key:0,class:"t2l-select"},je={key:1,class:"t2l-cell"},Ge={class:"t2l-table-view t2l-rows"},We={key:0,class:"t2l-select"},Ae=["id","onChange"],Je=["innerHTML"],qe={key:1,class:"t2l-cell t2l-actions"},Ke=["title","disabled","onClick"],Ue={class:"t2l-card-view t2l-card-filters"},Qe={class:"t2l-card-filter-order"},Xe={class:"t2l-card-filter-search"},Ye={class:"t2l-card-view t2l-rows"},Ze={key:0,class:"t2l-card-select"},et=["id","onChange"],tt={key:0,class:"t2l-property"},ot={class:"t2l-label"},lt=["innerHTML"],nt={class:"d-flex align-items-center"},st={key:1,class:"d-flex justify-content-center t2l-footer"},O=e.defineComponent({__name:"TableToList",props:{items:{},config:{}},emits:["pagesize","page"],setup(d){const l=d,o=e.computed(()=>l.config.columns.filter(a=>a.visible!=!1)),t=e.computed(()=>l.config.columns.filter(a=>a.visible!=!1&&a.filter)),n=e.computed(()=>o.value.filter(a=>a.sort&&a.sort.active&&a.sort.active.value)),r=e.computed(()=>Math.ceil(o.value.length/l.config.smColCount)),p=(a,c)=>{var s=a-1+(c-1)*r.value;return s<o.value.length?o.value[s]:null},u=(a,c)=>a.converter?a.converter(c[a.property],c):c[a.property],m=a=>{if(a.sort&&a.sort.active){let c=!a.sort.active.value;l.config.columns.forEach(s=>{s.sort&&s.sort.active&&(s.sort.active.value=!1)}),a.sort.active.value=c,a.sort.callback(c?a.property:"")}};return(a,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("div",ze,[a.config.selectableId?(e.openBlock(),e.createElementBlock("span",Re)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,s=>{var i,f;return e.openBlock(),e.createElementBlock("span",{class:"t2l-cell",key:s.property},[s.sort?(e.openBlock(),e.createBlock($,{key:0,icon:s.sort.icon,onClick:g=>m(s),active:(f=(i=s.sort)==null?void 0:i.active)==null?void 0:f.value},null,8,["icon","onClick","active"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(s.label),1)])}),128)),a.config.actionHeader?(e.openBlock(),e.createElementBlock("span",He,e.toDisplayString(a.config.actionHeader),1)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Oe,[a.config.selectableId?(e.openBlock(),e.createElementBlock("span",Pe)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,s=>(e.openBlock(),e.createElementBlock("span",{class:"t2l-cell",key:s.label},[s.filter?(e.openBlock(),e.createBlock(L,{key:0,item:s.filter},null,8,["item"])):e.createCommentVNode("",!0)]))),128)),a.config.actionHeader?(e.openBlock(),e.createElementBlock("span",je)):e.createCommentVNode("",!0)]),e.createElementVNode("div",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,s=>(e.openBlock(),e.createElementBlock("div",{key:s,class:"t2l-row"},[a.config.selectableId?(e.openBlock(),e.createElementBlock("div",We,[e.createElementVNode("input",{class:"form-check-input",type:"checkbox",id:s[a.config.selectableId],onChange:i=>s.selected=!s.selected},null,40,Ae)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,i=>(e.openBlock(),e.createElementBlock("div",{class:"t2l-cell",key:i.property,innerHTML:u(i,s)},null,8,Je))),128)),a.config.actions?(e.openBlock(),e.createElementBlock("div",qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.config.actions,i=>(e.openBlock(),e.createElementBlock("button",{key:i,type:"button",class:"btn btn-outline-secondary",title:i.label,disabled:!i.enabled(s),onClick:f=>i.command(s)},[e.createElementVNode("i",{class:e.normalizeClass(i.icon)},null,2)],8,Ke))),128))])):e.createCommentVNode("",!0)]))),128))]),e.createElementVNode("div",Ue,[e.createElementVNode("div",Qe,[e.createVNode(S,{id:"card-filter-order",default:{icon:"fa-solid fa-chevron-down",label:"rendezés"},selected:n.value.length>0?n.value[0].property:"",enabled:a.config.sortEnabled,options:e.ref(o.value.filter(s=>s.sort).map(s=>({icon:s.sort.icon,label:s.sort.label,value:s.property,callback:s.sort.callback})))},null,8,["selected","enabled","options"])]),e.createElementVNode("div",Xe,[e.createVNode(T,{items:t.value.map(s=>({filter:s.filter,icon:s.filterIcon,label:s.label}))},null,8,["items"])])]),e.createElementVNode("div",Ye,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,(s,i)=>(e.openBlock(),e.createElementBlock("div",{class:"t2l-row",key:i},[a.config.selectableId?(e.openBlock(),e.createElementBlock("div",Ze,[e.createElementVNode("input",{class:"form-check-input",type:"checkbox",id:s[a.config.selectableId],onChange:f=>s.selected=!s.selected},null,40,et)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.config.smColCount,f=>(e.openBlock(),e.createElementBlock("div",{class:"t2l-card-col",key:f},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,g=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[p(g,f)?(e.openBlock(),e.createElementBlock("div",tt,[e.createElementVNode("span",ot,e.toDisplayString(p(g,f).label),1),e.createElementVNode("div",{innerHTML:u(p(g,f),s)},null,8,lt)])):e.createCommentVNode("",!0)],64))),128))]))),128)),e.createElementVNode("div",nt,[l.config.actions?(e.openBlock(),e.createBlock(V,{key:0,item:s,options:l.config.actions,label:"...",id:i.toString(),right:!0},null,8,["item","options","id"])):e.createCommentVNode("",!0)])]))),128))]),a.config.paginatorSettings?(e.openBlock(),e.createBlock(F,{key:0,settings:a.config.paginatorSettings,onPagesize:c[0]||(c[0]=s=>a.$emit("pagesize",s)),onPage:c[1]||(c[1]=s=>a.$emit("page",s))},null,8,["settings"])):e.createCommentVNode("",!0),a.config.paginatorSettings?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",st," Elemek: "+e.toDisplayString(l.items.length),1))],64))}}),at={class:"d-flex flex flex-row"},rt={key:1,class:"d-flex flex-column gap-2 options-body flex-grow-1"},it={class:"d-flex flex-row"},ct={class:"d-flex align-items-end"},dt=["disabled"],P=e.defineComponent({__name:"TableToListOptions",props:{colCount:{},options:{}},emits:["save"],setup(d,{emit:l}){const o=d,t=e.ref([]);e.onMounted(()=>{t.value=o.options,c()});const n=e.computed(()=>o.colCount!=0?Math.ceil(o.options.length/o.colCount):0),r=(s,i)=>{var f=o.options[(s-1)*n.value+i-1];return f},p=()=>{u("save",t.value)},u=l,m=e.ref(!1),a=e.ref(!0),c=()=>{a.value=t.value.filter(s=>s.checked).length<=1};return(s,i)=>(e.openBlock(),e.createElementBlock("div",at,[m.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"d-flex flex-row align-items-center gap-2 options-header justify-content-start",onClick:i[0]||(i[0]=f=>m.value=!m.value)},i[2]||(i[2]=[e.createElementVNode("i",{class:"fa-solid fa-cog"},null,-1),e.createElementVNode("div",{class:"options-header-label"},"beállítások",-1)]))),m.value?(e.openBlock(),e.createElementBlock("div",rt,[i[4]||(i[4]=e.createElementVNode("div",{class:"options-header-label"},"Látható oszlopok",-1)),e.createElementVNode("div",it,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.colCount,f=>(e.openBlock(),e.createElementBlock("div",{class:"d-flex flex-grow-1 flex-column",key:f},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.value,g=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:g},[r(f,g)?(e.openBlock(),e.createBlock(N,{key:0,id:r(f,g).property,label:r(f,g).label,checked:r(f,g).checked,onChanged:i[1]||(i[1]=C=>{t.value.find(b=>b.property==C.id).checked=C.checked,c()})},null,8,["id","label","checked"])):e.createCommentVNode("",!0)],64))),128))]))),128)),e.createElementVNode("div",ct,[e.createElementVNode("button",{class:"btn btn-outline-secondary",type:"button",onClick:p,disabled:a.value},i[3]||(i[3]=[e.createElementVNode("i",{class:"fa-solid fa-save"},null,-1)]),8,dt)])])])):e.createCommentVNode("",!0)]))}}),ut={class:"tlb-container d-flex flex-column flex-grow-1"},pt={class:"d-flex flex-row tlb-item"},mt={class:"d-flex flex-column flex-grow-1 flex-sm-row justify-content-between tlb-item"},ft=["id"],kt={key:0,class:"d-flex id"},vt={class:"d-flex flex-row align-items-center tlb-children-container"},j=e.defineComponent({__name:"TextListBox",props:{items:{}},emits:["deleted"],setup(d){return(l,o)=>{const t=e.resolveComponent("TextListBox",!0);return e.openBlock(),e.createElementBlock("div",ut,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.items,n=>(e.openBlock(),e.createElementBlock("div",{class:"d-flex flex-column",key:n.id},[e.createElementVNode("div",pt,[e.createElementVNode("div",mt,[e.createElementVNode("div",{class:"d-flex flex-grow-1",id:n.id},e.toDisplayString(n.label),9,ft),n.showId?(e.openBlock(),e.createElementBlock("div",kt,e.toDisplayString(n.id),1)):e.createCommentVNode("",!0)]),n.hideDelete?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock($,{key:0,icon:"fa-solid fa-trash",onClick:r=>l.$emit("deleted",n.id)},null,8,["onClick"]))]),e.createElementVNode("div",vt,[n.childrend?(e.openBlock(),e.createBlock(t,{key:0,items:n.childrend,showId:n.showId,hideDelete:n.hideDelete},null,8,["items","showId","hideDelete"])):e.createCommentVNode("",!0)])]))),128))])}}}),gt={key:0,class:"toast-container position-fixed bottom-0 start-50 translate-middle-x p-4 toast-zindex"},yt={class:"toast-header"},Bt={class:"me-auto"},bt={class:"text-body-secondary"},ht=["onClick"],Ct=["innerHTML"],x=500,M=e.defineComponent({__name:"ToastComponent",props:{defaultDisplayDuration:{}},setup(d,{expose:l}){const o=d,t=e.ref([]);return l({addToast:r=>{r.displayDuration||(r.displayDuration=o.defaultDisplayDuration),r.id=new Date,t.value.filter(function(p){return p.id!==r.id}),t.value.push(r)}}),setInterval(()=>{t.value=t.value.map(r=>(r.displayDuration-=x,r)),t.value=t.value.filter(r=>r.displayDuration>0)},x),(r,p)=>t.value.length>0?(e.openBlock(),e.createElementBlock("div",gt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,u=>(e.openBlock(),e.createElementBlock("div",{key:u.message,class:e.normalizeClass(["toast d-block",{"toast-info":u.type==="info","toast-success":u.type==="success","toast-warning":u.type==="warning","toast-error":u.type==="error"}]),role:"alert","aria-live":"assertive","aria-atomic":"true"},[e.createElementVNode("div",yt,[e.createElementVNode("strong",Bt,e.toDisplayString(u.title),1),e.createElementVNode("small",bt,e.toDisplayString(u.id.toLocaleTimeString()),1),e.createElementVNode("button",{type:"button",class:"btn-close","data-bs-dismiss":"toast","aria-label":"Close",onClick:m=>t.value=t.value.filter(a=>a.id!==u.id)},null,8,ht)]),e.createElementVNode("div",{class:"toast-body",innerHTML:u.message},null,8,Ct)],2))),128))])):e.createCommentVNode("",!0)}}),G=e.defineComponent({__name:"ToastWrapper",setup(d){const l=e.ref(),o=[{id:"toast-notification-message",handler:t=>{let n=t.detail;l.value.addToast({title:n.title,message:n.message,type:n.severity,displayDuration:n.displayDuration?n.displayDuration:5e3})}},{id:"fetch-error",handler:t=>{let n=t.detail;l.value.addToast({title:n.title,message:n.message,type:"error",displayDuration:1e4})}}];return e.onMounted(()=>{o.forEach(t=>window.addEventListener(t.id,t.handler))}),e.onUnmounted(()=>{o.forEach(t=>window.removeEventListener(t.id,t.handler))}),(t,n)=>(e.openBlock(),e.createBlock(M,{ref_key:"toast",ref:l,defaultDisplayDuration:5e3},null,512))}}),B=class B{};h(B,"getId",(l,o)=>`${l}_${o}`),h(B,"saveOptions",(l,o,t)=>{localStorage.setItem(B.getId(l,o),JSON.stringify(t)),window.location.reload()}),h(B,"cleanOptions",(l,o)=>{for(let t=0;t<localStorage.length;t++)localStorage.key(t).includes(l)&&localStorage.key(t)!=B.getId(l,o)&&localStorage.removeItem(localStorage.key(t))}),h(B,"loadOptions",(l,o,t,n,r)=>{B.cleanOptions(l,o);const p=B.getId(l,o);if(localStorage.getItem(p))try{r.value=JSON.parse(localStorage.getItem(p)),r.value.forEach(u=>n.columns.find(m=>m.property==u.property).visible=u.checked)}catch{localStorage.removeItem(p),B.loadOptions(l,o,t,n,r)}else t||(t=[]),r.value=n.columns.map(u=>(u.visible=t.indexOf(u.property)==-1,{label:u.label,property:u.property,checked:u.visible}))});let w=B;function Et(d){window.dispatchEvent(new CustomEvent("toast-notification-message",{detail:d}))}const _t={CheckBox:N,CheckBoxList:z,DropDown:E,DropDownMenu:V,DropDownCallBack:S,FilterCompact:T,FilterControl:L,IconButton:$,PaginatorControl:F,RadioButton:I,RadioButtonGroup:R,SpinningProgress:H,TableToList:O,TableToListOptions:P,TextListBox:j,ToastComponent:M,ToastWrapper:G},Nt={install(d){Object.entries(_t).forEach(([l,o])=>{d.component(l,o)})}};exports.CheckBox=N;exports.CheckBoxList=z;exports.DropDown=E;exports.DropDownCallBack=S;exports.DropDownMenu=V;exports.FilterCompact=T;exports.FilterControl=L;exports.FilterDate=we;exports.FilterDropDown=De;exports.FilterText=$e;exports.IconButton=$;exports.PaginatorControl=F;exports.RadioButton=I;exports.RadioButtonGroup=R;exports.SpinningProgress=H;exports.TabelToListOptionsPersister=w;exports.TableToList=O;exports.TableToListOptions=P;exports.TextListBox=j;exports.ToastComponent=M;exports.ToastWrapper=G;exports.default=Nt;exports.sendMsgToToast=Et;
|
|
1
|
+
"use strict";var q=Object.defineProperty;var Q=(p,n,t)=>n in p?q(p,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):p[n]=t;var N=(p,n,t)=>Q(p,typeof n!="symbol"?n+"":n,t);Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),X={class:"form-check"},Y=["checked","id"],Z=["for"],D=e.defineComponent({__name:"CheckBox",props:{id:{},label:{},checked:{type:Boolean}},emits:["changed"],setup(p){return(n,t)=>(e.openBlock(),e.createElementBlock("div",X,[e.createElementVNode("input",{class:"form-check-input",type:"checkbox",checked:n.checked,value:"",id:n.id,onChange:t[0]||(t[0]=o=>n.$emit("changed",{id:n.id,checked:o.target.checked}))},null,40,Y),e.createElementVNode("label",{class:"form-check-label",for:n.id},e.toDisplayString(n.label),9,Z)]))}}),ee={class:"cbl-childrend-container"},te=e.defineComponent({__name:"CheckBoxList",props:{items:{},callback:{type:Function}},setup(p){return(n,t)=>{const o=e.resolveComponent("CheckBoxList",!0);return e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,l=>(e.openBlock(),e.createElementBlock("div",{key:l.id,class:"cbl-container"},[e.createVNode(D,{id:l.id,label:l.label,checked:l.checked,onChanged:t[0]||(t[0]=r=>n.callback(r.id,r.checked))},null,8,["id","label","checked"]),e.createElementVNode("div",ee,[l.childrend?(e.openBlock(),e.createBlock(o,{key:0,items:l.childrend,callback:n.callback},null,8,["items","callback"])):e.createCommentVNode("",!0)])]))),128)}}}),oe=(p,n)=>{const t=p.__vccOpts||p;for(const[o,l]of n)t[o]=l;return t},j=oe(te,[["__scopeId","data-v-ae2832c5"]]),le=["id"],ne=["disabled"],se={class:"dd-label"},ae=["id"],re={class:"dd-item-list"},ie=["id","onClick"],S=e.defineComponent({__name:"DropDown",props:{id:{},label:{},selected:{},options:{},opentop:{type:Boolean},disableFilter:{type:Boolean},storeselected:{type:Boolean},filterevent:{type:Boolean},disabled:{type:Boolean}},emits:["selected","filtered"],setup(p,{emit:n}){const t=p;e.watch(t.options,()=>{t.filterevent&&(y.value=t.options.value)}),e.watch(()=>t.selected,()=>{u()}),e.watch(()=>t.label,()=>{u()});const o=n,l=v=>{t.storeselected||(m.value=v.label),o("selected",v)},r="törlés",m=e.ref(""),d=e.ref(null);e.watch(()=>d.value,()=>{d.value&&document.getElementById(d.value.id).scrollIntoView()});const u=()=>{if(t.options.value){const v=t.options.value.find(g=>g.id==t.selected);v?m.value=v.label:(f(""),m.value=t.label)}},a=v=>{const g=()=>d?y.value.indexOf(d.value,0):-1,B=document.getElementById(`${t.id}-clear-btn`);if(B==v.target&&v.key=="ArrowDown"){_.value.focus(),d.value=y.value[0];return}if(_.value&&_.value==v.target){if(v.key=="ArrowUp"){const w=g();if(w<1){B&&B.focus();return}d.value=y.value[w-1];return}if(v.key=="ArrowDown"){const w=g();if(w>=y.value.length-1)return;d.value=y.value[w+1];return}if(v.key=="Enter"){if(!d.value)return;l(d.value),h.value=="block"&&(h.value="none");return}}},c=()=>{h.value=="block"&&(h.value="none")},s=()=>{h.value=="block"&&(h.value="none")};e.onMounted(()=>{t.label&&(m.value=t.label),u(),i="",document.addEventListener("click",c),window.addEventListener("scrolled",s),b(),document.addEventListener("keydown",a)}),e.onUnmounted(()=>{document.removeEventListener("keydown",a),document.removeEventListener("click",c),window.removeEventListener("scrolled",s)});let i="";const f=v=>{i=v,t.filterevent?o("filtered",v):v==""?y.value=t.options.value:y.value=t.options.value.filter(g=>g.label.toLowerCase().includes(v.toLowerCase()))},y=e.ref([]),V=()=>{l({label:t.label,id:""}),f("")},$=()=>{if(h.value=="block"){h.value="none";return}setTimeout(()=>{h.value="block"},10),setTimeout(b,20)},b=()=>{const v=k.value,g=C.value;t.opentop?g.style.top=v.getBoundingClientRect().y-g.offsetHeight+"px":(g.style.top=v.getBoundingClientRect().y+v.offsetHeight+"px",v.getBoundingClientRect().y-g.getBoundingClientRect().y!=-v.offsetHeight&&(g.style.top=parseInt(g.style.top.substring(0,g.style.top.length-2))+(v.getBoundingClientRect().y-g.getBoundingClientRect().y)+v.offsetHeight+"px")),_.value&&_.value.focus()},k=e.ref(null),C=e.ref(null),h=e.ref("none"),_=e.ref(null);return(v,g)=>(e.openBlock(),e.createElementBlock("div",{id:v.id,class:"dd-flex"},[e.createElementVNode("button",{ref_key:"DropDownTriggerButton",ref:k,class:"btn btn-outline-secondary dd-toggle dd-flex",type:"button",disabled:v.disabled,onClick:g[0]||(g[0]=()=>{f(e.unref(i)),$()})},[e.createElementVNode("div",se,e.toDisplayString(m.value),1)],8,ne),e.createElementVNode("div",{class:"dd-menu",style:e.normalizeStyle({display:h.value}),ref_key:"DropDownMenu",ref:C},[m.value!=t.label?(e.openBlock(),e.createElementBlock("button",{key:0,id:`${v.id}-clear-btn`,type:"button",class:"btn btn-outline-secondary dd-button",onClick:g[1]||(g[1]=B=>V())},e.toDisplayString(r),8,ae)):e.createCommentVNode("",!0),v.disableFilter?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("input",{key:1,ref_key:"ddSearch",ref:_,type:"text ",class:"form-control",placeholder:"keresés",onInput:g[2]||(g[2]=B=>f(B.target.value)),onClick:g[3]||(g[3]=B=>B.stopPropagation())},null,544)),e.createElementVNode("div",re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,B=>(e.openBlock(),e.createElementBlock("div",{id:B.id,key:B.id,class:e.normalizeClass(["dd-item",{"dd-item-preselected":B==d.value}]),onClick:w=>l(B)},[B.icon?(e.openBlock(),e.createElementBlock("i",{key:0,class:e.normalizeClass([B.icon,"dd-item__icon"])},null,2)):e.createCommentVNode("",!0),e.createTextVNode(e.toDisplayString(B.label),1)],10,ie))),128))])],4)],8,le))}}),ce=["id"],de=["disabled"],ue={class:"ddc-row"},pe={class:"ddc-label"},me={class:"dd-item-list"},fe=["onClick"],ve={class:"ddc-item"},ke={class:"ddc-label"},ge="törlés",x=e.defineComponent({__name:"DropDownCallBack",props:{id:{},default:{},selected:{},enabled:{type:Boolean},options:{}},setup(p){const n=p,t=c=>{c==n.default&&o.value.callback(""),o.value=c,o.value.callback(o.value.value)},o=e.ref(n.default),l=()=>{if(n.selected&&n.options.value){const c=n.options.value.find(s=>s.value==n.selected);c&&(o.value=c)}};e.onMounted(()=>{l(),document.addEventListener("click",function(){a.value=="block"&&(a.value="none")})});const r=()=>{setTimeout(()=>{a.value="block"},10),setTimeout(()=>{u.value=m.value.offsetHeight},20)},m=e.ref(null),d=e.ref(null),u=e.ref(0),a=e.ref("none");return(c,s)=>(e.openBlock(),e.createElementBlock("div",{class:"ddc-flex",id:c.id},[e.createElementVNode("button",{ref_key:"DropDownTriggerButton",ref:m,class:"btn btn-outline-secondary ddc-button",type:"button",disabled:!c.enabled,onClick:s[0]||(s[0]=i=>r())},[e.createElementVNode("span",ue,[e.createElementVNode("i",{class:e.normalizeClass([o.value.icon,"ddc-icon"])},null,2),e.createElementVNode("span",pe,e.toDisplayString(o.value.label),1)])],8,de),e.createElementVNode("div",{class:"ddc-menu",style:e.normalizeStyle({display:a.value,"margin-top":u.value+"px"}),ref_key:"DropDownMenu",ref:d},[o.value!=n.default?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"btn btn-outline-secondary ddc-button",onClick:s[1]||(s[1]=i=>t(n.default))},e.toDisplayString(ge))):e.createCommentVNode("",!0),e.createElementVNode("div",me,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.options.value,i=>(e.openBlock(),e.createElementBlock("div",{key:i.label,class:"ddc-item",onClick:f=>t(i)},[e.createElementVNode("span",ve,[e.createElementVNode("i",{class:e.normalizeClass([i.icon,"ddc-icon"])},null,2),e.createElementVNode("span",ke,e.toDisplayString(i.label),1)])],8,fe))),128))])],4)],8,ce))}}),ye=["id"],Be={key:0,class:"ddm-label"},be={key:1,class:"ddm-label"},he=["onClick"],T=e.defineComponent({__name:"DropDownMenu",props:{label:{},icon:{},options:{},item:{},id:{},right:{type:Boolean}},setup(p){const n=p;e.onMounted(()=>{document.addEventListener("click",function(){t.value&&(t.value=!1)})});const t=e.ref(!1),o=()=>{setTimeout(()=>{t.value=!0},10),setTimeout(l,20)},l=()=>{const u=r.value,a=m.value;a.style.top=u.getBoundingClientRect().y+u.offsetHeight+"px",u.getBoundingClientRect().y-a.getBoundingClientRect().y!=-u.offsetHeight&&(a.style.top=parseInt(a.style.top.substring(0,a.style.top.length-2))+(u.getBoundingClientRect().y-a.getBoundingClientRect().y)+u.offsetHeight+"px"),a.style.left=u.getBoundingClientRect().x-(n.right?100:0)+"px"},r=e.ref(null),m=e.ref(null),d=e.ref(0);return(u,a)=>(e.openBlock(),e.createElementBlock("div",{class:"d-flex",id:u.id},[e.createElementVNode("button",{ref_key:"DropDownTriggerButton",ref:r,class:"btn btn-outline-secondary",type:"button",onClick:a[0]||(a[0]=c=>o())},[u.label?(e.openBlock(),e.createElementBlock("span",Be,e.toDisplayString(u.label),1)):e.createCommentVNode("",!0),u.icon?(e.openBlock(),e.createElementBlock("span",be,[e.createElementVNode("i",{class:e.normalizeClass(u.icon)},null,2)])):e.createCommentVNode("",!0)],512),t.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"ddm-menu",ref_key:"DropDownMenu",ref:m,style:e.normalizeStyle({"margin-top":d.value+"px"})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(u.options,c=>(e.openBlock(),e.createElementBlock("div",{key:c.icon,class:"ddm-item",onClick:s=>c.command(u.item)},[e.createElementVNode("i",{class:e.normalizeClass(c.icon)},null,2),e.createTextVNode(e.toDisplayString(c.label),1)],8,he))),128))],4)):e.createCommentVNode("",!0)],8,ye))}}),Ee={class:"fltrc-container"},Ce={class:"fltrc-container"},_e=["placeholder","value"],Ne={key:1,class:"d-flex flex-row input-group align-items-center"},Ve=["value"],$e=["value"],M=e.defineComponent({__name:"FilterCompact",props:{items:{}},setup(p){const n=p,t=e.ref(0),o=e.ref(0),l=e.computed(()=>n.items[t.value].filter),r=c=>{let s=n.items[o.value];s.filter.filtered(s.filter.key,""),t.value=c,o.value=c,a.value+=1},m=e.ref(void 0);e.onMounted(()=>{let c=[];for(let s=0;s<n.items.length;s++)c.push({icon:n.items[s].icon,label:n.items[s].label,command:()=>r(s)});m.value=c});const d=e.ref({}),u=e.ref(void 0),a=e.ref(0);return(c,s)=>(e.openBlock(),e.createElementBlock("div",Ee,[m.value?(e.openBlock(),e.createBlock(T,{key:0,id:"ddm",icon:c.items[t.value].icon,item:c.items[t.value],label:"",options:m.value},null,8,["icon","item","options"])):e.createCommentVNode("",!0),e.createElementVNode("div",Ce,[l.value.type=="text"?(e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"form-control",placeholder:l.value.placeholder,value:l.value.defaultv??"",onInput:s[0]||(s[0]=i=>{l.value.filtered(l.value.key,i.target.value),l.value.defaultv=i.target.value})},null,40,_e)):e.createCommentVNode("",!0),l.value.type=="date"?(e.openBlock(),e.createElementBlock("div",Ne,[e.createElementVNode("input",{type:"date",class:"form-control",value:l.value.defFrom??"",onInput:s[1]||(s[1]=i=>{d.value.from=i.target.value==""?null:i.target.value,l.value.defFrom=i.target.value==""?null:i.target.value,l.value.filtered(l.value.key,d.value)})},null,40,Ve),s[5]||(s[5]=e.createElementVNode("span",{class:"input-group-text"},"-",-1)),e.createElementVNode("input",{type:"date",class:"form-control",value:l.value.defTil??"",onInput:s[2]||(s[2]=i=>{d.value.until=i.target.value==""?null:i.target.value,l.value.defTil=i.target.value==""?null:i.target.value,l.value.filtered(l.value.key,d.value)})},null,40,$e)])):e.createCommentVNode("",!0),l.value.type=="dropdown"?(e.openBlock(),e.createBlock(S,{key:a.value,selected:u.value,options:l.value.options,filterevent:l.value.filterevent,onFiltered:s[3]||(s[3]=i=>{l.value.onfiltered&&l.value.onfiltered(i)}),id:l.value.key,label:l.value.label,onSelected:s[4]||(s[4]=i=>l.value.filtered(l.value.key,i.id))},null,8,["selected","options","filterevent","id","label"])):e.createCommentVNode("",!0)])]))}}),we=["id"],De=["id"],Se={class:"dtrp-label"},Te=["id"],Le={class:"d-flex flex-column w-100 gap-2"},Fe=["id"],Ie=["id"],xe="Törlés",Me="Beállítás",ze=e.defineComponent({__name:"DateRangePicker",props:{id:{},label:{}},emits:["changed"],setup(p,{emit:n}){const t=p,o=n,l=e.ref(!1),r=async()=>{l.value=!l.value,l.value&&(await d(),$())},m=e.reactive({top:"0px",left:"0px"}),d=async()=>{await e.nextTick();const k=document.getElementById(`${t.id}-btn`).getBoundingClientRect(),C=document.getElementById(`${t.id}-popup`);if(!C)return;const h=C.getBoundingClientRect(),_=window.innerWidth;m.top=k.top+k.height+"px",k.left<_/3?m.left=k.left+"px":k.left>2*_/3?m.left=k.left+k.width-h.width+"px":m.left=k.right-k.width/2-h.width/2+"px"};let u="",a="";const c=b=>{u=b},s=b=>{a=b},i=e.ref(""),f=async()=>{u!=""||a!=""?i.value=`'${u}'-'${a}'`:i.value=t.label,await d()};e.onMounted(()=>{f(),window.addEventListener("click",b=>{const k=document.getElementById(`${t.id}`);k&&!k.contains(b.target)&&(l.value=!1)})});const y=()=>{a="",u="",f(),$(),l.value=!1,o("changed",{from:u==""?null:u,to:a==""?null:a})},V=()=>{f(),l.value=!1,o("changed",{from:u==""?null:u,to:a==""?null:a})},$=()=>{document.getElementById(`${t.id}-from`).value=u,document.getElementById(`${t.id}-to`).value=a};return(b,k)=>(e.openBlock(),e.createElementBlock("div",{id:b.id,class:"dtrp-flex"},[e.createElementVNode("button",{id:b.id+"-btn",class:"btn btn-outline-secondary dtrp-flex dtrp-button",type:"button",onClick:r},[e.createElementVNode("div",Se,e.toDisplayString(i.value),1)],8,De),l.value?(e.openBlock(),e.createElementBlock("div",{key:0,id:b.id+"-popup",class:"dtrp-popup d-flex",style:e.normalizeStyle(m)},[e.createElementVNode("div",Le,[k[2]||(k[2]=e.createTextVNode(" Ettől ")),e.createElementVNode("input",{id:b.id+"-from",type:"date",class:"form-control",onChange:k[0]||(k[0]=C=>c(C.target.value))},null,40,Fe),k[3]||(k[3]=e.createTextVNode(" Eddig ")),e.createElementVNode("input",{id:b.id+"-to",type:"date",class:"form-control",onChange:k[1]||(k[1]=C=>s(C.target.value))},null,40,Ie),e.createElementVNode("div",{class:"d-flex w-100 gap-2"},[e.createElementVNode("button",{class:"btn btn-outline-secondary w-50",onClick:y},e.toDisplayString(xe)),e.createElementVNode("button",{class:"btn btn-outline-primary w-50",onClick:V},e.toDisplayString(Me))])])],12,Te)):e.createCommentVNode("",!0)],8,we))}}),Re={class:"fltrctrl-container"},He=["placeholder","value"],Pe={key:1,class:"d-flex flex-row input-group align-items-center"};class Oe{constructor(n,t,o){N(this,"type");this.key=n,this.placeholder=t,this.filtered=o,this.type="text"}}class je{constructor(n,t,o,l,r,m){N(this,"type");this.key=n,this.label=t,this.options=o,this.filterevent=l,this.onfiltered=r,this.filtered=m,this.type="dropdown"}}class Ae{constructor(n,t,o,l,r){N(this,"type");this.key=n,this.label=t,this.filtered=o,this.defFrom=l,this.defTil=r,this.type="date"}}const F=e.ref({}),z=e.defineComponent({__name:"FilterControl",props:{item:{}},setup(p){const n=p;e.onMounted(()=>{var o;if(n.item.type=="dropdown"){const l=n.item;t.value=(o=l.options.value.find(r=>r.id==n.item.defaultv))==null?void 0:o.id}});const t=e.ref(void 0);return(o,l)=>(e.openBlock(),e.createElementBlock("div",Re,[o.item.type=="text"?(e.openBlock(),e.createElementBlock("input",{key:0,type:"text",class:"form-control",placeholder:o.item.placeholder,value:o.item.defaultv??"",onInput:l[0]||(l[0]=r=>o.item.filtered(o.item.key,r.target.value))},null,40,He)):e.createCommentVNode("",!0),o.item.type=="date"?(e.openBlock(),e.createElementBlock("div",Pe,[e.createVNode(ze,{id:o.item.key+"-dtrp",label:o.item.label,onChanged:l[1]||(l[1]=r=>{F.value.from=r.from,F.value.until=r.to,o.item.filtered(o.item.key,F.value)})},null,8,["id","label"])])):e.createCommentVNode("",!0),o.item.type=="dropdown"?(e.openBlock(),e.createBlock(S,{key:2,selected:t.value,options:e.ref(o.item.options),filterevent:o.item.filterevent,onFiltered:l[2]||(l[2]=r=>{o.item.onfiltered&&o.item.onfiltered(r)}),id:o.item.key,label:o.item.label,onSelected:l[3]||(l[3]=r=>o.item.filtered(o.item.key,r.id))},null,8,["selected","options","filterevent","id","label"])):e.createCommentVNode("",!0)]))}}),L=e.defineComponent({__name:"IconButton",props:{icon:{},active:{type:Boolean},big:{type:Boolean}},emits:["click"],setup(p,{emit:n}){const t=p,o=e.computed(()=>`${t.icon} ${t.big?"ib-button-big":""}`),l=n;return(r,m)=>(e.openBlock(),e.createElementBlock("div",{onClick:m[0]||(m[0]=d=>l("click")),class:"ib-container"},[e.createElementVNode("div",{class:e.normalizeClass(["ib-button",{"ib-button-active":r.active}])},[e.createElementVNode("i",{class:e.normalizeClass(o.value)},null,2)],2)]))}}),We={class:"pc-container"},Ge=["value","max"],R=e.defineComponent({__name:"PaginatorControl",props:{settings:{}},emits:["pagesize","page"],setup(p,{emit:n}){const t=p,o=n,l=()=>{let a=e.ref([]);return t.settings.value.sizes.forEach(c=>a.value.push({label:c.toString(),id:c.toString()})),a},r=e.ref(1);e.watch(()=>t.settings.value,()=>{r.value=1});const m=e.computed(()=>Math.floor(t.settings.value.total/t.settings.value.pagesize)+1),d=()=>{r.value>1&&(r.value-=1,o("page",r.value))},u=()=>{r.value<m.value&&(r.value+=1,o("page",r.value))};return(a,c)=>(e.openBlock(),e.createElementBlock("div",We,[e.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:d},"<"),e.createElementVNode("input",{class:"form-control pc-input",type:"number",value:r.value,min:"1",max:m.value,onChange:c[0]||(c[0]=s=>a.$emit("page",s.target.value))},null,40,Ge),e.createTextVNode("/"+e.toDisplayString(m.value)+" ",1),e.createElementVNode("button",{class:"btn btn-outline-secondary",onClick:u},">"),e.createVNode(S,{opentop:!0,class:"pc-dropdown",id:"pagecount",label:"10",selected:a.settings.value.pagesize.toString(),options:l(),onSelected:c[1]||(c[1]=s=>{r.value=1,a.$emit("pagesize",parseInt(s.id))})},null,8,["selected","options"])]))}}),Ke={class:"form-check"},Ue=["name","id","checked"],Je=["for"],H=e.defineComponent({__name:"RadioButton",props:{group:{},label:{},id:{},selected:{type:Boolean}},emits:["selected"],setup(p){return(n,t)=>(e.openBlock(),e.createElementBlock("div",Ke,[e.createElementVNode("input",{class:"form-check-input",type:"radio",name:n.group,id:n.id,checked:n.selected,onChange:t[0]||(t[0]=o=>n.$emit("selected",n.id))},null,40,Ue),e.createElementVNode("label",{class:"form-check-label",for:n.id},e.toDisplayString(n.label),9,Je)]))}}),qe={class:"d-flex flex-column gap-2 justify-content-around"},A=e.defineComponent({__name:"RadioButtonGroup",props:{group:{},items:{}},emits:["selected"],setup(p){return(n,t)=>(e.openBlock(),e.createElementBlock("div",qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,o=>(e.openBlock(),e.createBlock(H,{key:o.id,id:o.id,label:o.label,group:n.group,selected:o.selected,onSelected:t[0]||(t[0]=l=>n.$emit("selected",l))},null,8,["id","label","group","selected"]))),128))]))}}),Qe={key:0,class:"spinner-border",role:"status"},W=e.defineComponent({__name:"SpinningProgress",props:{loading:{type:Boolean}},setup(p){return(n,t)=>n.loading?(e.openBlock(),e.createElementBlock("div",Qe,t[0]||(t[0]=[e.createElementVNode("span",{class:"visually-hidden"},"Loading...",-1)]))):e.createCommentVNode("",!0)}}),Xe={key:0,class:"t2l-table-view t2l-table-header-label"},Ye={key:0,class:"t2l-select"},Ze={key:1,class:"t2l-cell"},et={class:"t2l-table-view t2l-table-header-filter"},tt={key:0,class:"t2l-select"},ot={key:1,class:"t2l-cell"},lt={class:"t2l-table-view t2l-rows"},nt={key:0,class:"t2l-select"},st=["id","onChange"],at=["innerHTML"],rt={key:1,class:"t2l-cell t2l-actions"},it=["title","disabled","onClick"],ct={class:"t2l-card-view t2l-card-filters"},dt={class:"t2l-card-filter-order"},ut={class:"t2l-card-filter-search"},pt={class:"t2l-card-view t2l-rows"},mt={key:0,class:"t2l-card-select"},ft=["id","onChange"],vt={key:0,class:"t2l-property"},kt={class:"t2l-label"},gt=["innerHTML"],yt={class:"d-flex align-items-center"},Bt={key:2,class:"d-flex justify-content-center t2l-footer"},G=e.defineComponent({__name:"TableToList",props:{items:{},config:{}},emits:["pagesize","page"],setup(p){const n=p,t=e.computed(()=>n.config.columns.filter(a=>a.visible!=!1)),o=e.computed(()=>n.config.columns.filter(a=>a.visible!=!1&&a.filter)),l=e.computed(()=>t.value.filter(a=>a.sort&&a.sort.active&&a.sort.active.value)),r=e.computed(()=>Math.ceil(t.value.length/n.config.smColCount)),m=(a,c)=>{var s=a-1+(c-1)*r.value;return s<t.value.length?t.value[s]:null},d=(a,c)=>a.converter?a.converter(c[a.property],c):c[a.property],u=a=>{if(a.sort&&a.sort.active){let c=!a.sort.active.value;n.config.columns.forEach(s=>{s.sort&&s.sort.active&&(s.sort.active.value=!1)}),a.sort.active.value=c,a.sort.callback(c?a.property:"")}};return(a,c)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[a.config.compact?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Xe,[a.config.selectableId?(e.openBlock(),e.createElementBlock("span",Ye)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,s=>{var i,f;return e.openBlock(),e.createElementBlock("span",{class:"t2l-cell",key:s.property},[s.sort?(e.openBlock(),e.createBlock(L,{key:0,icon:s.sort.icon,onClick:y=>u(s),active:(f=(i=s.sort)==null?void 0:i.active)==null?void 0:f.value},null,8,["icon","onClick","active"])):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(s.label),1)])}),128)),a.config.actionHeader?(e.openBlock(),e.createElementBlock("span",Ze,e.toDisplayString(a.config.actionHeader),1)):e.createCommentVNode("",!0)])),e.createElementVNode("div",et,[a.config.selectableId?(e.openBlock(),e.createElementBlock("span",tt)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,s=>(e.openBlock(),e.createElementBlock("span",{class:"t2l-cell",key:s.label},[s.filter?(e.openBlock(),e.createBlock(z,{key:0,item:s.filter},null,8,["item"])):e.createCommentVNode("",!0)]))),128)),a.config.actionHeader?(e.openBlock(),e.createElementBlock("span",ot)):e.createCommentVNode("",!0)]),e.createElementVNode("div",lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,s=>(e.openBlock(),e.createElementBlock("div",{key:s,class:"t2l-row"},[a.config.selectableId?(e.openBlock(),e.createElementBlock("div",nt,[e.createElementVNode("input",{class:"form-check-input",type:"checkbox",id:s[a.config.selectableId],onChange:i=>s.selected=!s.selected},null,40,st)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(t.value,i=>(e.openBlock(),e.createElementBlock("div",{class:"t2l-cell",key:i.property,innerHTML:d(i,s)},null,8,at))),128)),a.config.actions?(e.openBlock(),e.createElementBlock("div",rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.config.actions,i=>(e.openBlock(),e.createElementBlock("button",{key:i,type:"button",class:"btn btn-outline-secondary",title:i.label,disabled:!i.enabled(s),onClick:f=>i.command(s)},[e.createElementVNode("i",{class:e.normalizeClass(i.icon)},null,2)],8,it))),128))])):e.createCommentVNode("",!0)]))),128))]),e.createElementVNode("div",ct,[e.createElementVNode("div",dt,[e.createVNode(x,{id:"card-filter-order",default:{icon:"fa-solid fa-chevron-down",label:"rendezés"},selected:l.value.length>0?l.value[0].property:"",enabled:a.config.sortEnabled,options:e.ref(t.value.filter(s=>s.sort).map(s=>({icon:s.sort.icon,label:s.sort.label,value:s.property,callback:s.sort.callback})))},null,8,["selected","enabled","options"])]),e.createElementVNode("div",ut,[e.createVNode(M,{items:o.value.map(s=>({filter:s.filter,icon:s.filterIcon,label:s.label}))},null,8,["items"])])]),e.createElementVNode("div",pt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.items,(s,i)=>(e.openBlock(),e.createElementBlock("div",{class:"t2l-row",key:i},[a.config.selectableId?(e.openBlock(),e.createElementBlock("div",mt,[e.createElementVNode("input",{class:"form-check-input",type:"checkbox",id:s[a.config.selectableId],onChange:f=>s.selected=!s.selected},null,40,ft)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(a.config.smColCount,f=>(e.openBlock(),e.createElementBlock("div",{class:"t2l-card-col",key:f},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(r.value,y=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:y},[m(y,f)?(e.openBlock(),e.createElementBlock("div",vt,[e.createElementVNode("span",kt,e.toDisplayString(m(y,f).label),1),e.createElementVNode("div",{innerHTML:d(m(y,f),s)},null,8,gt)])):e.createCommentVNode("",!0)],64))),128))]))),128)),e.createElementVNode("div",yt,[n.config.actions?(e.openBlock(),e.createBlock(T,{key:0,item:s,options:n.config.actions,label:"...",id:i.toString(),right:!0},null,8,["item","options","id"])):e.createCommentVNode("",!0)])]))),128))]),a.config.paginatorSettings?(e.openBlock(),e.createBlock(R,{key:1,settings:a.config.paginatorSettings,onPagesize:c[0]||(c[0]=s=>a.$emit("pagesize",s)),onPage:c[1]||(c[1]=s=>a.$emit("page",s))},null,8,["settings"])):e.createCommentVNode("",!0),a.config.paginatorSettings?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",Bt," Elemek: "+e.toDisplayString(n.items.length),1))],64))}}),bt={class:"d-flex flex flex-row"},ht={key:1,class:"d-flex flex-column gap-2 options-body flex-grow-1"},Et={class:"d-flex flex-grow-1 flex-column"},Ct={class:"d-flex flex-row"},_t={class:"d-flex align-items-end"},Nt=["disabled"],K=e.defineComponent({__name:"TableToListOptions",props:{colCount:{},options:{},config:{}},emits:["save"],setup(p,{emit:n}){const t=p,o=e.ref([]);e.onMounted(()=>{o.value=t.options,c()});const l=e.computed(()=>t.colCount!=0?Math.ceil(t.options.length/t.colCount):0),r=(s,i)=>{var f=t.options[(s-1)*l.value+i-1];return f},m=()=>{d("save",o.value)},d=n,u=e.ref(!1),a=e.ref(!0),c=()=>{a.value=o.value.filter(s=>s.checked).length<=1};return(s,i)=>(e.openBlock(),e.createElementBlock("div",bt,[u.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:"d-flex flex-row align-items-center gap-2 options-header justify-content-start",onClick:i[0]||(i[0]=f=>u.value=!u.value)},i[3]||(i[3]=[e.createElementVNode("i",{class:"fa-solid fa-cog"},null,-1),e.createElementVNode("div",{class:"options-header-label"},"beállítások",-1)]))),u.value?(e.openBlock(),e.createElementBlock("div",ht,[i[5]||(i[5]=e.createElementVNode("div",{class:"options-header-label"},"Táblázat tulajdonságai",-1)),e.createElementVNode("div",Et,[e.createVNode(D,{id:"compact",label:"Kompakt",checked:!!s.config.compact,onChanged:i[1]||(i[1]=f=>s.config.compact=f.checked)},null,8,["checked"])]),i[6]||(i[6]=e.createElementVNode("div",{class:"options-header-label"},"Látható oszlopok",-1)),e.createElementVNode("div",Ct,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(s.colCount,f=>(e.openBlock(),e.createElementBlock("div",{class:"d-flex flex-grow-1 flex-column",key:f},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.value,y=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:y},[r(f,y)?(e.openBlock(),e.createBlock(D,{key:0,id:r(f,y).property,label:r(f,y).label,checked:r(f,y).checked,onChanged:i[2]||(i[2]=V=>{o.value.find($=>$.property==V.id).checked=V.checked,c()})},null,8,["id","label","checked"])):e.createCommentVNode("",!0)],64))),128))]))),128)),e.createElementVNode("div",_t,[e.createElementVNode("button",{class:"btn btn-outline-secondary",type:"button",onClick:m,disabled:a.value},i[4]||(i[4]=[e.createElementVNode("i",{class:"fa-solid fa-save"},null,-1)]),8,Nt)])])])):e.createCommentVNode("",!0)]))}}),Vt={class:"tlb-container d-flex flex-column flex-grow-1"},$t={class:"d-flex flex-row tlb-item"},wt={class:"d-flex flex-column flex-grow-1 flex-sm-row justify-content-between tlb-item"},Dt=["id"],St={key:0,class:"d-flex id"},Tt={class:"d-flex flex-row align-items-center tlb-children-container"},U=e.defineComponent({__name:"TextListBox",props:{items:{}},emits:["deleted"],setup(p){return(n,t)=>{const o=e.resolveComponent("TextListBox",!0);return e.openBlock(),e.createElementBlock("div",Vt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,l=>(e.openBlock(),e.createElementBlock("div",{class:"d-flex flex-column",key:l.id},[e.createElementVNode("div",$t,[e.createElementVNode("div",wt,[e.createElementVNode("div",{class:"d-flex flex-grow-1",id:l.id},e.toDisplayString(l.label),9,Dt),l.showId?(e.openBlock(),e.createElementBlock("div",St,e.toDisplayString(l.id),1)):e.createCommentVNode("",!0)]),l.hideDelete?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(L,{key:0,icon:"fa-solid fa-trash",onClick:r=>n.$emit("deleted",l.id)},null,8,["onClick"]))]),e.createElementVNode("div",Tt,[l.childrend?(e.openBlock(),e.createBlock(o,{key:0,items:l.childrend,showId:l.showId,hideDelete:l.hideDelete},null,8,["items","showId","hideDelete"])):e.createCommentVNode("",!0)])]))),128))])}}}),Lt={key:0,class:"toast-container position-fixed bottom-0 start-50 translate-middle-x p-4 toast-zindex"},Ft={class:"toast-header"},It={class:"me-auto"},xt={class:"text-body-secondary"},Mt=["onClick"],zt=["innerHTML"],O=500,P=e.defineComponent({__name:"ToastComponent",props:{defaultDisplayDuration:{}},setup(p,{expose:n}){const t=p,o=e.ref([]);return n({addToast:r=>{r.displayDuration||(r.displayDuration=t.defaultDisplayDuration),r.id=new Date,o.value.filter(function(m){return m.id!==r.id}),o.value.push(r)}}),setInterval(()=>{o.value=o.value.map(r=>(r.displayDuration-=O,r)),o.value=o.value.filter(r=>r.displayDuration>0)},O),(r,m)=>o.value.length>0?(e.openBlock(),e.createElementBlock("div",Lt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,d=>(e.openBlock(),e.createElementBlock("div",{key:d.message,class:e.normalizeClass(["toast d-block",{"toast-info":d.type==="info","toast-success":d.type==="success","toast-warning":d.type==="warning","toast-error":d.type==="error"}]),role:"alert","aria-live":"assertive","aria-atomic":"true"},[e.createElementVNode("div",Ft,[e.createElementVNode("strong",It,e.toDisplayString(d.title),1),e.createElementVNode("small",xt,e.toDisplayString(d.id.toLocaleTimeString()),1),e.createElementVNode("button",{type:"button",class:"btn-close","data-bs-dismiss":"toast","aria-label":"Close",onClick:u=>o.value=o.value.filter(a=>a.id!==d.id)},null,8,Mt)]),e.createElementVNode("div",{class:"toast-body",innerHTML:d.message},null,8,zt)],2))),128))])):e.createCommentVNode("",!0)}}),J=e.defineComponent({__name:"ToastWrapper",setup(p){const n=e.ref(),t=[{id:"toast-notification-message",handler:o=>{let l=o.detail;n.value.addToast({title:l.title,message:l.message,type:l.severity,displayDuration:l.displayDuration?l.displayDuration:5e3})}},{id:"fetch-error",handler:o=>{let l=o.detail;n.value.addToast({title:l.title,message:l.message,type:"error",displayDuration:1e4})}}];return e.onMounted(()=>{t.forEach(o=>window.addEventListener(o.id,o.handler))}),e.onUnmounted(()=>{t.forEach(o=>window.removeEventListener(o.id,o.handler))}),(o,l)=>(e.openBlock(),e.createBlock(P,{ref_key:"toast",ref:n,defaultDisplayDuration:5e3},null,512))}}),E=class E{};N(E,"getId",(n,t)=>`${n}_${t}`),N(E,"saveOptions",(n,t,o,l)=>{localStorage.setItem(E.getId(n,t),JSON.stringify({ttlcos:l,ttlc:{compact:o.compact}})),window.location.reload()}),N(E,"cleanOptions",(n,t)=>{for(let o=0;o<localStorage.length;o++)localStorage.key(o).includes(n)&&localStorage.key(o)!=E.getId(n,t)&&localStorage.removeItem(localStorage.key(o))}),N(E,"loadOptions",(n,t,o,l,r)=>{E.cleanOptions(n,t);const m=E.getId(n,t);if(localStorage.getItem(m))try{const d=JSON.parse(localStorage.getItem(m));r.value=d.ttlcos,r.value.forEach(u=>l.columns.find(a=>a.property==u.property).visible=u.checked),l.compact=d.ttlc.compact}catch{localStorage.removeItem(m),E.loadOptions(n,t,o,l,r)}else o||(o=[]),r.value=l.columns.map(d=>(d.visible=o.indexOf(d.property)==-1,{label:d.label,property:d.property,checked:d.visible}))});let I=E;function Rt(p){window.dispatchEvent(new CustomEvent("toast-notification-message",{detail:p}))}const Ht={CheckBox:D,CheckBoxList:j,DropDown:S,DropDownMenu:T,DropDownCallBack:x,FilterCompact:M,FilterControl:z,IconButton:L,PaginatorControl:R,RadioButton:H,RadioButtonGroup:A,SpinningProgress:W,TableToList:G,TableToListOptions:K,TextListBox:U,ToastComponent:P,ToastWrapper:J},Pt={install(p){Object.entries(Ht).forEach(([n,t])=>{p.component(n,t)})}};exports.CheckBox=D;exports.CheckBoxList=j;exports.DropDown=S;exports.DropDownCallBack=x;exports.DropDownMenu=T;exports.FilterCompact=M;exports.FilterControl=z;exports.FilterDate=Ae;exports.FilterDropDown=je;exports.FilterText=Oe;exports.IconButton=L;exports.PaginatorControl=R;exports.RadioButton=H;exports.RadioButtonGroup=A;exports.SpinningProgress=W;exports.TabelToListOptionsPersister=I;exports.TableToList=G;exports.TableToListOptions=K;exports.TextListBox=U;exports.ToastComponent=P;exports.ToastWrapper=J;exports.default=Pt;exports.sendMsgToToast=Rt;
|