Skip to main content
cngx-src documentation

resolveBreadcrumbTier

Functioncommon/interactive/breadcrumbv0.1.0

projects/common/interactive/breadcrumb/breadcrumb-responsive.ts

Description#

Pure width->count resolver: returns the maxVisible of the tier with the highest minWidth that is still <= width. Order-independent - the tier list is normalised (sorted by descending minWidth) before matching, so a consumer may pass tiers in any order. When width sits below every tier's minWidth the narrowest tier's maxVisible is the floor; an empty tier list yields Number.POSITIVE_INFINITY (never collapse), leaving the trail intact.

No DOM, no Angular - the width source (a CngxResizeObserver) lives in the bar; this stays jsdom-testable and shared by the bar and the headless recipe.

Signature#

resolveBreadcrumbTier(width: number, tiers)

Parameters#

@paramwidthnumber
@paramtiers

Returns#

number