PageSourceSearch

https://event-us.kr/Content/dist/js/EvCompanySearch-vue.2aed05daad77bac1.js

js event-us.kr collected 2026-10-01 10:18:13 UTC 5,559 bytes, 1 lines download raw bytes

1"use strict";(self["webpackChunkeventus_ui"]=self["webpackChunkeventus_ui"]||[]).push([[983],{29705:function(e,t,n){n.r(t),n.d(t,{default:function(){return x}});var s=n(70821);const o={class:"relative w-full"},a=(0,s.createElementVNode)("div",{class:"h-11 px-3 pb-2 pt-3 text-xs text-gray-500"},"공식 소속명을 선택해 주세요.",-1),i={class:"max-h-[208px] overflow-y-auto"},u=["aria-selected","tabindex","onClick","onFocus"],c={class:"text-xs text-gray-500"},d=["aria-selected","tabindex"],r=(0,s.createElementVNode)("div",{class:"text-xs text-gray-500"},"검색 결과에 없는 경우 선택해 주세요.",-1);function l(e,t,n,l,h,p){return(0,s.withDirectives)(((0,s.openBlock)(),(0,s.createElementBlock)("div",o,[(0,s.createElementVNode)("div",{class:"absolute left-0 top-2 z-10 w-full rounded-md border bg-white shadow-lg",role:"listbox","aria-label":"회사 검색 결과",onKeydown:t[2]||(t[2]=(...e)=>p.handleKeyDown&&p.handleKeyDown(...e))},[a,(0,s.createElementVNode)("div",i,[((0,s.openBlock)(!0),(0,s.createElementBlock)(s.Fragment,null,(0,s.renderList)(h.companyData,((e,t)=>((0,s.openBlock)(),(0,s.createElementBlock)("button",{key:t,ref_for:!0,ref:"companyButtons",type:"button",class:(0,s.normalizeClass)(["min-h-[52px] w-full px-3 py-1 text-left focus:bg-gray-50 focus:text-primary-500 focus:outline-none hover:bg-gray-50 hover:text-primary-500",{"bg-gray-50 text-primary-500":h.focusedIndex===t}]),role:"option","aria-selected":h.focusedIndex===t,tabindex:h.focusedIndex===t?0:-1,onClick:t=>p.setAffiliation(e),onFocus:e=>h.focusedIndex=t},[(0,s.createElementVNode)("div",null,(0,s.toDisplayString)(e.company_name),1),(0,s.createElementVNode)("div",c,(0,s.toDisplayString)(e.company_address),1)],42,u)))),128))]),(0,s.createElementVNode)("button",{ref:"directInputButton",type:"button",class:(0,s.normalizeClass)(["min-h-[52px] w-full border-t px-3 py-2 text-left focus:bg-gray-50 focus:text-primary-500 focus:outline-none hover:bg-gray-50 hover:text-primary-500",{"bg-gray-50 text-primary-500":h.focusedIndex===h.companyData.length}]),role:"option","aria-selected":h.focusedIndex===h.companyData.length,tabindex:h.focusedIndex===h.companyData.length?0:-1,onClick:t[0]||(t[0]=e=>p.setAffiliation(p.directInput)),onFocus:t[1]||(t[1]=e=>h.focusedIndex=h.companyData.length)},[(0,s.createElementVNode)("div",null,"+ 직접 입력 : "+(0,s.toDisplayString)(n.modelValue),1),r],42,d)],32)],512)),[[s.vShow,h.isShow&&n.modelValue?.length>0]])}n(57658);function h(e,t){let n;return function(){const s=this,o=arguments;clearTimeout(n),n=setTimeout((()=>{e.apply(s,o)}),t)}}function p(e){const t=parseInt(e?.business_no?.raw);return{company_name:e?.company_full_name?.raw,company_address:e?.company_address?.raw,business_no:isNaN(t)?null:t}}var f={props:{inputId:{type:String,required:!0},modelValue:{type:String,required:!0}},emits:["companyChange"],data(){return{isShow:!1,companyData:[],debounceGetCompanyData:h(this.getCompanyData,200),requestQueue:[],focusedIndex:-1}},computed:{directInput(){return{company_name:this.modelValue,company_address:null,business_no:null}}},watch:{modelValue(e){if(!e)return this.$emit("companyChange",this.directInput),void(this.focusedIndex=-1);this.focusedIndex=-1,this.debounceGetCompanyData()}},mounted(){const e=document.getElementById(this.inputId);e.addEventListener("focus",this.onFocus),e.addEventListener("keydown",this.handleInputKeyDown),this.debounceGetCompanyData()},beforeUnmount(){const e=document.getElementById(this.inputId);e&&(e.removeEventListener("focus",this.onFocus),e.removeEventListener("keydown",this.handleInputKeyDown))},methods:{onFocus(){this.isShow=!0,this.focusedIndex=-1},handleInputKeyDown(e){this.isShow&&this.modelValue?.length&&("ArrowDown"===e.key?(e.preventDefault(),this.focusedIndex=0,this.focusCurrentItem()):"Escape"===e.key&&(e.preventDefault(),this.focusedIndex=-1))},handleKeyDown(e){const t=this.companyData.length+1;if("ArrowDown"===e.key)e.preventDefault(),this.focusedIndex=(this.focusedIndex+1)%t,this.focusCurrentItem();else if("ArrowUp"===e.key)e.preventDefault(),this.focusedIndex=this.focusedIndex<=0?t-1:this.focusedIndex-1,this.focusCurrentItem();else if("Enter"===e.key||" "===e.key)e.preventDefault(),this.focusedIndex>=0&&this.focusedIndex<this.companyData.length?this.setAffiliation(this.companyData[this.focusedIndex]):this.focusedIndex===this.companyData.length&&this.setAffiliation(this.directInput);else if("Escape"===e.key){e.preventDefault(),this.focusedIndex=-1;const t=document.getElementById(this.inputId);t&&t.focus()}else"Tab"===e.key&&(this.focusedIndex=-1)},focusCurrentItem(){this.$nextTick((()=>
1{if(this.focusedIndex>=0&&this.focusedIndex<this.companyData.length){const e=this.$refs.companyButtons;e&&e[this.focusedIndex]&&e[this.focusedIndex].focus()}else this.focusedIndex===this.companyData.length&&this.$refs.directInputButton&&this.$refs.directInputButton.focus()}))},async getCompanyData(){if(!this.modelValue)return void(this.companyData=[]);const e={query:this.modelValue,page:{size:20,current:1},boosts:{company_name:{type:"value",value:this.modelValue,operation:"add",factor:100}},sort:[{_score:"desc"}]},t=Date.now();this.requestQueue.push(t);const n=await axios.post("https://api.event-us.kr/api/v1/engine/companysearch",e);this.requestQueue[this.requestQueue.length-1]===t&&(this.companyData=n.data.results.map(p)),this.requestQueue=this.requestQueue.filter((e=>e===t))},setAffiliation(e){this.$emit("companyChange",e),this.isShow=!1,this.focusedIndex=-1}}},m=n(83744);const y=(0,m.Z)(f,[["render",l]]);var x=y}}]);

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.