iBet uBet web content aggregator. Adding the entire web to your favor.
iBet uBet web content aggregator. Adding the entire web to your favor.



Link to original content: http://ecommerceDB.com/_nuxt/VGkM1OuY.js
import{d as g,y as v,r as m,o as s,G as o,V,W as P,e as E,f as l,c as f,w as A,v as b,t as y,O as N,C,P as $,ag as O,_ as S,a9 as T,aJ as L}from"./llFuKhWI.js";import{I as u}from"./D5xvDofM.js";const j={class:"nestedContentList"},R={class:"is-flex is-justify-content-space-between is-align-items-center pr-4"},z=["onClick"],F=["aria-label","onClick"],J=g({__name:"NestedContentListRecursive",props:{recursionDepth:{type:Number,default:0},children:{type:Array,required:!0},initialExpandedLevel:{type:Number,default:0},uncollapsible:{type:Boolean,default:!1},keyId:{type:String,default:"value"},keyParentId:{type:String,default:"parent"},keyLabel:{type:String,default:"label"},activeValues:{type:[String,Array],default:""}},setup(d,{expose:t}){const e=d,p=v(u.NestedContentList.CreateLinkKey),c=v(u.NestedContentList.CreateLabelKey),k=v(u.NestedContentList.OnClickKey),h=m(),i=m({}),x=(a=!1)=>{(h.value??[]).forEach(r=>{r.setAllChildren(a)})},B=(a=!1)=>{Object.keys(i.value).forEach(r=>{i.value[r]=a}),x(a)},K=(a,r)=>{const _=!i.value[a];i.value[a]=_,_||x(!1)},I=a=>Array.isArray(e.activeValues)?e.activeValues.includes(a):e.activeValues===a;return e.children.forEach(a=>{const r=e.initialExpandedLevel===-1||e.initialExpandedLevel>e.recursionDepth;i.value[a[e.keyId]]=r}),t({setAllChildren:B}),(a,r)=>{const _=S;return s(),o("ul",j,[(s(!0),o(V,null,P(e.children,n=>(s(),o("li",{key:n[e.keyId],class:"nestedContentList__item"},[E("div",R,[l(p)&&l(p)(n[e.keyId])!==null?(s(),f(_,{key:0,to:l(p)(n[e.keyId]),class:N({nestedContentList__active:I(n[e.keyId])})},{default:A(()=>[b(y(l(c)?l(c)(n,e.keyId,e.keyLabel):n[e.keyLabel]),1)]),_:2},1032,["to","class"])):(s(),o("span",{key:1,class:N({nestedContentList__active:I(n[e.keyId]),nestedContentList__clickable:l(k)!==null}),onClick:D=>l(k)?l(k)(n[e.keyId]):void 0},y(l(c)?l(c)(n,e.keyId,e.keyLabel):n[e.keyLabel]),11,z)),n.children&&!e.uncollapsible?(s(),o("button",{key:2,type:"button",class:"nestedContentList__toggle is-size-4 has-line-height-small","aria-label":l(i)[n[e.keyId]]?"collapse subtree":"expand subtree",onClick:D=>K(n[e.keyId])},y(l(i)[n[e.keyId]]?"−":"+"),9,F)):C("",!0)]),n.children?$((s(),f(w,{key:0,ref_for:!0,ref_key:"refSubTreeChildren",ref:h,"recursion-depth":e.recursionDepth+1,children:n.children,"key-id":e.keyId,"key-parent-id":e.keyParentId,"key-label":e.keyLabel,"initial-expanded-level":e.initialExpandedLevel,uncollapsible:e.uncollapsible,"active-values":e.activeValues},null,8,["recursion-depth","children","key-id","key-parent-id","key-label","initial-expanded-level","uncollapsible","active-values"])),[[O,l(i)[n[e.keyId]]]]):C("",!0)]))),128))])}}}),w=T(J,[["__scopeId","data-v-c025084f"]]),q={class:"title is-6 has-text-weight-bold is-uppercase"},H=g({__name:"NestedContentList",props:{tree:{},keyId:{default:"value"},keyParentId:{default:"parent"},keyLabel:{default:"label"},createLink:{default:d=>null},createLabel:{default:(d,t,e)=>d[e]},initialExpandedLevel:{default:0},uncollapsible:{type:Boolean,default:!1},activeValues:{default:""},onClick:{type:[null,Function],default:null},titleLink:{default:null}},setup(d){const t=d;return L(u.NestedContentList.CreateLinkKey,t.createLink),L(u.NestedContentList.CreateLabelKey,t.createLabel),L(u.NestedContentList.OnClickKey,t.onClick),(e,p)=>{const c=S,k=w;return s(),o("div",null,[E("p",q,[t.titleLink?(s(),f(c,{key:0,to:t.titleLink,class:"has-text-black is-not-underlined"},{default:A(()=>[b(y(t.tree[t.keyLabel]),1)]),_:1},8,["to"])):(s(),o(V,{key:1},[b(y(t.tree[t.keyLabel]),1)],64))]),t.tree.children&&t.tree.children.length?(s(),f(k,{key:0,children:t.tree.children,"key-id":t.keyId,"key-parent-id":t.keyParentId,"key-label":t.keyLabel,uncollapsible:t.uncollapsible,"initial-expanded-level":t.initialExpandedLevel,"active-values":t.activeValues},null,8,["children","key-id","key-parent-id","key-label","uncollapsible","initial-expanded-level","active-values"])):C("",!0)])}}});export{H as _};