PageSourceSearch

https://www.cj.net/kr/libs/control.popup.common.BVL9KEHO.js

js cj.net collected 2026-09-25 02:46:46 UTC 3,116 bytes, 1 lines download raw bytes

1var h=Object.defineProperty;var f=(i,e,t)=>e in i?h(i,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):i[e]=t;var a=(i,e,t)=>f(i,typeof e!="symbol"?e+"":e,t);import{f as c}from"./app.x9qZAaqS.js";const s=class s{constructor(){a(this,"popupStack");a(this,"onShowHandler",e=>{const{el:t,onCloseCallbackFn:n,closeSelector:r=".button-close",useClip:o=!0}=e.detail,p=document.activeElement instanceof HTMLElement?document.activeElement:null;this.popupStack.push({el:t,onCloseCallbackFn:n,tabIndexStore:this.setTabindex(t),openerEl:p,closeSelector:r,lastCloseByKeyboard:!1,useClip:o}),o&&c.getInstance().setClip(!0)});a(this,"onHideHandler",()=>{const e=this.popupStack.pop();e&&(this.restoreTabindex(e),e.openerEl&&e.openerEl.focus(),e.useClip&&!this.popupStack.some(t=>t.useClip)&&c.getInstance().setClip(!1))});a(this,"onResetHandler",()=>{const e=this.popupStack.some(t=>t.useClip);for(;this.popupStack.length>0;){const t=this.popupStack.pop();t&&this.restoreTabindex(t)}e&&c.getInstance().setClip(!1)});a(this,"onKeydownHandler",e=>{if(this.popupStack.length<1)return;const t=this.popupStack[this.popupStack.length-1],n=t.el,r=e.target;if(e.key==="Escape"||e.key==="Esc"){e.preventDefault(),e.stopPropagation(),t.lastCloseByKeyboard=!0,t.onCloseCallbackFn();return}if(!(!r||!n.contains(r))){if(e.key==="Enter"||e.key===" "){r.matches(t.closeSelector)&&(t.lastCloseByKeyboard=!0);return}if(e.key==="Tab"){const o=Array.from(n.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])')).filter(E=>E.offsetParent!==null);if(!o.length)return;const p=o[0],d=o[o.length-1],l=document.activeElement;n.contains(l)?e.shiftKey&&l===p?(d.focus(),e.preventDefault()):!e.shiftKey&&l===d&&(p.focus(),e.preventDefault()):(p.focus(),e.preventDefault())}}});this.popupStack=[],window.addEventListener("keydown",this.onKeydownHandler),window.addEventListener(s.EVENT_POPUP_SHOW,this.onShowHandler),window.addEventListener(s.EVENT_POPUP_HIDE,this.onHideHandler),window.addEventListener(s.EVENT_POPUP_RESET,this.onResetHandler)}getIsTabEnable(e){return e.tagName==="BUTTON"||e.tagName==="A"||e.tagName==="INPUT"||e.tagName==="SELECT"||e.tagName==="TEXTAREA"}setTabindex(e){const t=[];return document.querySelectorAll("*").forEach(n=>{this.getIsTabEnable(n)&&(t.push({el:n,tabIndex:n.getAttribute("tabindex")?Number(n.getAttribute("tabindex")):0}),n.setAttribute("tabindex","-1"))}),e.querySelectorAll("*").forEach(n=>{this.getIsTabEnable(n)&&n.setAttribute("tabindex","0")}),t}restoreTabindex(e){e.tabIndexStore.forEach(t=>{t.el.setAttribute("tabindex",String(t.tabIndex))})}setDestroy(){for(;this.popupStack.length>0;){const e=this.popupStack.pop();e&&this.restoreTabindex(e)}window.removeEventListener("keydown",this.onKeydownHandler),window.removeEventListener(s.EVENT_POPUP_SHOW,this.onShowHandler),window.removeEventListener(s.EVENT_POPUP_HIDE,this.onHideHandler),window.removeEventListener(s.EVENT_POPUP_RESET,this.onResetHandler)}};a(s,"EVENT_POPUP_SHOW","popupCommonShow"),a(s,"EVENT_POPUP_HIDE","popupCommonHide"),a(s,"EVENT_POPUP_RESET","popupCommonReset");let u=s;new u;export{u as C};

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.