import{_ as u,d as c,e as a,f as d,h as x,g as _,j as b,k as f,x as C,t as y,bt as T,C as m,F as v,z as p,b as E,bv as B}from"#entry";const D={name:"WebExpandableTreeBranch",props:{item:{type:Object},activePath:{type:String}},setup(){const{trackSectionLinkClick:n}=E();return{SectionLinkType:B,trackSectionLinkClick:n}},data(){return{expanded:this.item.active}},methods:{toggle(){const n=this.expanded;this.expanded=!n}}},I={class:m(["ebm-tree-branch__heading"])},S={key:2,class:"ebm-tree-branch__heading__icon"},w=["href"],L={key:0,class:"ebm-tree-branch__children"};function P(n,l,e,i,t,s){const o=f,r=T,k=g;return a(),c("div",{class:m(["ebm-tree-branch",t.expanded?"expanded":"",e.item.active?"active":""])},[d("div",I,[!t.expanded&&e.item.children&&e.item.children.length?(a(),_(o,{key:0,icon:"mdi:plus-circle-outline",class:"ebm-tree-branch__heading__icon",onClick:s.toggle},null,8,["onClick"])):t.expanded&&e.item.children&&e.item.children.length?(a(),_(o,{key:1,icon:"mdi:minus-circle-outline",class:"ebm-tree-branch__heading__icon",onClick:s.toggle},null,8,["onClick"])):(a(),c("span",S)),b(r,{event:()=>i.trackSectionLinkClick({clickUrl:e.item.alias,sectionId:e.item.id,linkType:i.SectionLinkType.Tree})},{default:C(()=>[d("a",{href:"/"+e.item.alias,class:"item"},y(e.item.name),9,w)]),_:1},8,["event"])]),e.item.children&&e.item.children.length&&t.expanded?(a(),c("div",L,[(a(!0),c(v,null,p(e.item.children,h=>(a(),_(k,{key:h.alias,item:h,"active-path":e.activePath},null,8,["item","active-path"]))),128))])):x("",!0)],2)}const g=Object.assign(u(D,[["render",P],["__scopeId","data-v-ddf0fb4f"]]),{__name:"WebExpandableTreeBranch"}),W={props:{items:{type:Array},activePath:{type:String}},data(){return{localData:[...this.setActive(this.items).items]}},computed:{numColumns(){return 3}},methods:{setActive(n){let l=!1;return{items:n.map(i=>{const t={...i};if(this.activePath==="/"+i?.alias&&(t.active=!0,l=!0),t.children){const s=this.setActive(t.children);s.activeChild&&(t.active=!0,l=!0),t.children=s.items}return t}),activeChild:l}},columnContents(n){return this.localData.slice(n*(this.localData.length/this.numColumns),this.localData.length/this.numColumns+n*(this.localData.length/this.numColumns))}}},j={class:"ebm-tree"},A={class:"branches"};function N(n,l,e,i,t,s){const o=g;return a(),c("div",j,[d("div",A,[(a(!0),c(v,null,p(t.localData,r=>(a(),c("div",{key:r.name,class:m(["ebm-tree__parent",r.expanded?"ebm-tree__parent--expanded":""])},[b(o,{item:r,"active-path":e.activePath},null,8,["item","active-path"])],2))),128))])])}const V=Object.assign(u(W,[["render",N],["__scopeId","data-v-77b43e08"]]),{__name:"WebExpandableTree"});export{V as _};

AltStyle によって変換されたページ (->オリジナル) /