"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("vue"),B=require("../_util/BaseInput.js"),p=require("../_util/vue-types/index.js"),T=require("./KeyCode.js"),z=o.defineComponent({compatConfig:{MODE:3},props:{disabled:{type:Boolean,default:void 0},changeSize:Function,quickGo:Function,selectComponentClass:p.default.any,current:Number,pageSizeOptions:p.default.array.def(["10","20","50","100"]),pageSize:Number,buildOptionText:Function,locale:p.default.object,rootPrefixCls:String,selectPrefixCls:String,goButton:p.default.any},setup(a){const n=o.ref(""),g=o.computed(()=>!n.value||isNaN(n.value)?void 0:Number(n.value)),S=e=>`${e.value} ${a.locale.items_per_page}`,m=e=>{const{value:t}=e.target;n.value!==t&&(n.value=t)},y=e=>{const{goButton:t,quickGo:u,rootPrefixCls:l}=a;t||n.value===""||(e.relatedTarget&&(e.relatedTarget.className.includes(`${l}-item-link`)||e.relatedTarget.className.includes(`${l}-item`))||u(g.value),n.value="")},r=e=>{n.value!==""&&(e.keyCode===T.default.ENTER||e.type==="click")&&(a.quickGo(g.value),n.value="")},v=o.computed(()=>{const{pageSize:e,pageSizeOptions:t}=a;return t.some(u=>u.toString()===e.toString())?t:t.concat([e.toString()]).sort((u,l)=>{const c=isNaN(Number(u))?0:Number(u),s=isNaN(Number(l))?0:Number(l);return c-s})});return()=>{const{rootPrefixCls:e,locale:t,changeSize:u,quickGo:l,goButton:c,selectComponentClass:s,selectPrefixCls:x,pageSize:h,disabled:f}=a,d=`${e}-options`;let b=null,N=null,C=null;if(!u&&!l)return null;if(u&&s){const k=a.buildOptionText||S,O=v.value.map((i,q)=>o.createVNode(s.Option,{key:q,value:i},{default:()=>[k({value:i})]}));b=o.createVNode(s,{disabled:f,prefixCls:x,showSearch:!1,class:`${d}-size-changer`,optionLabelProp:"children",value:(h||v.value[0]).toString(),onChange:i=>u(Number(i)),getPopupContainer:i=>i.parentNode},{default:()=>[O]})}return l&&(c&&(C=typeof c=="boolean"?o.createVNode("button",{type:"button",onClick:r,onKeyup:r,disabled:f,class:`${d}-quick-jumper-button`},[t.jump_to_confirm]):o.createVNode("span",{onClick:r,onKeyup:r},[c])),N=o.createVNode("div",{class:`${d}-quick-jumper`},[t.jump_to,o.createVNode(B.default,{disabled:f,type:"text",value:n.value,onInput:m,onChange:m,onKeyup:r,onBlur:y},null),t.page,C])),o.createVNode("li",{class:`${d}`},[b,N])}}});exports.default=z;
