PageSourceSearch

https://www.ahk.de/build/assets/option-menu-cndtGkGw.js

js ahk.de collected 2026-10-01 10:19:21 UTC 9,230 bytes, 1 lines download raw bytes

1import{d as oe,u as ue,B as re,l as ce,o as de,W as H,w as m,q as ve,n as q,c,e as d,s as r,t as b,g,F as R,y as G,x as A,f as O,X as _,N as w,v as z,r as f,j as S}from"./app-BQ-43nIL.js";const fe={class:"option-menu-toggle-wrapper"},pe=["for"],be=["textContent"],ye=["id","name","multiple"],he=["value","selected"],ge={key:0},me=["aria-expanded","aria-multiselectable","aria-controls","aria-label","aria-activedescendant","disabled","onKeydown"],Ke=["id","aria-label"],Ue=["id","onClick","onKeydown"],Oe=["checked"],we={key:1,class:"option-menu-totals"},Se={class:"visually-hidden"},ke={key:0,class:"clear-all-container d-lg-flex"},xe=["disabled"],_e=oe({__name:"option-menu",props:{totalsText:{},optionListAriaLabel:{},id:{},label:{},liveUpdateKey:{},selectId:{},type:{},selectName:{},isMultiple:{type:Boolean},initialOptions:{},translations:{}},setup(u){const t=u,W=["industries","regions","countries"],n=f([]),F=ue(re.LG),B=f(),y=f(),K=f(null),i=f([]),X=f(),k=f(!0),o=f(!1),p=S(()=>!!t.isMultiple),Y=S(()=>{const e=n.value.filter(l=>i.value.includes(l.value));return e.length?e.map(l=>l.label).join(", "):n.value[0]?.label??""}),J=ce(),T=S(()=>{const e=t.initialOptions&&t.initialOptions.length?t.initialOptions:n.value;return new Map(e.map(l=>[l.value,l.label]))}),P=S(()=>!i.value.length||i.value.length===1&&i.value[0]==="all"),Q=S(()=>t.type==="delegation_hub"&&["industries","regions","countries"].includes(t.liveUpdateKey));de(()=>{if(t.initialOptions&&(t.type==="delegation_hub"&&t.liveUpdateKey!=="eventStatusFilter"?n.value=t.initialOptions.filter(e=>e.value==="all"||e.totals).map(e=>({value:e.value,label:e.value==="all"&&t.translations?t.translations[e.label]:e.label,totals:e.totals,selected:e.selected})):n.value=t.initialOptions.filter(e=>({value:e.value,label:e.label,totals:e.totals?e.totals:0,selected:e.selected})),i.value=n.value.filter(e=>e.selected).map(e=>e.value),i.value.length===0&&n.value.length>0&&(i.value=[n.value[0].value]),(t.liveUpdateKey==="monthFilter"||t.type==="delegation_hub")&&(k.value=!(n.value.length===1&&n.value[0].value==="all")),t.type==="events_hub"&&t.liveUpdateKey==="category"&&E()),t.liveUpdateKey){I(U());const{updateSelectedOption:e}=H(`form_${t.liveUpdateKey}`,t.type);e(U())}});const D=f("");function E(e="asc"){if(n.value.length>1){const l=n.value[0],a=n.value.slice(1).sort((v,s)=>e==="asc"?v.label.localeCompare(s.label):s.label.localeCompare(v.label));n.value=[l,...a]}}m(i,async e=>{X.value=e,!p.value&&(F.value||t.liveUpdateKey)&&o.value&&(o.value=!1,y.value.focus()),D.value=e[e.length-1]?C(e[e.length-1]):""}),ve(B,()=>{F.value&&(o.value=!1)}),m(o,e=>{J.setFilterBarOptionOpen(e)}),m(F,()=>{o.value=!1}),window.addEventListener("keydown",async e=>{e.code==="Escape"&&o.value&&(o.value=!1,await q(),y.value.focus())});const L=f();function Z(){o.value||(o.value=!0),L.value.querySelector("li").focus()}function ee(e,l){const a=L.value.querySelectorAll("li");e.code==="ArrowDown"?l<a.length-1&&a[l+1].focus():e.code==="ArrowUp"?e.altKey?(o.value=!1,y.value.focus()):l===0?y.value.focus():a[l-1].focus():e.code==="Tab"&&(e.shiftKey?l===0?y.value.focus():a[l-1].focus():l<a.length-1&&a[l+1].focus())}const{fetchOptions:N,loading:$,loaded:le,currentOptions:te,updateSelectedOption:I,refToTriggerDelegationHubSelectionsReset:ae}=H(t.liveUpdateKey,t.type);m(le,async()=>{await q(),y.value.focus()});const ne=(e,l)=>t.liveUpdateKey==="yearFilter"?e==="all"?t.translations.all_years:e:t.liveUpdateKey==="industries"?e==="all"?t.translations.all_industries:e:t.liveUpdateKey==="monthFilter"?e=="all"?t.translations.months[0]:t.translations.months[e]:t.liveUpdateKey==="category"?e=="all"||e=="none"?t.translations.category[e]:l.label:t.translations[e]?t.translations[e]:`Unknown (${e})`,ie=e=>{const l=new Map(Object.entries(e).map(([s,h])=>[s,h===null?0:Number(h)])),a=Array.from(T.value.entries()).map(([s,h])=>({label:s==="all"&&t.translations?t.translations[h]:h,value:s,totals:String(l.get(s)??
10),selected:i.value.includes(s)})),v=Array.from(l.entries()).filter(([s])=>!T.value.has(s)).map(([s,h])=>({label:s,value:s,totals:String(h),selected:i.value.includes(s)}));n.value=[...a,...v],t.liveUpdateKey!=="eventStatusFilter"&&(n.value=n.value.filter(s=>s.value==="all"||s.totals!=="0"))};m(te,e=>{if(t.type==="events_hub"){if(typeof e=="object"&&!Array.isArray(e)){if(n.value=Object.entries(e).map(([l,a])=>({label:ne(l,a),value:l,totals:t.liveUpdateKey==="category"&&typeof a=="object"?a.count:a,selected:!1})),t.liveUpdateKey==="yearFilter"||t.liveUpdateKey==="monthFilter"){if(n.value.length){const l=n.value.pop();l&&n.value.unshift(l)}t.liveUpdateKey==="yearFilter"&&E("desc")}if(t.liveUpdateKey==="category"){const l=n.value.findIndex(a=>a.value==="all");if(l!==-1){const[a]=n.value.splice(l,1);n.value.unshift(a)}E()}if(t.liveUpdateKey==="monthFilter"){if(!n.value.some(a=>a.value===i.value[0])){const a=n.value.find(v=>v.value==="all");a&&(i.value=[a.value],I(U()))}k.value=!(n.value.length===1&&n.value[0].value==="all")}}}else t.type==="delegation_hub"&&e&&typeof e=="object"&&!Array.isArray(e)?(ie(e),k.value=!(n.value.length===1&&n.value[0].value==="all")):n.value=(Array.isArray(e)?e:[]).filter(l=>l.totals!==null&&Number(l.totals)>0)});const j=new Event("input",{bubbles:!0});function M(e){if(p.value?(i.value=x(e)?i.value.filter(l=>l!==e):[...i.value,e],t.type==="delegation_hub"&&se(e)):i.value=[e],K.value){const l=K.value;Array.from(l.options).forEach(a=>{a.selected=i.value.includes(a.value)}),l.dispatchEvent(j)}t.liveUpdateKey&&N(U())}function se(e){if(e==="all")i.value=[e];else{let l=[...n.value];i.value=[...i.value.filter(a=>(l=l.filter(v=>v.value!==a),a!=="all"))],(!i.value.length||l.length===1&&l[0].value==="all")&&(i.value=["all"])}}function C(e){return`${t.id}-${e}`}function x(e){return i.value.includes(e)}function U(){return t.type==="delegation_hub"&&t.liveUpdateKey&&W.includes(t.liveUpdateKey)?i.value:i.value[0]??""}function V(){if(!(!p.value||!i.value.length)){if(i.value=[],t.type==="delegation_hub"&&(i.value=["all"]),K.value){const e=K.value;Array.from(e.options).forEach(l=>{l.selected=i.value.includes(l.value)}),e.dispatchEvent(j)}t.liveUpdateKey&&N(U())}}return m(ae,()=>{V()}),(e,l)=>(c(),d("div",{ref_key:"optionMenu",ref:B,class:g(["b-option-menu",{"is-open":o.value,"is-disabled":z($)||!k.value,"wider-event-status-filter":u.type==="delegation_hub"&&u.liveUpdateKey==="eventStatusFilter"}])},[r("div",fe,[r("label",{class:"option-menu-toggle-label text-truncate",for:u.id},b(u.label),9,pe),r("div",{class:g(["option-menu-select-replacement","text-truncate",{"is-hidden-on-mobile":o.value,"is-replacing-select":t}]),textContent:b(Y.value)},null,10,be),(c(),d("svg",{"aria-hidden":"true",class:g(["option-menu-select-icon",{"is-rotated":o.value}])},[...l[2]||(l[2]=[r("use",{class:"d-lg-none","xlink:href":"#angle-down"},null,-1),r("use",{class:"d-none d-lg-block","xlink:href":"#angle-down-small"},null,-1)])],2))]),r("select",{id:u.selectId,ref_key:"optionMenuSelectRef",ref:K,name:u.selectName,multiple:p.value,class:g(["option-menu-select",{"visually-hidden":t}]),"aria-hidden":"true",tabindex:"-1"},[(c(!0),d(R,null,G(n.value,a=>(c(),d("option",{key:a.value,value:a.value,selected:x(a.value)},[A(b(a.label)+" ",1),a.totals?(c(),d("span",ge,"("+b(a.totals)+")",1)):O("",!0)],8,he))),128))],10,ye),r("button",{ref_key:"optionMenuToggle",ref:y,"data-unit-test-id":"option-menu-toggle",type:"button",class:"option-menu-toggle u-reset-button u-focus-ring",role:"combobox","aria-expanded":o.value,"aria-multiselectable":p.value,"aria-controls":u.id,"aria-label":u.label,"aria-activedescendant":D.value,disabled:z($),onClick:l[0]||(l[0]=a=>o.value=!o.value),onKeydown:[l[1]||(l[1]=_(w(a=>o.value=!0,["prevent","alt","exact"]),["down"])),_(w(Z,["prevent"]),["down"])]},null,40,me),n.value.length?(c(),d("div",{key:0,"data-unit-test-id":"option-menu-list-wrapper",class:g(["option-menu-list-wrapper list-unstyled",{"is-open":o.value}])},[r("ul",{id:u.id,ref_key:"optionMenuList",ref:L,class:g(["option-menu-list list-unstyled u-scrollbar",{"option-menu-list-bottom-border":p.value}]),role:"listbox","aria-label":u.optionListAriaLabel},[(c(!0),d(R,null,G(n.value,(a,v)=>(c(),d("li",{id:C(a.value),key:C(a.value),role:"option",class:g(["option-menu-option u-focus-ring u-hyphens-auto",{"is-active":!p.value&&x(a.value),"is-disabled":!u.id.includes("delegation_trip")&&a.totals=="0"&&u.liveUpdateKey==="eventStatusFilter"}]),tabindex:"0",onClick:s=>M(a.value),onKeydown:[_(w(s=>M(a.value),["prevent"]),["enter"]),_(w(s=>M(a.value),["prevent"]),["space"]),w(s=>ee(s,v),["prevent"])]},[p.value?(c(),d("input",{key:0,class:"option-selected-checkbox",type:"checkbox",checked:x(a.value)},null,8,Oe)):O("",!0),A(" "+b(a.label)+" ",1),Q.value&&a.value==="all"?O("",!0):(c(),d("span",we,[r("span",Se,b(u.totalsText),1),A(" "+b(u.liveUpdateKey==="monthFilter"&&a.totals=="0"?"":a.totals),1)]))],42,Ue))),128))],10,Ke),p.value?(c(),d("div",ke,[r("button",{disabled:P.value,type:"button",class:"clear-all-button",onClick:V},[A(b(t.translations?.clear_all)+" ",1),l[3]||(l[3]=r("svg",{class:"clear-all-button-icon","aria-hidden":"true"},[r("use",{"xlink:href":"#clear"})],-1))],8,xe)])):O("",!0)],2)):O("",!0)],2))}});
1export{_e as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.