UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) • 537 B
import{fitLogoRow as m}from"@expofp/ui";export function nextLogoPage(t,e,i,p,x){const n=t.length,f={items:[],next:n?e%n:0,fitsAll:!1,wrapped:!1};if(!n)return f;const s=[],c=[];for(let o=0;o<n;o++){const h=(e+o)%n,d=i(t[h]);d!==void 0&&(s.push(h),c.push(d))}if(!s.length)return f;const l=Math.max(1,m(c,p,x)),r=s.slice(0,l),u=(r[r.length-1]+1)%n;return{items:r.map(o=>t[o]),next:u,fitsAll:l===s.length,wrapped:u<=e%n}}export function needsMoreLogos(t,e,i){return e>=i?!1:t.items.length===0||t.fitsAll||t.wrapped||e-t.next<t.items.length}