@krds.ui/vue 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/krds-vue.es.js +1300 -798
- package/dist/krds-vue.es.js.map +1 -1
- package/dist/krds-vue.umd.js +1 -1
- package/dist/krds-vue.umd.js.map +1 -1
- package/dist/types/index.d.ts +223 -0
- package/package.json +1 -1
package/dist/krds-vue.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(y,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(y=typeof globalThis<"u"?globalThis:y||self,e(y.KrdsVue={},y.Vue))})(this,(function(y,e){"use strict";const L=e.defineComponent({name:"KrdsButton",props:{type:{type:String,default:"button"},size:{type:String,default:void 0},variant:{type:String,default:"primary"},icon:{type:Boolean,default:!1},border:{type:Boolean,default:!1},pure:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},class:{type:String,default:void 0}},emits:["click"],setup(t,{emit:o,slots:s}){const l=e.computed(()=>{const a=["krds-btn"];return t.icon&&a.push("icon"),t.border&&a.push("border"),t.pure&&a.push("pure"),t.variant&&!t.icon&&a.push(t.variant),t.size&&a.push(t.size),t.class&&a.push(t.class),a}),i=a=>{t.disabled||o("click",a)};return()=>e.h("button",{type:t.type,class:l.value,disabled:t.disabled,onClick:i},s.default?.())}}),O=e.defineComponent({name:"KrdsButtonGroup",props:{},setup(t,{slots:o}){return()=>e.h("div",{class:"btn-group"},o.default?.())}}),A=e.defineComponent({name:"KrdsIcon",props:{name:{type:String,required:!0},class:{type:String,default:void 0}},setup(t){return()=>e.h("i",{class:["svg-icon",t.name,t.class].filter(Boolean).join(" ")})}}),q=e.defineComponent({name:"KrdsLink",props:{href:{type:String,default:"#!"},target:{type:String,default:void 0},title:{type:String,default:void 0},size:{type:String,default:void 0},link:{type:Boolean,default:!0},basic:{type:Boolean,default:!1},pure:{type:Boolean,default:!1},class:{type:String,default:void 0}},emits:["click"],setup(t,{emit:o,slots:s}){const l=e.computed(()=>{const n=["krds-btn"];return t.size&&n.push(t.size),t.link&&n.push("link"),t.basic&&n.push("basic"),t.pure&&n.push("pure"),t.class&&n.push(t.class),n}),i=e.computed(()=>{const n={href:t.href,class:l.value};return t.target&&(n.target=t.target),t.title&&(n.title=t.title),t.target==="_blank"&&(n.rel="noopener noreferrer"),n}),a=n=>{o("click",n)};return()=>e.h("a",{...i.value,onClick:a},s.default?.())}}),x=e.defineComponent({name:"KrdsSpinner",props:{label:{type:String,default:void 0}},render(){const t=[e.h("span",{class:"sr-only"},"로딩 중")];return this.label&&t.push(e.h("span",this.label)),e.h("div",{class:"krds-spinner",role:"status"},t)}}),R=e.defineComponent({name:"KrdsInput",props:{modelValue:{type:[String,Number],default:void 0},type:{type:String,default:"text"},size:{type:String,default:void 0},placeholder:{type:String,default:void 0},maxlength:{type:Number,default:void 0},minlength:{type:Number,default:void 0},max:{type:Number,default:void 0},min:{type:Number,default:void 0},step:{type:Number,default:void 0},autocomplete:{type:String,default:void 0},autofocus:{type:Boolean,default:!1},name:{type:String,default:void 0},required:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},error:{type:String,default:void 0},state:{type:String,default:"default"},icon:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},class:{type:String,default:void 0},id:{type:String,default:void 0}},emits:["update:modelValue","input","change","focus","blur","keydown","keyup"],setup(t,{emit:o,slots:s}){const l=e.computed(()=>{const g=["krds-input"];return t.size&&g.push(t.size),t.class&&g.push(t.class),g}),i=g=>{const E=g.target,c=t.type==="number"?Number(E.value):E.value;o("update:modelValue",c),o("input",g)},a=g=>{o("change",g)},n=g=>{o("focus",g)},d=g=>{o("blur",g)},u=g=>{o("keydown",g)},p=g=>{o("keyup",g)},h=e.computed(()=>{const g={type:t.type,class:l.value,value:t.modelValue,placeholder:t.placeholder,name:t.name,id:t.id,required:t.required,readonly:t.readonly,disabled:t.disabled,autocomplete:t.autocomplete,autofocus:t.autofocus,onInput:i,onChange:a,onFocus:n,onBlur:d,onKeydown:u,onKeyup:p};return t.maxlength!==void 0&&(g.maxlength=t.maxlength),t.minlength!==void 0&&(g.minlength=t.minlength),t.type==="number"&&(t.max!==void 0&&(g.max=t.max),t.min!==void 0&&(g.min=t.min),t.step!==void 0&&(g.step=t.step)),g}),B=e.computed(()=>{const g=["form-conts"];return t.state!=="default"&&g.push(`is-${t.state}`),t.icon&&g.push("btn-ico-wrap"),g});return()=>{const g=[e.h("input",h.value)];return t.loading?e.h("div",{class:B.value},[e.h("div",{class:"form-spinner"},[...g,e.h(x)])]):(s.default&&g.push(...s.default()),e.h("div",{class:B.value},g))}}}),H=e.defineComponent({name:"KrdsFormLabel",props:{for:{type:String,default:void 0},class:{type:String,default:void 0},style:{type:[String,Object],default:void 0},id:{type:String,default:void 0}},emits:["click"],setup(t,{emit:o,slots:s}){const l=i=>{o("click",i)};return()=>e.h("div",{class:"form-tit"},[e.h("label",{for:t.for,id:t.id,class:t.class,style:t.style,onClick:l},s.default?.())])}}),j=e.defineComponent({name:"KrdsFormHint",props:{type:{type:String,default:"hint"},class:{type:String,default:void 0},style:{type:[String,Object],default:void 0},id:{type:String,default:void 0}},emits:["click"],setup(t,{emit:o,slots:s}){const l=a=>{o("click",a)},i=()=>{let a;switch(t.type){case"error":a="form-hint-invalid";break;case"success":a="form-hint-success";break;case"information":a="form-hint-information";break;default:a="form-hint";break}return t.class?`${a} ${t.class}`:a};return()=>e.h("p",{id:t.id,class:i(),style:t.style,onClick:l},s.default?.())}}),Y=e.defineComponent({name:"KrdsFormGroup",props:{class:{type:String,default:void 0},style:{type:[String,Object],default:void 0},id:{type:String,default:void 0}},setup(t,{slots:o}){const s=e.computed(()=>{const l=["form-group"];return t.class&&l.push(t.class),l});return()=>e.h("div",{id:t.id,class:s.value,style:t.style},o.default?.())}});function be(t,o){const s=new Date,l=e.ref(t||s.getFullYear()),i=e.ref(o||s.getMonth()+1),a=e.ref(null),n=e.ref(null),d=e.ref(null),u=e.computed(()=>{const k=s.getFullYear(),m=[];for(let S=k-10;S<=k+10;S++)m.push(S);return m}),p=e.computed(()=>Array.from({length:12},(k,m)=>m+1)),h=()=>{a.value=null,n.value=null},B=()=>{i.value===1?(i.value=12,l.value-=1):i.value-=1},g=()=>{i.value===12?(i.value=1,l.value+=1):i.value+=1},E=(k,m=!1)=>{if(m)a.value=k,n.value=k;else if(!a.value||a.value&&n.value)a.value=k,n.value=null;else{const S=new Date(a.value.replace(/\./g,"-"));new Date(k.replace(/\./g,"-"))<S?(a.value=k,n.value=null):n.value=k}};return{currentYear:l,currentMonth:i,selectedStartDate:a,selectedEndDate:n,activeDateSelector:d,yearOptions:u,monthOptions:p,clearDateSelection:h,prevMonth:B,nextMonth:g,handleDateSelection:E,selectToday:()=>{const k=`${s.getFullYear()}.${String(s.getMonth()+1).padStart(2,"0")}.${String(s.getDate()).padStart(2,"0")}`;E(k,!0)},isDateInSelectedRange:k=>{if(!a.value||!n.value)return{isInRange:!1,isStart:!1,isEnd:!1};const m=new Date(k.replace(/\./g,"-")),S=new Date(a.value.replace(/\./g,"-")),v=new Date(n.value.replace(/\./g,"-")),z=k===a.value,N=k===n.value;return{isInRange:m>=S&&m<=v,isStart:z,isEnd:N}}}}function Se(t,o,s={}){let l=null;const i=typeof s=="string"?{ignore:s}:s,{ignore:a,event:n="click"}=i,d=()=>{l=p=>{const h=p.target;t.value?.contains(h)||a&&h.closest(a)||o()},document.addEventListener(n,l)},u=()=>{if(l){const p=typeof s=="string"?"click":s.event||"click";document.removeEventListener(p,l),l=null}};return e.onMounted(()=>{d()}),e.onBeforeUnmount(()=>{u()}),{setupGlobalListeners:d,removeGlobalListeners:u}}const Ce={class:"form-conts"},Be={class:"calendar-input"},Ve=["id","name","placeholder","value","readonly","disabled","required","autofocus"],ve=["disabled","aria-expanded"],we={class:"calendar-head"},Ke={class:"calendar-switch-wrap"},Ee={class:"calendar-drop-down"},De=["aria-expanded"],Ne={class:"calendar-select calendar-year-wrap"},_e={class:"sel year"},ze=["onClick"],Ie={class:"calendar-drop-down"},Me=["aria-expanded"],$e={class:"calendar-select calendar-mon-wrap"},Te={class:"sel month"},Le=["onClick"],xe={class:"calendar-body"},Fe={class:"calendar-table-wrap"},Pe={class:"calendar-tbl"},Oe=["data-date"],Ae=["aria-pressed","onClick"],qe={class:"calendar-footer"},Re={class:"calendar-btn-wrap"},G=e.defineComponent({__name:"KrdsDateInput",props:{modelValue:{default:void 0},size:{default:"medium"},placeholder:{default:"YYYY.MM.DD"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},eventDates:{default:()=>[]},holidays:{default:()=>[]},initialYear:{default:void 0},initialMonth:{default:void 0},name:{default:void 0},required:{type:Boolean,default:!1},class:{default:void 0},style:{},id:{default:void 0}},emits:["update:modelValue","input","change","focus","blur"],setup(t,{emit:o}){const s=t,l=o,i=e.ref(),a=e.ref(),n=e.ref(!1),d=e.ref(null),{currentYear:u,currentMonth:p,selectedStartDate:h,selectedEndDate:B,yearOptions:g,monthOptions:E,prevMonth:c,nextMonth:r,handleDateSelection:k,selectToday:m,isDateInSelectedRange:S}=be(s.initialYear,s.initialMonth),v=()=>{n.value&&a.value?.focus(),n.value=!1,d.value=null};Se(i,v,".calendar-conts");const z=e.computed(()=>{const f=["krds-input","datepicker","cal"];return s.size&&f.push(s.size),s.class&&f.push(s.class),f}),N=e.computed(()=>["form-conts","calendar-conts"]),D=e.computed(()=>({"krds-calendar-area":!0,active:n.value})),K=e.computed(()=>{const f=u.value,b=p.value,C=new Date(f,b-1,1),I=new Date(C);I.setDate(I.getDate()-C.getDay());const _=[],w=new Date(I);for(let P=0;P<6;P++){const pe=[];for(let ye=0;ye<7;ye++){const mt=`${w.getFullYear()}.${String(w.getMonth()+1).padStart(2,"0")}.${String(w.getDate()).padStart(2,"0")}`,ke=w.getDay();pe.push({day:w.getDate(),dateString:mt,isCurrentMonth:w.getMonth()===b-1,isToday:w.toDateString()===new Date().toDateString(),isPrevMonth:w.getMonth()<b-1||w.getMonth()===11&&b===1,isNextMonth:w.getMonth()>b-1||w.getMonth()===0&&b===12,isSunday:ke===0,isSaturday:ke===6}),w.setDate(w.getDate()+1)}_.push(pe)}return _}),M=f=>{const b=[];if(f.isPrevMonth&&b.push("old"),f.isNextMonth&&b.push("new"),f.isToday&&b.push("today"),f.isSunday&&b.push("day-off"),s.holidays?.includes(f.dateString)&&b.push("day-off"),s.eventDates?.includes(f.dateString)&&b.push("day-event"),f.isCurrentMonth){const C=S(f.dateString);C.isInRange&&(b.push("period"),C.isStart&&b.push("start"),C.isEnd&&b.push("end"))}return b},V=e.computed(()=>[{id:"get-today",label:"오늘",class:"text",variant:void 0,size:"small",handler:m},{id:"cancel-btn",label:"취소",class:void 0,variant:"tertiary",size:"small",handler:v},{id:"confirm-btn",label:"확인",class:void 0,variant:"primary",size:"small",handler:st}]),ge=f=>{d.value===f?d.value=null:d.value=f},nt=f=>{u.value=f,d.value=null},lt=f=>{p.value=f,d.value=null},st=()=>{if(h.value){if(B.value&&h.value!==B.value){const f=`${h.value} ~ ${B.value}`;l("update:modelValue",f)}else l("update:modelValue",h.value);v()}},ot=()=>{n.value=!0,d.value=null,setTimeout(()=>{i.value?.querySelector(".calendar-wrap")?.focus()},50)},rt=()=>{n.value?v():ot()},it=f=>{f.code==="Escape"&&(d.value?d.value=null:n.value&&v())},dt=f=>{const b=f.target;l("update:modelValue",b.value),l("input",f)},ct=f=>{l("change",f)},ut=f=>{l("focus",f)},ft=f=>{l("blur",f)};return(f,b)=>(e.openBlock(),e.createElementBlock("div",Ce,[e.createElementVNode("div",{class:e.normalizeClass(N.value)},[e.createElementVNode("div",Be,[e.createElementVNode("input",{id:f.id,name:f.name,class:e.normalizeClass(z.value),placeholder:f.placeholder,value:f.modelValue,readonly:f.readonly,disabled:f.disabled,required:f.required,autofocus:f.autofocus,type:"text",onInput:dt,onChange:ct,onFocus:ut,onBlur:ft},null,42,Ve),e.createElementVNode("button",{ref_key:"datePickerButtonRef",ref:a,class:e.normalizeClass(`krds-btn ${f.size||"medium"} icon form-btn-datepicker`),disabled:f.disabled,"aria-expanded":n.value,type:"button",onClick:rt},[...b[4]||(b[4]=[e.createElementVNode("span",{class:"sr-only"},"달력 열기",-1),e.createElementVNode("i",{class:"svg-icon ico-calendar"},null,-1)])],10,ve)]),e.createElementVNode("div",{ref_key:"datePickerAreaRef",ref:i,class:e.normalizeClass(D.value)},[e.withDirectives(e.createElementVNode("div",{class:"calendar-wrap bottom","aria-label":"달력",tabindex:"0",onKeydown:it},[e.createElementVNode("div",we,[e.createElementVNode("button",{type:"button",class:"btn-cal-move prev",onClick:b[0]||(b[0]=(...C)=>e.unref(c)&&e.unref(c)(...C))},[...b[5]||(b[5]=[e.createElementVNode("span",{class:"sr-only"},"이전 달",-1)])]),e.createElementVNode("div",Ke,[e.createElementVNode("div",Ee,[e.createElementVNode("button",{type:"button",class:"btn-cal-switch year","aria-label":"연도 선택","aria-expanded":d.value==="year",onClick:b[1]||(b[1]=C=>ge("year"))},e.toDisplayString(e.unref(u))+"년 ",9,De),e.withDirectives(e.createElementVNode("div",Ne,[e.createElementVNode("ul",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),C=>(e.openBlock(),e.createElementBlock("li",{key:C},[e.createElementVNode("button",{type:"button",class:e.normalizeClass({active:C===e.unref(u)}),onClick:I=>nt(C)},e.toDisplayString(C)+"년",11,ze)]))),128))])],512),[[e.vShow,d.value==="year"]])]),e.createElementVNode("div",Ie,[e.createElementVNode("button",{type:"button",class:"btn-cal-switch month","aria-label":"월 선택","aria-expanded":d.value==="month",onClick:b[2]||(b[2]=C=>ge("month"))},e.toDisplayString(e.unref(p).toString().padStart(2,"0"))+"월 ",9,Me),e.withDirectives(e.createElementVNode("div",$e,[e.createElementVNode("ul",Te,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(E),C=>(e.openBlock(),e.createElementBlock("li",{key:C},[e.createElementVNode("button",{type:"button",class:e.normalizeClass({active:C===e.unref(p)}),onClick:I=>lt(C)},e.toDisplayString(C.toString().padStart(2,"0"))+"월 ",11,Le)]))),128))])],512),[[e.vShow,d.value==="month"]])])]),e.createElementVNode("button",{type:"button",class:"btn-cal-move next",onClick:b[3]||(b[3]=(...C)=>e.unref(r)&&e.unref(r)(...C))},[...b[6]||(b[6]=[e.createElementVNode("span",{class:"sr-only"},"다음 달",-1)])])]),e.createElementVNode("div",xe,[e.createElementVNode("div",Fe,[e.createElementVNode("table",Pe,[e.createElementVNode("caption",null,e.toDisplayString(e.unref(u))+"년 "+e.toDisplayString(e.unref(p).toString().padStart(2,"0"))+"월",1),b[7]||(b[7]=e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",null,"일"),e.createElementVNode("th",null,"월"),e.createElementVNode("th",null,"화"),e.createElementVNode("th",null,"수"),e.createElementVNode("th",null,"목"),e.createElementVNode("th",null,"금"),e.createElementVNode("th",null,"토")])],-1)),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(K.value,(C,I)=>(e.openBlock(),e.createElementBlock("tr",{key:I},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(C,(_,w)=>(e.openBlock(),e.createElementBlock("td",{key:w,class:e.normalizeClass(M(_)),"data-date":_.dateString},[e.createElementVNode("button",{type:"button",class:"btn-set-date","aria-pressed":e.unref(S)(_.dateString).isInRange?"true":"false",onClick:P=>e.unref(k)(_.dateString)},[e.createElementVNode("span",null,e.toDisplayString(_.day),1)],8,Ae)],10,Oe))),128))]))),128))])])])]),e.createElementVNode("div",qe,[e.createElementVNode("div",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V.value,C=>(e.openBlock(),e.createBlock(e.unref(L),{id:C.id,key:C.id,class:e.normalizeClass(C.class),variant:C.variant,size:C.size,onClick:C.handler},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(C.label),1)]),_:2},1032,["id","class","variant","size","onClick"]))),128))])])],544),[[e.vShow,n.value]])],2)],2)]))}}),U=e.defineComponent({name:"KrdsTextarea",props:{modelValue:{type:String,default:""},size:{type:String,default:void 0},placeholder:{type:String,default:void 0},maxlength:{type:Number,default:void 0},minlength:{type:Number,default:void 0},rows:{type:Number,default:4},cols:{type:Number,default:void 0},autofocus:{type:Boolean,default:!1},name:{type:String,default:void 0},required:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},showCount:{type:Boolean,default:!0},resize:{type:String,default:"vertical"},class:{type:String,default:void 0},style:{type:[String,Object],default:void 0},id:{type:String,default:void 0}},emits:["update:modelValue","input","change","focus","blur","keydown","keyup"],setup(t,{emit:o}){const s=e.ref(0);e.watch(()=>t.modelValue,r=>{s.value=(r||"").length},{immediate:!0});const l=e.computed(()=>{const r=["krds-input"];return t.size&&r.push(t.size),t.class&&r.push(t.class),r}),i=e.computed(()=>{const r={};return t.resize&&(r.resize=t.resize),r}),a=r=>{const m=r.target.value;s.value=m.length,o("update:modelValue",m),o("input",r)},n=r=>{o("change",r)},d=r=>{o("focus",r)},u=r=>{o("blur",r)},p=r=>{o("keydown",r)},h=r=>{o("keyup",r)},B=e.computed(()=>{const r={class:l.value,style:i.value,value:t.modelValue,placeholder:t.placeholder,name:t.name,id:t.id,required:t.required,readonly:t.readonly,disabled:t.disabled,autofocus:t.autofocus,rows:t.rows,cols:t.cols,onInput:a,onChange:n,onFocus:d,onBlur:u,onKeydown:p,onKeyup:h};return t.maxlength!==void 0&&(r.maxlength=t.maxlength),t.minlength!==void 0&&(r.minlength=t.minlength),r}),g=e.computed(()=>["form-conts"]),E=e.computed(()=>["textarea-wrap"]),c=e.computed(()=>{if(!t.showCount)return null;const r=s.value,k=t.maxlength;return{current:r,max:k||""}});return()=>{const r=[e.h("textarea",B.value)];return c.value&&r.push(e.h("p",{class:"textarea-count"},[e.h("span",{class:"count-now"},c.value.current),e.h("span",{class:"count-total"},c.value.max?`/${c.value.max}`:"")])),e.h("div",{class:g.value},[e.h("div",{class:E.value},r)])}}}),W=e.defineComponent({name:"KrdsSelect",props:{modelValue:{type:[String,Number,null],default:null},size:{type:String,default:"medium"},title:{type:String,default:void 0},options:{type:Array,default:()=>[]},placeholder:{type:String,default:"선택"},name:{type:String,default:void 0},disabled:{type:Boolean,default:!1},state:{type:String,default:"default"},sort:{type:Boolean,default:!1},class:{type:String,default:void 0},id:{type:String,default:void 0}},emits:["update:modelValue","focus","blur"],setup(t,{emit:o,slots:s}){const l=e.computed(()=>{const h=[];return t.sort?h.push("krds-form-select-sort"):h.push("krds-form-select"),t.size&&h.push(t.size),t.class&&h.push(t.class),h}),i=h=>{const B=h.target,g=B.value===""?null:B.value;o("update:modelValue",g)},a=h=>{o("focus",h)},n=h=>{o("blur",h)},d=e.computed(()=>({class:l.value,value:t.modelValue??"",title:t.title||t.placeholder,name:t.name,id:t.id,disabled:t.disabled||t.readonly,onChange:i,onFocus:a,onBlur:n})),u=e.computed(()=>{const h=["form-conts"];return t.state!=="default"&&h.push(`is-${t.state}`),h}),p=()=>{const h=[];return t.placeholder&&!t.modelValue&&h.push(e.h("option",{value:"",disabled:!0,selected:!0},t.placeholder)),t.options&&t.options.length>0&&t.options.forEach(B=>{h.push(e.h("option",{value:B.value,disabled:B.disabled,selected:B.value===t.modelValue},B.label))}),s.default&&h.push(...s.default()),h};return()=>{const h=e.h("select",d.value,p());return t.sort?h:e.h("div",{class:u.value},[h])}}}),J=e.defineComponent({name:"KrdsFileUpload",props:{modelValue:{type:Array,default:()=>[]},size:{type:String,default:"medium"},accept:{type:String,default:void 0},maxFiles:{type:Number,default:10},maxFileSize:{type:Number,default:20*1024*1024},multiple:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},dragAndDrop:{type:Boolean,default:!0},title:{type:String,default:"타이틀영역"},description:{type:String,default:"컨텐츠 영역"},placeholder:{type:String,default:"첨부할 파일을 여기에 끌어다 놓거나, 파일 선택 버튼을 눌러 파일을 직접 선택해주세요."},showPreview:{type:Boolean,default:!0},showDownload:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showClearAll:{type:Boolean,default:!0},name:{type:String,default:void 0},required:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},class:{type:String,default:void 0},style:{type:[String,Object],default:void 0},id:{type:String,default:void 0}},emits:["update:modelValue","file-added","file-removed","file-error","upload-start","upload-progress","upload-complete","upload-error","clear-all","download","preview"],setup(t,{emit:o}){e.ref(!1),e.computed(()=>{const l=["krds-file-upload","line"];return t.class&&l.push(t.class),l});const s=e.computed(()=>t.modelValue?.length||0);return e.computed(()=>!t.disabled&&s.value<t.maxFiles),()=>null}}),Q=e.defineComponent({name:"KrdsBadge",props:{type:{type:String,default:"outline"},color:{type:String,default:"primary"},size:{type:String,default:"large"},number:{type:Boolean,default:!1},class:{type:String,default:void 0}},emits:["click"],setup(t,{emit:o,slots:s}){const l=e.computed(()=>{const a=["krds-badge"];return a.push(`${t.type}-${t.color}`),t.size&&a.push(t.size),t.number&&a.push("number"),t.class&&a.push(t.class),a}),i=a=>{o("click",a)};return()=>e.h("span",{type:t.type,color:t.color,size:t.size,number:t.number,class:l.value,onClick:i},s.default?.())}}),X=e.defineComponent({name:"KrdsTag",props:{link:{type:Boolean,default:!1},href:{type:String,default:"#"},target:{type:String,default:void 0},rel:{type:String,default:void 0},class:{type:String,default:void 0}},emits:["remove"],setup(t,{emit:o,slots:s}){const l=e.computed(()=>{const n=["krds-btn-tag"];return t.link&&n.push("link"),t.class&&n.push(t.class),n}),i=n=>{o("remove",n)},a=()=>e.h("button",{type:"button",class:"btn-delete",onClick:i},[e.h("span",{class:"sr-only"},"삭제")]);return()=>{const n=[],d=s.default?.();if(d&&n.push(d),t.link||n.push(a()),t.link){const u={href:t.href,class:l.value};return t.target&&(u.target=t.target),t.rel&&(u.rel=t.rel),e.h("a",u,n)}return e.h("span",{class:l.value},n)}}}),Z=e.defineComponent({name:"KrdsTagGroup",props:{size:{type:String,default:"medium"},class:{type:String,default:void 0}},setup(t,{slots:o}){const s=e.computed(()=>{const l=["krds-tag-wrap"];return t.size&&l.push(t.size),t.class&&l.push(t.class),l});return()=>e.h("div",{class:s.value},o.default?.())}}),ee=e.defineComponent({name:"KrdsMasthead",props:{class:{type:String,default:void 0}},emits:["click"],setup(t,{emit:o,slots:s}){const l=e.computed(()=>{const a=[""];return t.class&&a.push(t.class),a}),i=a=>{o("click",a)};return()=>e.h("div",{id:"krds-masthead",class:l.value,onClick:i},[e.h("div",{class:"toggle-wrap"},[e.h("div",{class:"toggle-head"},[e.h("div",{class:"inner"},[e.h("span",{class:"nuri-txt"},s.default?.())])])])])}});let He=0;function $(t="krds"){return`${t}-${++He}`}function je(){const t=Date.now().toString(36).slice(-4),o=Math.random().toString(36).substring(2,5);return`${t}${o}`}function T(...t){return t.filter(Boolean).join(" ")}const te=e.defineComponent({name:"KrdsToggleSwitch",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},label:{type:String,default:void 0},size:{type:String,default:"medium",validator:t=>["medium","large"].includes(t)},name:{type:String,default:void 0},required:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},class:{type:String,default:void 0},id:{type:String,default:void 0}},emits:["update:modelValue","change"],setup(t,{emit:o,attrs:s}){const l=e.computed(()=>t.modelValue),i=e.computed(()=>T("krds-form-toggle-switch",t.size,t.class)),a=d=>{if(t.disabled)return;const p=d.target.checked;o("update:modelValue",p),o("change",p)},n=e.computed(()=>t.id||$("toggle-switch"));return()=>e.h("div",{class:i.value},[e.h("input",{type:"checkbox",id:n.value,name:t.name,checked:l.value,disabled:t.disabled,onChange:a,...s}),e.h("label",{for:n.value},[e.h("span",{class:"switch-toggle"},[e.h("i")]),t.label||""])])}}),ae=e.defineComponent({name:"KrdsCheckArea",props:{class:{type:String,default:void 0},column:{type:Boolean,default:!1}},setup(t,{slots:o}){return()=>{const s=["krds-check-area"];return t.column&&s.push("chk-column"),t.class&&s.push(t.class),e.h("div",{class:s},o.default?.())}}}),ne=e.defineComponent({name:"KrdsCheckbox",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:t=>["medium","large"].includes(t)},chip:{type:Boolean,default:!1},class:{type:String,default:void 0},id:{type:String,default:void 0}},emits:["update:modelValue"],slots:Object,setup(t,{emit:o,attrs:s,slots:l}){const i=e.computed(()=>t.modelValue),a=e.computed(()=>{const u=t.chip?"krds-form-chip":"krds-form-check";return T(u,t.size,t.class)}),n=u=>{if(t.disabled)return;const h=u.target.checked;o("update:modelValue",h)},d=e.computed(()=>t.id||$("checkbox"));return()=>{const u=[e.h("input",{type:"checkbox",id:d.value,checked:i.value,disabled:t.disabled,onChange:n,...s}),e.h("label",{for:d.value},l.default?.())];return l.description&&!t.chip&&u.push(e.h("div",{class:"krds-form-check-cnt"},e.h("p",{class:"krds-form-check-p"},l.description()))),e.h("div",{class:a.value},u)}}}),le=e.defineComponent({name:"KrdsRadio",props:{modelValue:{type:[String,Number,Boolean],default:void 0},value:{type:[String,Number,Boolean],required:!0},disabled:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:t=>["medium","large"].includes(t)},chip:{type:Boolean,default:!1},name:{type:String,default:void 0},class:{type:String,default:void 0},id:{type:String,default:void 0}},emits:["update:modelValue"],slots:Object,setup(t,{emit:o,attrs:s,slots:l}){const i=e.computed(()=>t.modelValue===t.value),a=e.computed(()=>{const p=t.chip?"krds-form-chip":"krds-form-check";return T(p,t.size,t.class)}),n=p=>{if(t.disabled)return;p.target.checked&&o("update:modelValue",t.value)},d=e.computed(()=>t.id||$("radio")),u=e.computed(()=>t.name);return()=>{const p=[e.h("input",{type:"radio",id:d.value,name:u.value,value:String(t.value),checked:i.value,disabled:t.disabled,onChange:n,...s}),e.h("label",{for:d.value},l.default?.())];return l.description&&!t.chip&&p.push(e.h("div",{class:"krds-form-check-cnt"},e.h("p",{class:"krds-form-check-p"},l.description()))),e.h("div",{class:a.value},p)}}}),se=e.defineComponent({name:"KrdsStepIndicator",props:{modelValue:{type:Number,default:0},class:{type:String,default:void 0}},emits:["update:modelValue"],setup(t,{slots:o}){const s=e.computed(()=>{const d=["krds-step-wrap"];return t.class&&d.push(t.class),d}),l=d=>{const u=t.modelValue||0;return d<u?"done":d===u?"active":"pending"},i=e.ref(0),a=()=>{i.value=0},n=()=>i.value++;return e.provide("stepIndicator",{activeStep:e.computed(()=>t.modelValue||0),getStepStatus:l,getNextStepIndex:n,resetStepIndex:a}),()=>(a(),e.h("ol",{class:s.value},o.default?.()))}}),oe=e.defineComponent({name:"KrdsStep",props:{step:{type:[String,Number],required:!0},title:{type:String,required:!0},status:{type:String,default:void 0},class:{type:String,default:void 0}},emits:["click"],setup(t,{emit:o,slots:s}){const l=e.inject("stepIndicator"),i=l?l.getNextStepIndex():-1,a=e.computed(()=>t.status?t.status:l&&i>=0?l.getStepStatus(i):"pending"),n=e.computed(()=>{const u=[a.value];return t.class&&u.push(t.class),u}),d=u=>{o("click",u,t.step)};return()=>{const u=a.value==="active";return e.h("li",{class:n.value,onClick:d},[e.h("span",[u&&e.h("em",{class:"sr-only"},"현재단계"),e.h("i",{class:"step"},t.step),e.h("span",{class:"step-tit"},t.title),s.default?.()])])}}}),re=e.defineComponent({name:"KrdsSkipLink",props:{href:{type:String,required:!0,validator:t=>t.startsWith("#")},class:{type:[String,Array,Object],default:void 0},id:{type:String,default:"krds-skip-link"}},setup(t,{slots:o}){return()=>e.h("div",{id:t.id,class:t.class},[e.h("a",{href:t.href},o.default?.())])}}),Ye=["id","aria-label"],Ge={class:"breadcrumb"},Ue=["href","aria-current","onClick"],We={key:0},ie=e.defineComponent({__name:"KrdsBreadcrumb",props:{items:{},id:{default:void 0},ariaLabel:{default:"현재 경로"},showHomeIcon:{type:Boolean,default:!0}},emits:["item-click"],setup(t,{emit:o}){const s=t,l=o,i=n=>n===s.items.length-1,a=(n,d)=>{n.onClick&&n.onClick(d),l("item-click",n,d)};return(n,d)=>(e.openBlock(),e.createElementBlock("nav",{id:n.id,class:"krds-breadcrumb-wrap","aria-label":n.ariaLabel},[e.createElementVNode("ol",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(n.items,(u,p)=>(e.openBlock(),e.createElementBlock("li",{key:`breadcrumb-${p}`,class:e.normalizeClass({home:p===0&&n.showHomeIcon})},[e.createElementVNode("a",{href:u.href||"#",class:"txt","aria-current":i(p)?"page":void 0,onClick:h=>a(u,h)},[p===0&&n.showHomeIcon?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",We,e.toDisplayString(u.text),1))],8,Ue)],2))),128))])],8,Ye))}}),de=e.defineComponent({name:"KrdsInPageNavigation",props:{title:{type:String,default:void 0},caption:{type:String,default:"이 페이지의 구성"},items:{type:Array,default:()=>[]},autoActive:{type:Boolean,default:!0},headerTopSelector:{type:String,default:"#krds-masthead"},headerInnerSelector:{type:String,default:"#krds-header .header-in"},class:{type:String,default:void 0}},emits:["itemClick"],slots:Object,setup(t,{emit:o,slots:s}){const l=e.ref(""),i=e.ref(new Map),a=e.computed(()=>{const c=["krds-in-page-navigation-type"];return t.class&&c.push(t.class),c}),n=()=>{const c=t.headerTopSelector,r=t.headerInnerSelector,k=document.querySelector(c)?.clientHeight||0,m=document.querySelector(r)?.clientHeight||0;return k+m},d=(c,r)=>{if(o("itemClick",c,r),c.href.startsWith("#")){r.preventDefault();const k=document.querySelector(c.href);if(k){const m=n();if(window.scrollTo({left:0,top:k.getBoundingClientRect().top+window.scrollY-m,behavior:"smooth"}),l.value=c.href,r instanceof KeyboardEvent){const S=k.querySelector(".sec-tit, h1, h2, h3, h4, h5, h6");S&&S instanceof HTMLElement&&(S.setAttribute("tabindex","-1"),S.focus({preventScroll:!0}))}}}},u=()=>{i.value.clear(),t.items&&t.items.filter(c=>c.href.startsWith("#")).forEach(c=>{const r=document.querySelector(c.href);r&&i.value.set(c.href,r)})},p=()=>{if(!t.autoActive||!t.items||i.value.size===0)return;const c=window.innerHeight,r=Math.ceil(c/5),k=window.scrollY+c,m=document.body.scrollHeight,S=t.items.filter(K=>K.href.startsWith("#")&&i.value.has(K.href)).map(K=>({href:K.href,element:i.value.get(K.href),item:K}));if(S.length===0)return;const v=S[0],z=S[S.length-1],N=v.element.offsetTop;let D="";if(k>=m)D=z.href;else if(window.scrollY<=N)D=v.href;else for(const K of S){const M=K.element.offsetHeight,V=K.element.offsetTop-r;if(window.scrollY>V&&window.scrollY<=V+M){D=K.href;break}}D&&D!==l.value&&(l.value=D)},h=()=>{if(!t.items)return;const c=t.items.find(r=>r.active);c?l.value=c.href:t.items.length>0&&(l.value=t.items[0].href)};e.onMounted(()=>{if(h(),t.autoActive){u(),p(),window.addEventListener("scroll",p,{passive:!0});const c=new MutationObserver(()=>{u()});c.observe(document.body,{childList:!0,subtree:!0}),e.onUnmounted(()=>{c.disconnect()})}}),e.onUnmounted(()=>{t.autoActive&&(window.removeEventListener("scroll",p),i.value.clear())});const B=()=>!t.caption&&!t.title?null:e.h("div",{class:"in-page-navigation-header"},[t.caption&&e.h("p",{class:"quick-caption"},t.caption),t.title&&e.h("p",{class:"quick-title"},t.title)]),g=()=>{if(!t.items)return null;const c=t.items.map(r=>{const k=l.value===r.href||!t.autoActive&&r.active;return e.h("li",{key:r.href},[e.h("a",{href:r.href,class:k?"active":"",onClick:m=>d(r,m),onKeydown:m=>{(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),d(r,m))}},r.text)])});return e.h("nav",{class:"in-page-navigation-list"},[e.h("ul",{},c)])},E=()=>s.action?e.h("div",{class:"in-page-navigation-action"},[s.action()]):null;return()=>e.h("div",{class:a.value},[e.h("div",{class:"krds-in-page-navigation-area"},[B(),g(),E()].filter(Boolean))])}}),Je=["id"],Qe={class:"page-links"},Xe=["href","aria-current","onClick"],Ze={key:0},et=["aria-label"],ce=e.defineComponent({__name:"KrdsPagination",props:{modelValue:{default:1},min:{default:1},max:{},id:{default:void 0},ariaLabel:{default:"페이지 내비게이션"},pageRange:{default:8}},emits:["update:modelValue"],setup(t,{emit:o}){const s=t,l=o,i=e.computed(()=>Math.max(1,s.min)),a=e.computed(()=>s.modelValue??i.value),n=e.computed(()=>a.value<=i.value),d=e.computed(()=>a.value>=s.max),u=e.computed(()=>{if(!n.value)return"#"}),p=e.computed(()=>{if(!d.value)return"#"}),h=e.computed(()=>{const{pageRange:c,max:r}=s,k=1,m=[];if(r<=c+2*k)for(let S=i.value;S<=r;S++)m.push({type:"page",key:`page-${S}`,page:S,href:"#"});else{const S=Math.min(k,r),v=Math.max(r-k+1,1),z=Math.max(i.value,a.value-Math.floor(c/2)),N=Math.min(r,z+c-1),D=Math.max(i.value,N-c+1);for(let V=i.value;V<=S;V++)m.push({type:"page",key:`page-${V}`,page:V,href:"#"});D>S+1&&m.push({type:"ellipsis",key:"ellipsis-left",ariaLabel:"페이지 생략"});const K=Math.max(D,S+1),M=Math.min(N,v-1);for(let V=K;V<=M;V++)m.push({type:"page",key:`page-${V}`,page:V,href:"#"});N<v-1&&m.push({type:"ellipsis",key:"ellipsis-right",ariaLabel:"페이지 생략"});for(let V=v;V<=r;V++)m.push({type:"page",key:`page-${V}`,page:V,href:"#"})}return m}),B=(c,r)=>{if(c===a.value){r.preventDefault();return}l("update:modelValue",c)},g=c=>{if(n.value){c.preventDefault();return}const r=a.value-1;l("update:modelValue",r)},E=c=>{if(d.value){c.preventDefault();return}const r=a.value+1;l("update:modelValue",r)};return(c,r)=>{const k=e.resolveDirective("sr-only");return e.openBlock(),e.createElementBlock("div",{id:c.id,class:"krds-pagination"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(n.value?"span":"a"),{href:n.value?void 0:u.value,class:e.normalizeClass(["page-navi","prev",{disabled:n.value}]),onClick:g},{default:e.withCtx(()=>[...r[0]||(r[0]=[e.createTextVNode(" 이전 ",-1)])]),_:1},8,["href","class"])),e.createElementVNode("div",Qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,m=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:m.key},[m.type==="page"?(e.openBlock(),e.createElementBlock("a",{key:0,href:m.href||"#",class:e.normalizeClass(["page-link",{active:m.page===a.value}]),"aria-current":m.page===a.value?"page":void 0,onClick:S=>B(m.page,S)},[m.page===a.value?e.withDirectives((e.openBlock(),e.createElementBlock("span",Ze,[...r[1]||(r[1]=[e.createTextVNode("현재페이지",-1)])])),[[k]]):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(m.page),1)],10,Xe)):m.type==="ellipsis"?(e.openBlock(),e.createElementBlock("span",{key:1,class:"page-link link-dot","aria-label":m.ariaLabel},null,8,et)):e.createCommentVNode("",!0)],64))),128))]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(d.value?"span":"a"),{href:d.value?void 0:p.value,class:e.normalizeClass(["page-navi","next",{disabled:d.value}]),onClick:E},{default:e.withCtx(()=>[...r[2]||(r[2]=[e.createTextVNode(" 다음 ",-1)])]),_:1},8,["href","class"]))],8,Je)}}}),ue=Object.freeze(Object.defineProperty({__proto__:null,KrdsBadge:Q,KrdsBreadcrumb:ie,KrdsButton:L,KrdsButtonGroup:O,KrdsCheckArea:ae,KrdsCheckbox:ne,KrdsDateInput:G,KrdsFileUpload:J,KrdsFormGroup:Y,KrdsFormHint:j,KrdsFormLabel:H,KrdsIcon:A,KrdsInPageNavigation:de,KrdsInput:R,KrdsLink:q,KrdsMasthead:ee,KrdsPagination:ce,KrdsRadio:le,KrdsSelect:W,KrdsSkipLink:re,KrdsSpinner:x,KrdsStep:oe,KrdsStepIndicator:se,KrdsTag:X,KrdsTagGroup:Z,KrdsTextarea:U,KrdsToggleSwitch:te},Symbol.toStringTag,{value:"Module"})),F={mounted(t,o){o.value!==!1&&t.classList.add("sr-only")},updated(t,o){o.value===!1?t.classList.remove("sr-only"):t.classList.add("sr-only")},unmounted(t){t.classList.remove("sr-only")}},fe={"sr-only":F},me=t=>{t.directive("sr-only",F)},he=Object.freeze(Object.defineProperty({__proto__:null,default:fe,directives:fe,installDirectives:me,vSrOnly:F},Symbol.toStringTag,{value:"Module"})),tt={install(t,o={}){t.provide("krds:config",o);const s=o.components||Object.keys(ue);s.forEach(l=>{const i=ue[l];i&&t.component(l,i)}),typeof he=="object"&&he!==null&&me(t),t.config.globalProperties.$krds={version:"__VERSION__"},process.env.NODE_ENV!=="production"&&console.log(`[KRDS Vue] v__VERSION__ 설치 완료 - 컴포넌트: ${s.length}개`)}},at="__VERSION__";y.KrdsBadge=Q,y.KrdsBreadcrumb=ie,y.KrdsButton=L,y.KrdsButtonGroup=O,y.KrdsCheckArea=ae,y.KrdsCheckbox=ne,y.KrdsDateInput=G,y.KrdsFileUpload=J,y.KrdsFormGroup=Y,y.KrdsFormHint=j,y.KrdsFormLabel=H,y.KrdsIcon=A,y.KrdsInPageNavigation=de,y.KrdsInput=R,y.KrdsLink=q,y.KrdsMasthead=ee,y.KrdsPagination=ce,y.KrdsRadio=le,y.KrdsSelect=W,y.KrdsSkipLink=re,y.KrdsSpinner=x,y.KrdsStep=oe,y.KrdsStepIndicator=se,y.KrdsTag=X,y.KrdsTagGroup=Z,y.KrdsTextarea=U,y.KrdsToggleSwitch=te,y.classNames=T,y.default=tt,y.generateId=$,y.generateUid=je,y.version=at,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(b,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(b=typeof globalThis<"u"?globalThis:b||self,e(b.KrdsVue={},b.Vue))})(this,(function(b,e){"use strict";const O=e.defineComponent({name:"KrdsButton",props:{type:{type:String,default:"button"},size:{type:String,default:void 0},variant:{type:String,default:"primary"},icon:{type:Boolean,default:!1},border:{type:Boolean,default:!1},pure:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},class:{type:String,default:void 0}},emits:["click"],setup(t,{emit:r,slots:s}){const a=e.computed(()=>{const o=["krds-btn"];return t.icon&&o.push("icon"),t.border&&o.push("border"),t.pure&&o.push("pure"),t.variant&&!t.icon&&o.push(t.variant),t.size&&o.push(t.size),t.class&&o.push(t.class),o}),n=o=>{t.disabled||r("click",o)};return()=>e.h("button",{type:t.type,class:a.value,disabled:t.disabled,onClick:n},s.default?.())}}),Y=e.defineComponent({name:"KrdsButtonGroup",props:{},setup(t,{slots:r}){return()=>e.h("div",{class:"btn-group"},r.default?.())}}),G=e.defineComponent({name:"KrdsIcon",props:{name:{type:String,required:!0},class:{type:String,default:void 0}},setup(t){return()=>e.h("i",{class:["svg-icon",t.name,t.class].filter(Boolean).join(" ")})}}),U=e.defineComponent({name:"KrdsLink",props:{href:{type:String,default:"#!"},target:{type:String,default:void 0},title:{type:String,default:void 0},size:{type:String,default:void 0},link:{type:Boolean,default:!0},basic:{type:Boolean,default:!1},pure:{type:Boolean,default:!1},class:{type:String,default:void 0}},emits:["click"],setup(t,{emit:r,slots:s}){const a=e.computed(()=>{const i=["krds-btn"];return t.size&&i.push(t.size),t.link&&i.push("link"),t.basic&&i.push("basic"),t.pure&&i.push("pure"),t.class&&i.push(t.class),i}),n=e.computed(()=>{const i={href:t.href,class:a.value};return t.target&&(i.target=t.target),t.title&&(i.title=t.title),t.target==="_blank"&&(i.rel="noopener noreferrer"),i}),o=i=>{r("click",i)};return()=>e.h("a",{...n.value,onClick:o},s.default?.())}}),q=e.defineComponent({name:"KrdsSpinner",props:{label:{type:String,default:void 0}},render(){const t=[e.h("span",{class:"sr-only"},"로딩 중")];return this.label&&t.push(e.h("span",this.label)),e.h("div",{class:"krds-spinner",role:"status"},t)}}),X=e.defineComponent({name:"KrdsInput",props:{modelValue:{type:[String,Number],default:void 0},type:{type:String,default:"text"},size:{type:String,default:void 0},placeholder:{type:String,default:void 0},maxlength:{type:Number,default:void 0},minlength:{type:Number,default:void 0},max:{type:Number,default:void 0},min:{type:Number,default:void 0},step:{type:Number,default:void 0},autocomplete:{type:String,default:void 0},autofocus:{type:Boolean,default:!1},name:{type:String,default:void 0},required:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},error:{type:String,default:void 0},state:{type:String,default:"default"},icon:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},class:{type:String,default:void 0},id:{type:String,default:void 0}},emits:["update:modelValue","input","change","focus","blur","keydown","keyup"],setup(t,{emit:r,slots:s}){const a=e.computed(()=>{const g=["krds-input"];return t.size&&g.push(t.size),t.class&&g.push(t.class),g}),n=g=>{const w=g.target,m=t.type==="number"?Number(w.value):w.value;r("update:modelValue",m),r("input",g)},o=g=>{r("change",g)},i=g=>{r("focus",g)},u=g=>{r("blur",g)},d=g=>{r("keydown",g)},h=g=>{r("keyup",g)},y=e.computed(()=>{const g={type:t.type,class:a.value,value:t.modelValue,placeholder:t.placeholder,name:t.name,id:t.id,required:t.required,readonly:t.readonly,disabled:t.disabled,autocomplete:t.autocomplete,autofocus:t.autofocus,onInput:n,onChange:o,onFocus:i,onBlur:u,onKeydown:d,onKeyup:h};return t.maxlength!==void 0&&(g.maxlength=t.maxlength),t.minlength!==void 0&&(g.minlength=t.minlength),t.type==="number"&&(t.max!==void 0&&(g.max=t.max),t.min!==void 0&&(g.min=t.min),t.step!==void 0&&(g.step=t.step)),g}),C=e.computed(()=>{const g=["form-conts"];return t.state!=="default"&&g.push(`is-${t.state}`),t.icon&&g.push("btn-ico-wrap"),g});return()=>{const g=[e.h("input",y.value)];return t.loading?e.h("div",{class:C.value},[e.h("div",{class:"form-spinner"},[...g,e.h(q)])]):(s.default&&g.push(...s.default()),e.h("div",{class:C.value},g))}}}),J=e.defineComponent({name:"KrdsFormLabel",props:{for:{type:String,default:void 0},class:{type:String,default:void 0},style:{type:[String,Object],default:void 0},id:{type:String,default:void 0}},emits:["click"],setup(t,{emit:r,slots:s}){const a=n=>{r("click",n)};return()=>e.h("div",{class:"form-tit"},[e.h("label",{for:t.for,id:t.id,class:t.class,style:t.style,onClick:a},s.default?.())])}}),Q=e.defineComponent({name:"KrdsFormHint",props:{type:{type:String,default:"hint"},class:{type:String,default:void 0},style:{type:[String,Object],default:void 0},id:{type:String,default:void 0}},emits:["click"],setup(t,{emit:r,slots:s}){const a=o=>{r("click",o)},n=()=>{let o;switch(t.type){case"error":o="form-hint-invalid";break;case"success":o="form-hint-success";break;case"information":o="form-hint-information";break;default:o="form-hint";break}return t.class?`${o} ${t.class}`:o};return()=>e.h("p",{id:t.id,class:n(),style:t.style,onClick:a},s.default?.())}}),Z=e.defineComponent({name:"KrdsFormGroup",props:{class:{type:String,default:void 0},style:{type:[String,Object],default:void 0},id:{type:String,default:void 0}},setup(t,{slots:r}){const s=e.computed(()=>{const a=["form-group"];return t.class&&a.push(t.class),a});return()=>e.h("div",{id:t.id,class:s.value,style:t.style},r.default?.())}});function $e(t,r){const s=new Date,a=e.ref(t||s.getFullYear()),n=e.ref(r||s.getMonth()+1),o=e.ref(null),i=e.ref(null),u=e.ref(null),d=e.computed(()=>{const p=s.getFullYear(),c=[];for(let f=p-10;f<=p+10;f++)c.push(f);return c}),h=e.computed(()=>Array.from({length:12},(p,c)=>c+1)),y=()=>{o.value=null,i.value=null},C=()=>{n.value===1?(n.value=12,a.value-=1):n.value-=1},g=()=>{n.value===12?(n.value=1,a.value+=1):n.value+=1},w=(p,c=!1)=>{if(c)o.value=p,i.value=p;else if(!o.value||o.value&&i.value)o.value=p,i.value=null;else{const f=new Date(o.value.replace(/\./g,"-"));new Date(p.replace(/\./g,"-"))<f?(o.value=p,i.value=null):i.value=p}};return{currentYear:a,currentMonth:n,selectedStartDate:o,selectedEndDate:i,activeDateSelector:u,yearOptions:d,monthOptions:h,clearDateSelection:y,prevMonth:C,nextMonth:g,handleDateSelection:w,selectToday:()=>{const p=`${s.getFullYear()}.${String(s.getMonth()+1).padStart(2,"0")}.${String(s.getDate()).padStart(2,"0")}`;w(p,!0)},isDateInSelectedRange:p=>{if(!o.value||!i.value)return{isInRange:!1,isStart:!1,isEnd:!1};const c=new Date(p.replace(/\./g,"-")),f=new Date(o.value.replace(/\./g,"-")),E=new Date(i.value.replace(/\./g,"-")),K=p===o.value,v=p===i.value;return{isInRange:c>=f&&c<=E,isStart:K,isEnd:v}}}}function Le(t,r,s={}){let a=null;const n=typeof s=="string"?{ignore:s}:s,{ignore:o,event:i="click"}=n,u=()=>{a=h=>{const y=h.target;t.value?.contains(y)||o&&y.closest(o)||r()},document.addEventListener(i,a)},d=()=>{if(a){const h=typeof s=="string"?"click":s.event||"click";document.removeEventListener(h,a),a=null}};return e.onMounted(()=>{u()}),e.onBeforeUnmount(()=>{d()}),{setupGlobalListeners:u,removeGlobalListeners:d}}const xe={class:"form-conts"},Ie={class:"calendar-input"},Te=["id","name","placeholder","value","readonly","disabled","required","autofocus"],Me=["disabled","aria-expanded"],Re={class:"calendar-head"},Fe={class:"calendar-switch-wrap"},Pe={class:"calendar-drop-down"},Ae=["aria-expanded"],Oe={class:"calendar-select calendar-year-wrap"},qe={class:"sel year"},He=["onClick"],je={class:"calendar-drop-down"},We=["aria-expanded"],Ye={class:"calendar-select calendar-mon-wrap"},Ge={class:"sel month"},Ue=["onClick"],Xe={class:"calendar-body"},Je={class:"calendar-table-wrap"},Qe={class:"calendar-tbl"},Ze=["data-date"],et=["aria-pressed","onClick"],tt={class:"calendar-footer"},nt={class:"calendar-btn-wrap"},ee=e.defineComponent({__name:"KrdsDateInput",props:{modelValue:{default:void 0},size:{default:"medium"},placeholder:{default:"YYYY.MM.DD"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},autofocus:{type:Boolean,default:!1},eventDates:{default:()=>[]},holidays:{default:()=>[]},initialYear:{default:void 0},initialMonth:{default:void 0},name:{default:void 0},required:{type:Boolean,default:!1},class:{default:void 0},style:{},id:{default:void 0}},emits:["update:modelValue","input","change","focus","blur"],setup(t,{emit:r}){const s=t,a=r,n=e.ref(),o=e.ref(),i=e.ref(!1),u=e.ref(null),{currentYear:d,currentMonth:h,selectedStartDate:y,selectedEndDate:C,yearOptions:g,monthOptions:w,prevMonth:m,nextMonth:l,handleDateSelection:p,selectToday:c,isDateInSelectedRange:f}=$e(s.initialYear,s.initialMonth),E=()=>{i.value&&o.value?.focus(),i.value=!1,u.value=null};Le(n,E,".calendar-conts");const K=e.computed(()=>{const k=["krds-input","datepicker","cal"];return s.size&&k.push(s.size),s.class&&k.push(s.class),k}),v=e.computed(()=>["form-conts","calendar-conts"]),_=e.computed(()=>({"krds-calendar-area":!0,active:i.value})),N=e.computed(()=>{const k=d.value,S=h.value,V=new Date(k,S-1,1),T=new Date(V);T.setDate(T.getDate()-V.getDay());const I=[],D=new Date(T);for(let W=0;W<6;W++){const Ke=[];for(let De=0;De<7;De++){const Gt=`${D.getFullYear()}.${String(D.getMonth()+1).padStart(2,"0")}.${String(D.getDate()).padStart(2,"0")}`,ze=D.getDay();Ke.push({day:D.getDate(),dateString:Gt,isCurrentMonth:D.getMonth()===S-1,isToday:D.toDateString()===new Date().toDateString(),isPrevMonth:D.getMonth()<S-1||D.getMonth()===11&&S===1,isNextMonth:D.getMonth()>S-1||D.getMonth()===0&&S===12,isSunday:ze===0,isSaturday:ze===6}),D.setDate(D.getDate()+1)}I.push(Ke)}return I}),L=k=>{const S=[];if(k.isPrevMonth&&S.push("old"),k.isNextMonth&&S.push("new"),k.isToday&&S.push("today"),k.isSunday&&S.push("day-off"),s.holidays?.includes(k.dateString)&&S.push("day-off"),s.eventDates?.includes(k.dateString)&&S.push("day-event"),k.isCurrentMonth){const V=f(k.dateString);V.isInRange&&(S.push("period"),V.isStart&&S.push("start"),V.isEnd&&S.push("end"))}return S},B=e.computed(()=>[{id:"get-today",label:"오늘",class:"text",variant:void 0,size:"small",handler:c},{id:"cancel-btn",label:"취소",class:void 0,variant:"tertiary",size:"small",handler:E},{id:"confirm-btn",label:"확인",class:void 0,variant:"primary",size:"small",handler:M}]),x=k=>{u.value===k?u.value=null:u.value=k},P=k=>{d.value=k,u.value=null},j=k=>{h.value=k,u.value=null},M=()=>{if(y.value){if(C.value&&y.value!==C.value){const k=`${y.value} ~ ${C.value}`;a("update:modelValue",k)}else a("update:modelValue",y.value);E()}},z=()=>{i.value=!0,u.value=null,setTimeout(()=>{n.value?.querySelector(".calendar-wrap")?.focus()},50)},$=()=>{i.value?E():z()},_e=k=>{k.code==="Escape"&&(u.value?u.value=null:i.value&&E())},A=k=>{const S=k.target;a("update:modelValue",S.value),a("input",k)},jt=k=>{a("change",k)},Wt=k=>{a("focus",k)},Yt=k=>{a("blur",k)};return(k,S)=>(e.openBlock(),e.createElementBlock("div",xe,[e.createElementVNode("div",{class:e.normalizeClass(v.value)},[e.createElementVNode("div",Ie,[e.createElementVNode("input",{id:k.id,name:k.name,class:e.normalizeClass(K.value),placeholder:k.placeholder,value:k.modelValue,readonly:k.readonly,disabled:k.disabled,required:k.required,autofocus:k.autofocus,type:"text",onInput:A,onChange:jt,onFocus:Wt,onBlur:Yt},null,42,Te),e.createElementVNode("button",{ref_key:"datePickerButtonRef",ref:o,class:e.normalizeClass(`krds-btn ${k.size||"medium"} icon form-btn-datepicker`),disabled:k.disabled,"aria-expanded":i.value,type:"button",onClick:$},[...S[4]||(S[4]=[e.createElementVNode("span",{class:"sr-only"},"달력 열기",-1),e.createElementVNode("i",{class:"svg-icon ico-calendar"},null,-1)])],10,Me)]),e.createElementVNode("div",{ref_key:"datePickerAreaRef",ref:n,class:e.normalizeClass(_.value)},[e.withDirectives(e.createElementVNode("div",{class:"calendar-wrap bottom","aria-label":"달력",tabindex:"0",onKeydown:_e},[e.createElementVNode("div",Re,[e.createElementVNode("button",{type:"button",class:"btn-cal-move prev",onClick:S[0]||(S[0]=(...V)=>e.unref(m)&&e.unref(m)(...V))},[...S[5]||(S[5]=[e.createElementVNode("span",{class:"sr-only"},"이전 달",-1)])]),e.createElementVNode("div",Fe,[e.createElementVNode("div",Pe,[e.createElementVNode("button",{type:"button",class:"btn-cal-switch year","aria-label":"연도 선택","aria-expanded":u.value==="year",onClick:S[1]||(S[1]=V=>x("year"))},e.toDisplayString(e.unref(d))+"년 ",9,Ae),e.withDirectives(e.createElementVNode("div",Oe,[e.createElementVNode("ul",qe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(g),V=>(e.openBlock(),e.createElementBlock("li",{key:V},[e.createElementVNode("button",{type:"button",class:e.normalizeClass({active:V===e.unref(d)}),onClick:T=>P(V)},e.toDisplayString(V)+"년",11,He)]))),128))])],512),[[e.vShow,u.value==="year"]])]),e.createElementVNode("div",je,[e.createElementVNode("button",{type:"button",class:"btn-cal-switch month","aria-label":"월 선택","aria-expanded":u.value==="month",onClick:S[2]||(S[2]=V=>x("month"))},e.toDisplayString(e.unref(h).toString().padStart(2,"0"))+"월 ",9,We),e.withDirectives(e.createElementVNode("div",Ye,[e.createElementVNode("ul",Ge,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(e.unref(w),V=>(e.openBlock(),e.createElementBlock("li",{key:V},[e.createElementVNode("button",{type:"button",class:e.normalizeClass({active:V===e.unref(h)}),onClick:T=>j(V)},e.toDisplayString(V.toString().padStart(2,"0"))+"월 ",11,Ue)]))),128))])],512),[[e.vShow,u.value==="month"]])])]),e.createElementVNode("button",{type:"button",class:"btn-cal-move next",onClick:S[3]||(S[3]=(...V)=>e.unref(l)&&e.unref(l)(...V))},[...S[6]||(S[6]=[e.createElementVNode("span",{class:"sr-only"},"다음 달",-1)])])]),e.createElementVNode("div",Xe,[e.createElementVNode("div",Je,[e.createElementVNode("table",Qe,[e.createElementVNode("caption",null,e.toDisplayString(e.unref(d))+"년 "+e.toDisplayString(e.unref(h).toString().padStart(2,"0"))+"월",1),S[7]||(S[7]=e.createElementVNode("thead",null,[e.createElementVNode("tr",null,[e.createElementVNode("th",null,"일"),e.createElementVNode("th",null,"월"),e.createElementVNode("th",null,"화"),e.createElementVNode("th",null,"수"),e.createElementVNode("th",null,"목"),e.createElementVNode("th",null,"금"),e.createElementVNode("th",null,"토")])],-1)),e.createElementVNode("tbody",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(N.value,(V,T)=>(e.openBlock(),e.createElementBlock("tr",{key:T},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(V,(I,D)=>(e.openBlock(),e.createElementBlock("td",{key:D,class:e.normalizeClass(L(I)),"data-date":I.dateString},[e.createElementVNode("button",{type:"button",class:"btn-set-date","aria-pressed":e.unref(f)(I.dateString).isInRange?"true":"false",onClick:W=>e.unref(p)(I.dateString)},[e.createElementVNode("span",null,e.toDisplayString(I.day),1)],8,et)],10,Ze))),128))]))),128))])])])]),e.createElementVNode("div",tt,[e.createElementVNode("div",nt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,V=>(e.openBlock(),e.createBlock(e.unref(O),{id:V.id,key:V.id,class:e.normalizeClass(V.class),variant:V.variant,size:V.size,onClick:V.handler},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(V.label),1)]),_:2},1032,["id","class","variant","size","onClick"]))),128))])])],544),[[e.vShow,i.value]])],2)],2)]))}}),te=e.defineComponent({name:"KrdsTextarea",props:{modelValue:{type:String,default:""},size:{type:String,default:void 0},placeholder:{type:String,default:void 0},maxlength:{type:Number,default:void 0},minlength:{type:Number,default:void 0},rows:{type:Number,default:4},cols:{type:Number,default:void 0},autofocus:{type:Boolean,default:!1},name:{type:String,default:void 0},required:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},showCount:{type:Boolean,default:!0},resize:{type:String,default:"vertical"},class:{type:String,default:void 0},style:{type:[String,Object],default:void 0},id:{type:String,default:void 0}},emits:["update:modelValue","input","change","focus","blur","keydown","keyup"],setup(t,{emit:r}){const s=e.ref(0);e.watch(()=>t.modelValue,l=>{s.value=(l||"").length},{immediate:!0});const a=e.computed(()=>{const l=["krds-input"];return t.size&&l.push(t.size),t.class&&l.push(t.class),l}),n=e.computed(()=>{const l={};return t.resize&&(l.resize=t.resize),l}),o=l=>{const c=l.target.value;s.value=c.length,r("update:modelValue",c),r("input",l)},i=l=>{r("change",l)},u=l=>{r("focus",l)},d=l=>{r("blur",l)},h=l=>{r("keydown",l)},y=l=>{r("keyup",l)},C=e.computed(()=>{const l={class:a.value,style:n.value,value:t.modelValue,placeholder:t.placeholder,name:t.name,id:t.id,required:t.required,readonly:t.readonly,disabled:t.disabled,autofocus:t.autofocus,rows:t.rows,cols:t.cols,onInput:o,onChange:i,onFocus:u,onBlur:d,onKeydown:h,onKeyup:y};return t.maxlength!==void 0&&(l.maxlength=t.maxlength),t.minlength!==void 0&&(l.minlength=t.minlength),l}),g=e.computed(()=>["form-conts"]),w=e.computed(()=>["textarea-wrap"]),m=e.computed(()=>{if(!t.showCount)return null;const l=s.value,p=t.maxlength;return{current:l,max:p||""}});return()=>{const l=[e.h("textarea",C.value)];return m.value&&l.push(e.h("p",{class:"textarea-count"},[e.h("span",{class:"count-now"},m.value.current),e.h("span",{class:"count-total"},m.value.max?`/${m.value.max}`:"")])),e.h("div",{class:g.value},[e.h("div",{class:w.value},l)])}}}),ne=e.defineComponent({name:"KrdsSelect",props:{modelValue:{type:[String,Number,null],default:null},size:{type:String,default:"medium"},title:{type:String,default:void 0},options:{type:Array,default:()=>[]},placeholder:{type:String,default:"선택"},name:{type:String,default:void 0},disabled:{type:Boolean,default:!1},state:{type:String,default:"default"},sort:{type:Boolean,default:!1},class:{type:String,default:void 0},id:{type:String,default:void 0}},emits:["update:modelValue","focus","blur"],setup(t,{emit:r,slots:s}){const a=e.computed(()=>{const y=[];return t.sort?y.push("krds-form-select-sort"):y.push("krds-form-select"),t.size&&y.push(t.size),t.class&&y.push(t.class),y}),n=y=>{const C=y.target,g=C.value===""?null:C.value;r("update:modelValue",g)},o=y=>{r("focus",y)},i=y=>{r("blur",y)},u=e.computed(()=>({class:a.value,value:t.modelValue??"",title:t.title||t.placeholder,name:t.name,id:t.id,disabled:t.disabled||t.readonly,onChange:n,onFocus:o,onBlur:i})),d=e.computed(()=>{const y=["form-conts"];return t.state!=="default"&&y.push(`is-${t.state}`),y}),h=()=>{const y=[];return t.placeholder&&!t.modelValue&&y.push(e.h("option",{value:"",disabled:!0,selected:!0},t.placeholder)),t.options&&t.options.length>0&&t.options.forEach(C=>{y.push(e.h("option",{value:C.value,disabled:C.disabled,selected:C.value===t.modelValue},C.label))}),s.default&&y.push(...s.default()),y};return()=>{const y=e.h("select",u.value,h());return t.sort?y:e.h("div",{class:d.value},[y])}}}),le=e.defineComponent({name:"KrdsFileUpload",props:{modelValue:{type:Array,default:()=>[]},size:{type:String,default:"medium"},accept:{type:String,default:void 0},maxFiles:{type:Number,default:10},maxFileSize:{type:Number,default:20*1024*1024},multiple:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},dragAndDrop:{type:Boolean,default:!0},title:{type:String,default:"타이틀영역"},description:{type:String,default:"컨텐츠 영역"},placeholder:{type:String,default:"첨부할 파일을 여기에 끌어다 놓거나, 파일 선택 버튼을 눌러 파일을 직접 선택해주세요."},showPreview:{type:Boolean,default:!0},showDownload:{type:Boolean,default:!0},showPreviewButton:{type:Boolean,default:!0},showClearAll:{type:Boolean,default:!0},name:{type:String,default:void 0},required:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},class:{type:String,default:void 0},style:{type:[String,Object],default:void 0},id:{type:String,default:void 0}},emits:["update:modelValue","file-added","file-removed","file-error","upload-start","upload-progress","upload-complete","upload-error","clear-all","download","preview"],setup(t,{emit:r}){e.ref(!1),e.computed(()=>{const a=["krds-file-upload","line"];return t.class&&a.push(t.class),a});const s=e.computed(()=>t.modelValue?.length||0);return e.computed(()=>!t.disabled&&s.value<t.maxFiles),()=>null}}),ae=e.defineComponent({name:"KrdsBadge",props:{type:{type:String,default:"outline"},color:{type:String,default:"primary"},size:{type:String,default:"large"},number:{type:Boolean,default:!1},class:{type:String,default:void 0}},emits:["click"],setup(t,{emit:r,slots:s}){const a=e.computed(()=>{const o=["krds-badge"];return o.push(`${t.type}-${t.color}`),t.size&&o.push(t.size),t.number&&o.push("number"),t.class&&o.push(t.class),o}),n=o=>{r("click",o)};return()=>e.h("span",{type:t.type,color:t.color,size:t.size,number:t.number,class:a.value,onClick:n},s.default?.())}}),oe=e.defineComponent({name:"KrdsTag",props:{link:{type:Boolean,default:!1},href:{type:String,default:"#"},target:{type:String,default:void 0},rel:{type:String,default:void 0},class:{type:String,default:void 0}},emits:["remove"],setup(t,{emit:r,slots:s}){const a=e.computed(()=>{const i=["krds-btn-tag"];return t.link&&i.push("link"),t.class&&i.push(t.class),i}),n=i=>{r("remove",i)},o=()=>e.h("button",{type:"button",class:"btn-delete",onClick:n},[e.h("span",{class:"sr-only"},"삭제")]);return()=>{const i=[],u=s.default?.();if(u&&i.push(u),t.link||i.push(o()),t.link){const d={href:t.href,class:a.value};return t.target&&(d.target=t.target),t.rel&&(d.rel=t.rel),e.h("a",d,i)}return e.h("span",{class:a.value},i)}}}),se=e.defineComponent({name:"KrdsTagGroup",props:{size:{type:String,default:"medium"},class:{type:String,default:void 0}},setup(t,{slots:r}){const s=e.computed(()=>{const a=["krds-tag-wrap"];return t.size&&a.push(t.size),t.class&&a.push(t.class),a});return()=>e.h("div",{class:s.value},r.default?.())}}),ie=e.defineComponent({name:"KrdsMasthead",props:{class:{type:String,default:void 0}},emits:["click"],setup(t,{emit:r,slots:s}){const a=e.computed(()=>{const o=[""];return t.class&&o.push(t.class),o}),n=o=>{r("click",o)};return()=>e.h("div",{id:"krds-masthead",class:a.value,onClick:n},[e.h("div",{class:"toggle-wrap"},[e.h("div",{class:"toggle-head"},[e.h("div",{class:"inner"},[e.h("span",{class:"nuri-txt"},s.default?.())])])])])}});let lt=0;function R(t="krds"){return`${t}-${++lt}`}function at(){const t=Date.now().toString(36).slice(-4),r=Math.random().toString(36).substring(2,5);return`${t}${r}`}function F(...t){return t.filter(Boolean).join(" ")}const re=e.defineComponent({name:"KrdsToggleSwitch",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},label:{type:String,default:void 0},size:{type:String,default:"medium",validator:t=>["medium","large"].includes(t)},name:{type:String,default:void 0},required:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},class:{type:String,default:void 0},id:{type:String,default:void 0}},emits:["update:modelValue","change"],setup(t,{emit:r,attrs:s}){const a=e.computed(()=>t.modelValue),n=e.computed(()=>F("krds-form-toggle-switch",t.size,t.class)),o=u=>{if(t.disabled)return;const h=u.target.checked;r("update:modelValue",h),r("change",h)},i=e.computed(()=>t.id||R("toggle-switch"));return()=>e.h("div",{class:n.value},[e.h("input",{type:"checkbox",id:i.value,name:t.name,checked:a.value,disabled:t.disabled,onChange:o,...s}),e.h("label",{for:i.value},[e.h("span",{class:"switch-toggle"},[e.h("i")]),t.label||""])])}}),ce=e.defineComponent({name:"KrdsCheckArea",props:{class:{type:String,default:void 0},column:{type:Boolean,default:!1}},setup(t,{slots:r}){return()=>{const s=["krds-check-area"];return t.column&&s.push("chk-column"),t.class&&s.push(t.class),e.h("div",{class:s},r.default?.())}}}),de=e.defineComponent({name:"KrdsCheckbox",props:{modelValue:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:t=>["medium","large"].includes(t)},chip:{type:Boolean,default:!1},class:{type:String,default:void 0},id:{type:String,default:void 0}},emits:["update:modelValue"],slots:Object,setup(t,{emit:r,attrs:s,slots:a}){const n=e.computed(()=>t.modelValue),o=e.computed(()=>{const d=t.chip?"krds-form-chip":"krds-form-check";return F(d,t.size,t.class)}),i=d=>{if(t.disabled)return;const y=d.target.checked;r("update:modelValue",y)},u=e.computed(()=>t.id||R("checkbox"));return()=>{const d=[e.h("input",{type:"checkbox",id:u.value,checked:n.value,disabled:t.disabled,onChange:i,...s}),e.h("label",{for:u.value},a.default?.())];return a.description&&!t.chip&&d.push(e.h("div",{class:"krds-form-check-cnt"},e.h("p",{class:"krds-form-check-p"},a.description()))),e.h("div",{class:o.value},d)}}}),ue=e.defineComponent({name:"KrdsRadio",props:{modelValue:{type:[String,Number,Boolean],default:void 0},value:{type:[String,Number,Boolean],required:!0},disabled:{type:Boolean,default:!1},size:{type:String,default:"medium",validator:t=>["medium","large"].includes(t)},chip:{type:Boolean,default:!1},name:{type:String,default:void 0},class:{type:String,default:void 0},id:{type:String,default:void 0}},emits:["update:modelValue"],slots:Object,setup(t,{emit:r,attrs:s,slots:a}){const n=e.computed(()=>t.modelValue===t.value),o=e.computed(()=>{const h=t.chip?"krds-form-chip":"krds-form-check";return F(h,t.size,t.class)}),i=h=>{if(t.disabled)return;h.target.checked&&r("update:modelValue",t.value)},u=e.computed(()=>t.id||R("radio")),d=e.computed(()=>t.name);return()=>{const h=[e.h("input",{type:"radio",id:u.value,name:d.value,value:String(t.value),checked:n.value,disabled:t.disabled,onChange:i,...s}),e.h("label",{for:u.value},a.default?.())];return a.description&&!t.chip&&h.push(e.h("div",{class:"krds-form-check-cnt"},e.h("p",{class:"krds-form-check-p"},a.description()))),e.h("div",{class:o.value},h)}}}),fe=e.defineComponent({name:"KrdsStepIndicator",props:{modelValue:{type:Number,default:0},class:{type:String,default:void 0}},emits:["update:modelValue"],setup(t,{slots:r}){const s=e.computed(()=>{const u=["krds-step-wrap"];return t.class&&u.push(t.class),u}),a=u=>{const d=t.modelValue||0;return u<d?"done":u===d?"active":"pending"},n=e.ref(0),o=()=>{n.value=0},i=()=>n.value++;return e.provide("stepIndicator",{activeStep:e.computed(()=>t.modelValue||0),getStepStatus:a,getNextStepIndex:i,resetStepIndex:o}),()=>(o(),e.h("ol",{class:s.value},r.default?.()))}}),me=e.defineComponent({name:"KrdsStep",props:{step:{type:[String,Number],required:!0},title:{type:String,required:!0},status:{type:String,default:void 0},class:{type:String,default:void 0}},emits:["click"],setup(t,{emit:r,slots:s}){const a=e.inject("stepIndicator"),n=a?a.getNextStepIndex():-1,o=e.computed(()=>t.status?t.status:a&&n>=0?a.getStepStatus(n):"pending"),i=e.computed(()=>{const d=[o.value];return t.class&&d.push(t.class),d}),u=d=>{r("click",d,t.step)};return()=>{const d=o.value==="active";return e.h("li",{class:i.value,onClick:u},[e.h("span",[d&&e.h("em",{class:"sr-only"},"현재단계"),e.h("i",{class:"step"},t.step),e.h("span",{class:"step-tit"},t.title),s.default?.()])])}}}),pe=e.defineComponent({name:"KrdsSkipLink",props:{href:{type:String,required:!0,validator:t=>t.startsWith("#")},class:{type:[String,Array,Object],default:void 0},id:{type:String,default:"krds-skip-link"}},setup(t,{slots:r}){return()=>e.h("div",{id:t.id,class:t.class},[e.h("a",{href:t.href},r.default?.())])}}),ot=["id","aria-label"],st={class:"breadcrumb"},it=["href","aria-current","onClick"],rt={key:0},he=e.defineComponent({__name:"KrdsBreadcrumb",props:{items:{},id:{default:void 0},ariaLabel:{default:"현재 경로"},showHomeIcon:{type:Boolean,default:!0}},emits:["item-click"],setup(t,{emit:r}){const s=t,a=r,n=i=>i===s.items.length-1,o=(i,u)=>{i.onClick&&i.onClick(u),a("item-click",i,u)};return(i,u)=>(e.openBlock(),e.createElementBlock("nav",{id:i.id,class:"krds-breadcrumb-wrap","aria-label":i.ariaLabel},[e.createElementVNode("ol",st,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(i.items,(d,h)=>(e.openBlock(),e.createElementBlock("li",{key:`breadcrumb-${h}`,class:e.normalizeClass({home:h===0&&i.showHomeIcon})},[e.createElementVNode("a",{href:d.href||"#",class:"txt","aria-current":n(h)?"page":void 0,onClick:y=>o(d,y)},[h===0&&i.showHomeIcon?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("span",rt,e.toDisplayString(d.text),1))],8,it)],2))),128))])],8,ot))}}),ye=e.defineComponent({name:"KrdsInPageNavigation",props:{title:{type:String,default:void 0},caption:{type:String,default:"이 페이지의 구성"},items:{type:Array,default:()=>[]},autoActive:{type:Boolean,default:!0},headerTopSelector:{type:String,default:"#krds-masthead"},headerInnerSelector:{type:String,default:"#krds-header .header-in"},class:{type:String,default:void 0}},emits:["itemClick"],slots:Object,setup(t,{emit:r,slots:s}){const a=e.ref(""),n=e.ref(new Map),o=e.computed(()=>{const m=["krds-in-page-navigation-type"];return t.class&&m.push(t.class),m}),i=()=>{const m=t.headerTopSelector,l=t.headerInnerSelector,p=document.querySelector(m)?.clientHeight||0,c=document.querySelector(l)?.clientHeight||0;return p+c},u=(m,l)=>{if(r("itemClick",m,l),m.href.startsWith("#")){l.preventDefault();const p=document.querySelector(m.href);if(p){const c=i();if(window.scrollTo({left:0,top:p.getBoundingClientRect().top+window.scrollY-c,behavior:"smooth"}),a.value=m.href,l instanceof KeyboardEvent){const f=p.querySelector(".sec-tit, h1, h2, h3, h4, h5, h6");f&&f instanceof HTMLElement&&(f.setAttribute("tabindex","-1"),f.focus({preventScroll:!0}))}}}},d=()=>{n.value.clear(),t.items&&t.items.filter(m=>m.href.startsWith("#")).forEach(m=>{const l=document.querySelector(m.href);l&&n.value.set(m.href,l)})},h=()=>{if(!t.autoActive||!t.items||n.value.size===0)return;const m=window.innerHeight,l=Math.ceil(m/5),p=window.scrollY+m,c=document.body.scrollHeight,f=t.items.filter(N=>N.href.startsWith("#")&&n.value.has(N.href)).map(N=>({href:N.href,element:n.value.get(N.href),item:N}));if(f.length===0)return;const E=f[0],K=f[f.length-1],v=E.element.offsetTop;let _="";if(p>=c)_=K.href;else if(window.scrollY<=v)_=E.href;else for(const N of f){const L=N.element.offsetHeight,B=N.element.offsetTop-l;if(window.scrollY>B&&window.scrollY<=B+L){_=N.href;break}}_&&_!==a.value&&(a.value=_)},y=()=>{if(!t.items)return;const m=t.items.find(l=>l.active);m?a.value=m.href:t.items.length>0&&(a.value=t.items[0].href)};e.onMounted(()=>{if(y(),t.autoActive){d(),h(),window.addEventListener("scroll",h,{passive:!0});const m=new MutationObserver(()=>{d()});m.observe(document.body,{childList:!0,subtree:!0}),e.onUnmounted(()=>{m.disconnect()})}}),e.onUnmounted(()=>{t.autoActive&&(window.removeEventListener("scroll",h),n.value.clear())});const C=()=>!t.caption&&!t.title?null:e.h("div",{class:"in-page-navigation-header"},[t.caption&&e.h("p",{class:"quick-caption"},t.caption),t.title&&e.h("p",{class:"quick-title"},t.title)]),g=()=>{if(!t.items)return null;const m=t.items.map(l=>{const p=a.value===l.href||!t.autoActive&&l.active;return e.h("li",{key:l.href},[e.h("a",{href:l.href,class:p?"active":"",onClick:c=>u(l,c),onKeydown:c=>{(c.key==="Enter"||c.key===" ")&&(c.preventDefault(),u(l,c))}},l.text)])});return e.h("nav",{class:"in-page-navigation-list"},[e.h("ul",{},m)])},w=()=>s.action?e.h("div",{class:"in-page-navigation-action"},[s.action()]):null;return()=>e.h("div",{class:o.value},[e.h("div",{class:"krds-in-page-navigation-area"},[C(),g(),w()].filter(Boolean))])}}),ct=["id"],dt={class:"page-links"},ut=["href","aria-current","onClick"],ft={key:0},mt=["aria-label"],ge=e.defineComponent({__name:"KrdsPagination",props:{modelValue:{default:1},min:{default:1},max:{},id:{default:void 0},ariaLabel:{default:"페이지 내비게이션"},pageRange:{default:8}},emits:["update:modelValue"],setup(t,{emit:r}){const s=t,a=r,n=e.computed(()=>Math.max(1,s.min)),o=e.computed(()=>s.modelValue??n.value),i=e.computed(()=>o.value<=n.value),u=e.computed(()=>o.value>=s.max),d=e.computed(()=>{if(!i.value)return"#"}),h=e.computed(()=>{if(!u.value)return"#"}),y=e.computed(()=>{const{pageRange:m,max:l}=s,p=1,c=[];if(l<=m+2*p)for(let f=n.value;f<=l;f++)c.push({type:"page",key:`page-${f}`,page:f,href:"#"});else{const f=Math.min(p,l),E=Math.max(l-p+1,1),K=Math.max(n.value,o.value-Math.floor(m/2)),v=Math.min(l,K+m-1),_=Math.max(n.value,v-m+1);for(let B=n.value;B<=f;B++)c.push({type:"page",key:`page-${B}`,page:B,href:"#"});_>f+1&&c.push({type:"ellipsis",key:"ellipsis-left",ariaLabel:"페이지 생략"});const N=Math.max(_,f+1),L=Math.min(v,E-1);for(let B=N;B<=L;B++)c.push({type:"page",key:`page-${B}`,page:B,href:"#"});v<E-1&&c.push({type:"ellipsis",key:"ellipsis-right",ariaLabel:"페이지 생략"});for(let B=E;B<=l;B++)c.push({type:"page",key:`page-${B}`,page:B,href:"#"})}return c}),C=(m,l)=>{if(m===o.value){l.preventDefault();return}a("update:modelValue",m)},g=m=>{if(i.value){m.preventDefault();return}const l=o.value-1;a("update:modelValue",l)},w=m=>{if(u.value){m.preventDefault();return}const l=o.value+1;a("update:modelValue",l)};return(m,l)=>{const p=e.resolveDirective("sr-only");return e.openBlock(),e.createElementBlock("div",{id:m.id,class:"krds-pagination"},[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(i.value?"span":"a"),{href:i.value?void 0:d.value,class:e.normalizeClass(["page-navi","prev",{disabled:i.value}]),onClick:g},{default:e.withCtx(()=>[...l[0]||(l[0]=[e.createTextVNode(" 이전 ",-1)])]),_:1},8,["href","class"])),e.createElementVNode("div",dt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,c=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:c.key},[c.type==="page"?(e.openBlock(),e.createElementBlock("a",{key:0,href:c.href||"#",class:e.normalizeClass(["page-link",{active:c.page===o.value}]),"aria-current":c.page===o.value?"page":void 0,onClick:f=>C(c.page,f)},[c.page===o.value?e.withDirectives((e.openBlock(),e.createElementBlock("span",ft,[...l[1]||(l[1]=[e.createTextVNode("현재페이지",-1)])])),[[p]]):e.createCommentVNode("",!0),e.createTextVNode(" "+e.toDisplayString(c.page),1)],10,ut)):c.type==="ellipsis"?(e.openBlock(),e.createElementBlock("span",{key:1,class:"page-link link-dot","aria-label":c.ariaLabel},null,8,mt)):e.createCommentVNode("",!0)],64))),128))]),(e.openBlock(),e.createBlock(e.resolveDynamicComponent(u.value?"span":"a"),{href:u.value?void 0:h.value,class:e.normalizeClass(["page-navi","next",{disabled:u.value}]),onClick:w},{default:e.withCtx(()=>[...l[2]||(l[2]=[e.createTextVNode(" 다음 ",-1)])]),_:1},8,["href","class"]))],8,ct)}}}),pt={class:"inner help-panel-flexible"},ht={class:"help-panel-wrap"},yt={class:"help-conts-area"},ke=e.defineComponent({__name:"KrdsPanel",props:{modelValue:{type:Boolean,default:!1}},emits:["update:modelValue"],setup(t,{emit:r}){const s=t,a=r,n=e.computed({get:()=>s.modelValue,set:u=>a("update:modelValue",u)}),o=()=>{n.value=!0},i=()=>{n.value=!1};return(u,d)=>(e.openBlock(),e.createElementBlock("div",pt,[e.createElementVNode("button",{type:"button",class:"krds-btn small tertiary btn-help-panel expand btn-help-exec",onClick:o},[...d[0]||(d[0]=[e.createElementVNode("i",{class:"svg-icon ico-fold"},null,-1),e.createTextVNode(" 도움말 ",-1)])]),e.createElementVNode("div",{class:e.normalizeClass(["krds-help-panel",{expand:n.value}])},[e.createElementVNode("div",ht,[e.createElementVNode("div",yt,[e.renderSlot(u.$slots,"default"),e.createElementVNode("button",{type:"button",class:"krds-btn small tertiary btn-help-panel fold",onClick:i},[...d[1]||(d[1]=[e.createElementVNode("span",{class:"sr-only"},"도움말",-1),e.createTextVNode(" 접어두기 ",-1),e.createElementVNode("i",{class:"svg-icon ico-angle right"},null,-1)])])])])],2)]))}}),gt={class:"tooltip-action"},kt={key:0,class:"svg-icon ico-help"},bt={key:1,class:"svg-icon ico-tooltip"},St={class:"tooltip-title"},Ct={class:"tooltip-contents"},be=e.defineComponent({__name:"KrdsContextualHelp",props:{tooltipTitle:{default:"도움말 제목"},helpIcon:{type:Boolean},position:{default:"top left"}},setup(t){const r=t,s=e.ref(),a=e.ref(),n=e.ref(),o=e.ref(),i=e.ref(!1),u=()=>{const l=i.value;y(),l||d()},d=()=>{if(!n.value||!a.value)return;i.value=!0,n.value.style.display="block",a.value.setAttribute("aria-expanded","true"),n.value.querySelector('a, button, [tabindex="0"], input, textarea, select')?.focus(),C()},h=()=>{!n.value||!a.value||(i.value=!1,n.value.style.display="none",a.value.setAttribute("aria-expanded","false"))},y=()=>{const l=document.querySelectorAll(".krds-contextual-help .tooltip-popover"),p=document.querySelectorAll(".krds-contextual-help .tooltip-btn");l.forEach(c=>{c.style.display="none"}),p.forEach(c=>{c.setAttribute("aria-expanded","false")}),i.value=!1},C=()=>{if(!s.value||!n.value)return;const l=window.innerWidth<=768,p=s.value.querySelector(".tooltip-action");if(l){const f=getComputedStyle(document.querySelector(":root")).getPropertyValue("--krds-contents-padding-x").trim().split("px")[0],K=p.getBoundingClientRect().left-parseInt(f),v=document.body.clientWidth-parseInt(f)*2;n.value.style.left=`-${K}px`,n.value.style.width=`${v}px`}else n.value.style.left="",n.value.style.right="",n.value.style.width="360px"},g=l=>{(l.key==="Escape"||l.key==="Esc")&&y()},w=l=>{l.target.closest(".tooltip-action")||y()},m=()=>{i.value&&C()};return e.onMounted(()=>{s.value&&(a.value&&a.value.setAttribute("aria-expanded","false"),n.value&&n.value.setAttribute("role","tooltip"),document.addEventListener("keydown",g),document.addEventListener("click",w),window.addEventListener("resize",m))}),e.onUnmounted(()=>{document.removeEventListener("keydown",g),document.removeEventListener("click",w),window.removeEventListener("resize",m)}),(l,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:s,class:e.normalizeClass(["krds-contextual-help",r.position])},[e.createElementVNode("div",gt,[e.createElementVNode("button",{ref_key:"tooltipBtnRef",ref:a,type:"button",class:"krds-btn medium icon tooltip-btn",onClick:u},[p[0]||(p[0]=e.createElementVNode("span",{class:"sr-only"},"도움말",-1)),r.helpIcon?(e.openBlock(),e.createElementBlock("i",kt)):(e.openBlock(),e.createElementBlock("i",bt))],512),e.createElementVNode("div",{ref_key:"tooltipPopoverRef",ref:n,class:"tooltip-popover",role:"tooltip"},[e.createElementVNode("h4",St,e.toDisplayString(r.tooltipTitle),1),e.createElementVNode("div",Ct,[e.renderSlot(l.$slots,"default")]),e.createElementVNode("button",{ref_key:"closeBtnRef",ref:o,type:"button",class:"krds-btn xsmall icon tooltip-close",onClick:h},[...p[1]||(p[1]=[e.createElementVNode("span",{class:"sr-only"},"닫기",-1),e.createElementVNode("i",{class:"svg-icon ico-modal-close"},null,-1)])],512)],512)])],2))}}),Et={key:0,class:"coach-balloon"},Vt={class:"coach-tit"},wt={class:"desc"},Bt={class:"coach-controls"},Nt={class:"num"},vt={class:"btn-wrap"},Se=e.defineComponent({__name:"KrdsCoachMark",props:{coachMarkClass:{default:""},stepsData:{},activeStep:{},modelValue:{default:null},class:{},style:{},id:{}},emits:["update:modelValue","close"],setup(t,{emit:r}){const s=t,a=e.computed(()=>{const d=s.activeStep-1;return s.stepsData&&d>=0&&d<s.stepsData.length?s.stepsData[d]:null}),n=r,o=()=>{s.activeStep>1&&n("update:modelValue",s.activeStep-1)},i=()=>{s.activeStep<s.stepsData.length&&n("update:modelValue",s.activeStep+1)},u=()=>{n("close")};return(d,h)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(["krds-coach-mark",d.coachMarkClass]),style:e.normalizeStyle(d.style)},[d.modelValue===d.activeStep&&a.value?(e.openBlock(),e.createElementBlock("div",Et,[h[2]||(h[2]=e.createElementVNode("h5",{class:"sr-only"},"따라하기 가이드",-1)),e.createElementVNode("h6",Vt,e.toDisplayString(d.activeStep)+"단계 : "+e.toDisplayString(a.value.title),1),e.createElementVNode("p",wt,e.toDisplayString(a.value.description),1),e.createElementVNode("div",Bt,[e.createElementVNode("div",Nt,[h[0]||(h[0]=e.createElementVNode("span",{class:"sr-only"},"현재 단계",-1)),e.createElementVNode("strong",null,e.toDisplayString(d.activeStep),1),h[1]||(h[1]=e.createElementVNode("span",{class:"sr-only"},"총 단계",-1)),e.createElementVNode("span",null,e.toDisplayString(d.stepsData.length),1)]),e.createElementVNode("div",vt,[e.createElementVNode("button",{type:"button",class:"krds-btn small text",onClick:u},"그만보기"),d.activeStep!==1?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"krds-btn small text",onClick:o},"이전으로")):e.createCommentVNode("",!0),d.activeStep!==d.stepsData.length?(e.openBlock(),e.createElementBlock("button",{key:1,type:"button",class:"krds-btn small tertiary",onClick:i},"다음으로")):e.createCommentVNode("",!0)])])])):e.createCommentVNode("",!0),e.renderSlot(d.$slots,"coach-mark-content")],6))}}),_t=["disabled","aria-labelledby"],Kt=["id","aria-hidden"],Dt={class:"sr-only"},Ce=e.defineComponent({__name:"KrdsTooltip",props:{type:{default:"default"},tooltipContent:{},vertical:{type:Boolean},box:{type:Boolean},disabled:{type:Boolean,default:!1},class:{},style:{},id:{}},setup(t){const r=t,s=e.ref(null),a=e.ref(null),n=e.ref(!1),o=e.ref({}),i=e.ref(`tooltip-popover-${Math.random().toString(36).substring(2,9)}`),u=e.ref(!1),d=e.computed(()=>{const f=["krds-btn","krds-tooltip"];return r.type==="default"?f.push("small","text"):r.type==="icon"?f.push("icon"):r.type==="button"&&f.push(""),!r.box&&r.vertical&&f.push("tooltip-vertical"),r.box&&!r.vertical&&f.push("tooltip-box"),f.join(" ")}),h=e.computed(()=>{const f=[];return r.box&&f.push("tooltip-box"),r.vertical&&f.push("tooltip-vertical"),n.value&&f.push("active"),f}),y=e.computed(()=>s.value?.querySelector("button")?.textContent?.trim()||""),C=()=>window.innerWidth<=768,g=()=>{if(!s.value||!a.value)return;const f=s.value.querySelector("button");if(!f)return;const E=12,{clientHeight:K,clientWidth:v}=a.value,{top:_,left:N,right:L,height:B,width:x}=f.getBoundingClientRect(),P=window.innerWidth/2,j=window.innerHeight/2;let M,z;const $=[];u.value||r.box||r.vertical?(_+B>j?(M=_-K-E,$.push("top")):(M=_+B+E,$.push("bottom")),N+x>P?(z=L-v,$.push("right"),window.innerWidth-(N+x)>v/2&&(z=N+(x-v)/2,$.splice($.indexOf("right"),1))):(z=N+(x-v)/2,z<0&&(z=N,$.push("left")))):(M=_+(B-K)/2,N+x>P?(z=N-v-E,$.push("right")):z=L+E);const A=window.innerWidth<=420;o.value={top:`${M}px`,left:A?"50%":`${z}px`,transform:A?"translateX(-50%)":"none"},a.value&&(a.value.className=`krds-tooltip-popover ${$.join(" ")} ${h.value.join(" ")}`)},w=async()=>{r.disabled||!r.tooltipContent||(n.value=!0,await e.nextTick(),g())},m=()=>{n.value=!1,o.value={}},l=f=>{(f.key==="Escape"||f.key==="Esc")&&n.value&&m()},p=()=>{u.value=C(),n.value&&m()},c=()=>{n.value&&m()};return e.onMounted(()=>{u.value=C(),document.addEventListener("keydown",l),window.addEventListener("scroll",c),window.addEventListener("resize",p)}),e.onUnmounted(()=>{document.removeEventListener("keydown",l),window.removeEventListener("scroll",c),window.removeEventListener("resize",p)}),(f,E)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:s},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(d.value),disabled:f.disabled,"aria-labelledby":i.value,onMouseover:w,onMouseout:m,onFocusin:w,onFocusout:m},[e.renderSlot(f.$slots,"default")],42,_t),e.withDirectives(e.createElementVNode("div",{id:i.value,ref_key:"popoverRef",ref:a,class:e.normalizeClass(["krds-tooltip-popover",h.value]),style:e.normalizeStyle(o.value),"aria-hidden":!n.value,role:"tooltip"},[e.createElementVNode("span",Dt,e.toDisplayString(y.value),1),e.createTextVNode(" "+e.toDisplayString(f.tooltipContent),1)],14,Kt),[[e.vShow,n.value]])],512))}}),zt=["aria-expanded"],$t={class:"drop-in"},Lt={key:0,class:"drop-top"},xt={key:1,class:"drop-list"},It=["lang","aria-selected","onClick"],Tt={class:"sr-only"},Mt={key:2,class:"drop-list"},Rt=["href","lang"],Ee=e.defineComponent({__name:"KrdsLanguageSwitcher",props:{languageList:{},modelValue:{default:""},type:{default:"default"},dropPosition:{default:"center"},class:{},style:{},id:{}},emits:["update:modelValue","close"],setup(t,{emit:r}){const s=t,a=r,n=e.ref(!1),o=e.ref(),i=e.ref(),u=()=>{n.value=!n.value,n.value&&o.value&&y()},d=()=>{n.value=!1},h=l=>{a("update:modelValue",l),d(),a("close"),i.value?.focus()},y=()=>{if(!o.value)return;const l=o.value.querySelector(".drop-menu");if(!l)return;const p=l.getBoundingClientRect(),c=window.innerWidth;o.value.classList.remove("drop-left","drop-right"),p.left<0?o.value.classList.add("drop-left"):c<p.left+p.width&&o.value.classList.add("drop-right")},C=l=>{l.key==="Escape"&&(d(),i.value?.focus())},g=l=>{o.value?.contains(l.target)||d()},w=l=>{o.value?.contains(l.relatedTarget)||d()},m=l=>{if(!o.value)return;o.value.querySelectorAll(".drop-list .item-link").forEach(f=>{f.style.position="relative",f.style.zIndex="0"});const c=l.target;c.style.zIndex="1"};return e.watch(n,l=>{l?(document.addEventListener("keydown",C),document.addEventListener("click",g)):(document.removeEventListener("keydown",C),document.removeEventListener("click",g))}),e.onUnmounted(()=>{document.removeEventListener("keydown",C),document.removeEventListener("click",g)}),(l,p)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dropdownRef",ref:o,class:e.normalizeClass(["krds-drop-wrap krds-language",{active:n.value,"drop-left":s.dropPosition==="left","drop-right":s.dropPosition==="right"}]),onFocusout:w},[e.createElementVNode("button",{ref_key:"buttonRef",ref:i,type:"button",class:e.normalizeClass(["krds-btn small text drop-btn",{active:n.value}]),"aria-expanded":n.value,onClick:u},[p[0]||(p[0]=e.createElementVNode("i",{class:"svg-icon ico-global"},null,-1)),e.renderSlot(l.$slots,"default"),p[1]||(p[1]=e.createElementVNode("i",{class:"svg-icon ico-toggle"},null,-1))],10,zt),e.createElementVNode("div",{class:"drop-menu",style:e.normalizeStyle({display:n.value?"block":"none"})},[e.createElementVNode("div",$t,[l.$slots["prev-item"]?(e.openBlock(),e.createElementBlock("div",Lt,[e.renderSlot(l.$slots,"prev-item")])):e.createCommentVNode("",!0),s.type==="default"?(e.openBlock(),e.createElementBlock("ul",xt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.languageList,c=>(e.openBlock(),e.createElementBlock("li",{key:c.code},[e.createElementVNode("a",{href:"#",class:e.normalizeClass(["item-link",{active:s.modelValue===c.code}]),lang:c.code,"aria-selected":s.modelValue===c.code,onClick:e.withModifiers(f=>h(c.code),["prevent"]),onFocus:m},[e.createTextVNode(e.toDisplayString(c.name)+" ",1),e.createElementVNode("span",Tt,e.toDisplayString(s.modelValue===c.code?"선택됨":""),1)],42,It)]))),128))])):s.type==="external"?(e.openBlock(),e.createElementBlock("ul",Mt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.languageList,c=>(e.openBlock(),e.createElementBlock("li",{key:c.code},[e.createElementVNode("a",{href:c.url||"#",class:"item-link",lang:c.code,target:"_blank",title:"새 창 열림",onFocus:m},[e.createTextVNode(e.toDisplayString(c.name)+" ",1),p[2]||(p[2]=e.createElementVNode("i",{class:"svg-icon ico-go"},null,-1))],40,Rt)]))),128))])):e.createCommentVNode("",!0)])],4)],34))}}),Ft={class:"drop-in"},Pt={class:"drop-list"},At=["data-adjust-scale","onClick"],Ot={class:"drop-bottom"},Ve=e.defineComponent({__name:"KrdsResize",emits:["update:modelValue","close"],setup(t,{emit:r}){const s=r,a=e.ref(!1),n=e.ref(),o=e.ref(),i=e.ref("md"),u=[{key:"sm",label:"작게",zoom:"0.9"},{key:"md",label:"보통",zoom:"1"},{key:"lg",label:"조금 크게",zoom:"1.1"},{key:"xlg",label:"크게",zoom:"1.3"},{key:"xxlg",label:"가장 크게",zoom:"1.5"}],d=()=>{a.value=!a.value,a.value&&n.value&&g()},h=()=>{a.value=!1},y=c=>{h(),s("close"),o.value?.focus(),i.value=c.key,document.body.style.zoom=c?.zoom},C=()=>{const c=u.find(f=>f.key==="md");c&&y(c)},g=()=>{if(!n.value)return;const c=n.value.querySelector(".drop-menu");if(!c)return;const f=c.getBoundingClientRect(),E=window.innerWidth;n.value.classList.remove("drop-left","drop-right"),f.left<0?n.value.classList.add("drop-left"):E<f.left+f.width&&n.value.classList.add("drop-right")},w=c=>{c.key==="Escape"&&(h(),o.value?.focus())},m=c=>{n.value?.contains(c.target)||h()},l=c=>{n.value?.contains(c.relatedTarget)||h()},p=c=>{if(!n.value)return;n.value.querySelectorAll(".drop-list .item-link").forEach(K=>{K.style.position="relative",K.style.zIndex="0"});const E=c.target;E.style.zIndex="1"};return e.watch(a,c=>{c?(document.addEventListener("keydown",w),document.addEventListener("click",m)):(document.removeEventListener("keydown",w),document.removeEventListener("click",m))}),e.onUnmounted(()=>{document.removeEventListener("keydown",w),document.removeEventListener("click",m)}),(c,f)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"dropdownRef",ref:n,class:"krds-drop-wrap krds-resize","data-adjust":"scale",onFocusout:l},[e.createElementVNode("button",{ref_key:"buttonRef",ref:o,type:"button",class:"krds-btn small text drop-btn",onClick:d},[...f[0]||(f[0]=[e.createTextVNode(" 화면크기 ",-1),e.createElementVNode("i",{class:"svg-icon ico-toggle"},null,-1)])],512),e.createElementVNode("div",{class:"drop-menu",style:e.normalizeStyle({display:a.value?"block":"none"})},[e.createElementVNode("div",Ft,[e.createElementVNode("ul",Pt,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(u,E=>e.createElementVNode("li",{key:E.key},[e.createElementVNode("button",{type:"button",class:e.normalizeClass(["item-link",[E.key,E.key===i.value?"active":""]]),"data-adjust-scale":E.key,onClick:e.withModifiers(K=>y(E),["prevent"]),onFocus:p},e.toDisplayString(E.label),43,At)])),64))]),e.createElementVNode("div",Ot,[e.createElementVNode("button",{type:"button",class:"krds-btn medium text","data-adjust-scale":"md",onClick:e.withModifiers(C,["prevent"]),onFocus:p},[...f[1]||(f[1]=[e.createElementVNode("i",{class:"svg-icon ico-reset"},null,-1),e.createTextVNode(" 초기화 ",-1)])],32)])])],4)],544))}}),we=Object.freeze(Object.defineProperty({__proto__:null,KrdsBadge:ae,KrdsBreadcrumb:he,KrdsButton:O,KrdsButtonGroup:Y,KrdsCheckArea:ce,KrdsCheckbox:de,KrdsCoachMark:Se,KrdsContextualHelp:be,KrdsDateInput:ee,KrdsFileUpload:le,KrdsFormGroup:Z,KrdsFormHint:Q,KrdsFormLabel:J,KrdsIcon:G,KrdsInPageNavigation:ye,KrdsInput:X,KrdsLanguageSwitcher:Ee,KrdsLink:U,KrdsMasthead:ie,KrdsPagination:ge,KrdsPanel:ke,KrdsRadio:ue,KrdsResize:Ve,KrdsSelect:ne,KrdsSkipLink:pe,KrdsSpinner:q,KrdsStep:me,KrdsStepIndicator:fe,KrdsTag:oe,KrdsTagGroup:se,KrdsTextarea:te,KrdsToggleSwitch:re,KrdsTooltip:Ce},Symbol.toStringTag,{value:"Module"})),H={mounted(t,r){r.value!==!1&&t.classList.add("sr-only")},updated(t,r){r.value===!1?t.classList.remove("sr-only"):t.classList.add("sr-only")},unmounted(t){t.classList.remove("sr-only")}},Be={"sr-only":H},Ne=t=>{t.directive("sr-only",H)},ve=Object.freeze(Object.defineProperty({__proto__:null,default:Be,directives:Be,installDirectives:Ne,vSrOnly:H},Symbol.toStringTag,{value:"Module"})),qt={install(t,r={}){t.provide("krds:config",r);const s=r.components||Object.keys(we);s.forEach(a=>{const n=we[a];n&&t.component(a,n)}),typeof ve=="object"&&ve!==null&&Ne(t),t.config.globalProperties.$krds={version:"__VERSION__"},process.env.NODE_ENV!=="production"&&console.log(`[KRDS Vue] v__VERSION__ 설치 완료 - 컴포넌트: ${s.length}개`)}},Ht="__VERSION__";b.KrdsBadge=ae,b.KrdsBreadcrumb=he,b.KrdsButton=O,b.KrdsButtonGroup=Y,b.KrdsCheckArea=ce,b.KrdsCheckbox=de,b.KrdsCoachMark=Se,b.KrdsContextualHelp=be,b.KrdsDateInput=ee,b.KrdsFileUpload=le,b.KrdsFormGroup=Z,b.KrdsFormHint=Q,b.KrdsFormLabel=J,b.KrdsIcon=G,b.KrdsInPageNavigation=ye,b.KrdsInput=X,b.KrdsLanguageSwitcher=Ee,b.KrdsLink=U,b.KrdsMasthead=ie,b.KrdsPagination=ge,b.KrdsPanel=ke,b.KrdsRadio=ue,b.KrdsResize=Ve,b.KrdsSelect=ne,b.KrdsSkipLink=pe,b.KrdsSpinner=q,b.KrdsStep=me,b.KrdsStepIndicator=fe,b.KrdsTag=oe,b.KrdsTagGroup=se,b.KrdsTextarea=te,b.KrdsToggleSwitch=re,b.KrdsTooltip=Ce,b.classNames=F,b.default=qt,b.generateId=R,b.generateUid=at,b.version=Ht,Object.defineProperties(b,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
2
2
|
//# sourceMappingURL=krds-vue.umd.js.map
|