2 lines
2.0 KiB
JavaScript
2 lines
2.0 KiB
JavaScript
import{i,o as l,c,g as m,t as g,b as a,l as p,f as h,d as k,e as y,k as B,F as b}from"./app-CBssobj-.js";import"./SearchModal-BTKERLZv.js";import{S as x,C as v}from"./SortingByFilter-Ds4x3JAu.js";import{_ as u}from"./_plugin-vue_export-helper-DlAUqK2U.js";const _={name:"TagBadge",components:{Link:i},data(){return{}},methods:{clearFilter(){let r=new URL(window.location.href);const e=[];for(const[n]of r.searchParams)n.startsWith(this.filter.param)&&e.push(n);e.forEach(n=>r.searchParams.delete(n));let t=r.toString();this.$inertia.visit(t,{method:"get"})}},props:{filter:{type:Object}}},w={key:0,class:"inline-flex items-center gap-x-1.5 py-1.5 ps-3 pe-2 rounded-full text-xs font-medium bg-blue-100 text-blue-800"};function C(r,e,t,n,d,s){return this.filter.value!==null?(l(),c("span",w,[m(g(t.filter.value.length>1?"Тэг: "+t.filter.value.length+" значений":"#"+JSON.parse(t.filter.content[t.filter.value].data.name).ru)+" ",1),a("button",{onClick:e[0]||(e[0]=p((...o)=>s.clearFilter&&s.clearFilter(...o),["prevent"])),type:"button",class:"shrink-0 size-4 inline-flex items-center justify-center rounded-full hover:bg-blue-200 focus:outline-none focus:bg-blue-200 focus:text-blue-500"},e[1]||(e[1]=[a("span",{class:"sr-only"},"Remove badge",-1),a("svg",{class:"shrink-0 size-3",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[a("path",{d:"M18 6 6 18"}),a("path",{d:"m6 6 12 12"})],-1)]))])):h("",!0)}const S=u(_,[["render",C]]),F={name:"EventBadgeBuilder",components:{Link:i,SearchBadge:x,CategoryBadge:v,TagBadge:S},data(){return{}},methods:{getComponent(r){return{search:"SearchBadge",category:"CategoryBadge",tag:"TagBadge"}[r]||null}},props:{filters:{type:Object}}};function T(r,e,t,n,d,s){return l(!0),c(b,null,k(t.filters,(o,f)=>(l(),y(B(s.getComponent(o.type)),{key:f,filter:o},null,8,["filter"]))),128)}const P=u(F,[["render",T]]);export{P};
|