PageSourceSearch

https://cdn.sketchflow.ai/assets/usePaginationSearch-DXZCTonb.js

js sketchflow.ai collected 2026-10-05 12:38:14 UTC 1,249 bytes, 1 lines download raw bytes

1import{$ as M,dX as q}from"./main.DLEPxgeo-1789907465259.js";import{a0 as N,r as P,v as S,bk as U}from"./dep-HoX_T0Pi.js";const $=(s,g,c)=>Math.max(1,Math.min(s,Math.ceil(c/g)));function X(s,g,c=20,l={autoSearch:!0}){let h;const a=N({pageNumber:1,pageSize:c}),o=N({rows:[],total:0}),i=P(!1),m=P(null);function d(t,r){return(u=!0)=>{var p;if(i.value=!0,u?a.pageNumber=1:a.pageNumber=$(a.pageNumber,a.pageSize,o.total),t){const x=h=q();return(p=t())==null?void 0:p.then(e=>{var b,v;x===h&&(o.rows=((b=e==null?void 0:e.data)==null?void 0:b.rows)||[],o.total=((v=e==null?void 0:e.data)==null?void 0:v.total)||0,m.value=e==null?void 0:e.data)}).catch(e=>M(e.message||"search error")).finally(()=>{Promise.resolve().then(()=>i.value=!1)})}else i.value=!1;return Promise.resolve()}}const n=d(s);l&&l.autoSearch&&Promise.resolve().then(()=>n());const z=U(()=>n(),500,{maxWait:3e3}),f=(t,r,u)=>{a[t]!==r&&(a[t]=r,u&&u())},C=S(()=>a.pageNumber,()=>n(!1));function w(t){return r=>{C(),f("pageNumber",r,t)}}const D=S(()=>a.pageSize,()=>n());function W(t){return r=>{D(),f("pageSize",r,t)}}return{loading:i,request:a,paginationData:o,originPaginationData:m,search:n,searchWithDebounce:z,pageNumberChange:w(()=>n(!1)),pageSizeChange:W(()=>n(!1))}}export{X as u};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.