import{f as y,a as w,d as x,g as k}from"./app.e53a9ca2.js";import{_ as P}from"./caret-left.2ae2b1b1.js";import{e as i,f as h,i as n,j as r,s as g,F as T,z as u,_ as C}from"./windi.65131e61.js";const b={key:0,class:"connection-list-page-controls flex items-end justify-center"},v={key:0,class:"h-5 p-1 flex flex-nowrap items-stretch mt-2"};function B(a,t,e,d,o,s){const l=y,m=P,c=w,p=x,f=k;return e.itemCount?(i(),h("div",b,[n(f,null,{default:r(()=>[e.more||s.totalPages>1?(i(),h("div",v,[n(c,{class:"w-6 px-1",disabled:o.goingTo==1||e.page==1,secondary:"",onClick:t[0]||(t[0]=_=>s.goTo(1)),"aria-label":"Go To First Page"},{default:r(()=>[o.goingTo==1?(i(),g(l,{key:0,class:"text-grey-darkish",height:"0.8rem",width:"0.8rem"})):(i(),h(T,{key:1},[n(m,{class:"-mr-qr",height:"0.8rem",width:"0.8rem"}),n(m,{class:"-ml-qr",height:"0.8rem",width:"0.8rem"})],64))]),_:1},8,["disabled"]),n(c,{class:"w-6 mx-1 px-1",disabled:o.goingTo==e.page-1||e.page==1,secondary:"",onClick:t[1]||(t[1]=_=>s.changeBy(-1)),"aria-label":"Go To Previous Page"},{default:r(()=>[o.goingTo==e.page-1?(i(),g(l,{key:0,class:"text-grey-darkish",height:"0.8rem",width:"0.8rem"})):u("",!0),n(m,{height:"0.8rem",width:"0.8rem"})]),_:1},8,["disabled"]),n(c,{class:"w-6 px-1",disabled:o.goingTo>e.page||!e.more&&e.page>=s.totalPages,secondary:"",onClick:t[2]||(t[2]=_=>s.changeBy(1)),"aria-label":"Go To Next Page"},{default:r(()=>[o.goingTo>e.page?(i(),g(l,{key:0,class:"text-grey-darkish",height:"0.8rem",width:"0.8rem"})):(i(),g(p,{key:1,height:"0.8rem",width:"0.8rem"}))]),_:1},8,["disabled"])])):u("",!0)]),_:1})])):u("",!0)}const N={name:"ConnectionListPageControls",props:{page:Number,itemCount:Number,pageSize:Number,loading:{},more:{},paginating:Boolean},emits:["update:page","update:paginating"],data(){return{goingTo:-1,requestingMore:!1}},computed:{totalPages(){return Math.max(Math.ceil(this.itemCount/this.pageSize),0)}},watch:{page:{immediate:!0,handler(a){this.traversePages(1,a)}}},methods:{async traversePages(a,t){let e=a;for(;esetTimeout(d,25));continue}try{this.requestingMore=!0,await this.more()}finally{this.requestingMore=!1}e+=1}return this.$emit("update:paginating",!1),e},async goTo(a){this.goingTo=a;try{let t=a;a>this.page&&(t=await this.traversePages(this.page,a)),this.$emit("update:page",t)}catch(t){$tel.captureException(t)}finally{this.goingTo=-1}},async changeBy(a){await this.goTo(this.page+a)}}},F=C(N,[["render",B],["__file","page-controls.vue"]]);export{F as P};

AltStyle によって変換されたページ (->オリジナル) /