import{d as g,a as f,f as y,e as z,n as S,a8 as p,aZ as v}from"./index-3ac32eb9.js";import{_ as b}from"./_plugin-vue_export-helper-c27b6911.js";const C=(e,o,t,a)=>(e/=a/2,e<1?t/2*e*e+o:(e--,-t/2*(e*(e-2)-1)+o)),_=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}(),w=e=>{document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e},T=()=>document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop,d=(e,o,t)=>{const a=T(),i=e-a,u=20;let l=0;o=typeof o>"u"?500:o;const r=function(){l+=u;const n=C(l,a,i,o);w(n),l<o?_(r):t&&typeof t=="function"&&t()};r()},h=g({__name:"index",props:{total:{required:!0,type:Number,default:0},page:{type:Number,default:1},limit:{type:Number,default:20},pageSizes:{type:Array,default(){return[10,20,30,50]}},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1},isSmall:{type:Boolean,default:!1},pagerCount:{type:Number,default:7}},emits:["update:page","update:limit","pagination"],setup(e,{emit:o}){const t=e,a=o,i=p({get:()=>t.page,set:n=>{a("update:page",n)}}),u=p({get(){return t.limit},set(n){a("update:limit",n)}});function l(n){a("pagination",{page:i,limit:n}),t.autoScroll&&d(0,800)}function r(n){i.value=n,a("pagination",{page:n,limit:t.limit}),t.autoScroll&&d(0,800)}return(n,s)=>{const m=v;return f(),y("div",{class:S("pagination "+{hidden:e.hidden})},[z(m,{background:e.background,"current-page":i.value,"onUpdate:currentPage":s[0]||(s[0]=c=>i.value=c),"page-size":u.value,"onUpdate:pageSize":s[1]||(s[1]=c=>u.value=c),layout:e.layout,"page-sizes":e.pageSizes,total:e.total,onSizeChange:l,onCurrentChange:r,small:e.isSmall,"pager-count":e.pagerCount},null,8,["background","current-page","page-size","layout","page-sizes","total","small","pager-count"])],2)}}});const B=b(h,[["__scopeId","data-v-43e683ce"]]);export{B as _};
