import * as i0 from '@angular/core'; import { InputSignal, InputSignalWithTransform, OutputEmitterRef, Signal } from '@angular/core'; import { VariantProps } from 'class-variance-authority'; /** * Event emitted when the paginator changes page index or page size. */ interface PageEvent { /** The current zero-based page index. */ pageIndex: number; /** The previous zero-based page index. */ previousPageIndex: number; /** The current page size. */ pageSize: number; /** The previous page size before the event. */ previousPageSize: number; /** The total number of items being paged. */ length: number; } /** * Function signature for custom range label formatting. * Used for i18n and custom label display. * * @param page Current page index (zero-based) * @param pageSize Number of items per page * @param length Total number of items * @returns Formatted string to display (e.g., "1 – 10 of 100") */ type RangeLabelFn = (page: number, pageSize: number, length: number) => string; /** * Default range label function. * Produces output like "1 – 10 of 100" or "0 of 0" when empty. */ declare function defaultRangeLabel(page: number, pageSize: number, length: number): string; type PaginatorSize = 'sm' | 'md'; type PaginatorLayout = 'compact' | 'spread'; /** * CVA variants for the paginator container. * Controls overall layout and spacing. */ declare const paginatorContainerVariants: (props?: { size?: PaginatorSize; layout?: PaginatorLayout; }) => string; /** * CVA variants for paginator navigation buttons. * Controls button sizing, borders, and interactive states. */ declare const paginatorButtonVariants: (props?: { size?: PaginatorSize; }) => string; /** * CVA variants for the range label text. * Controls typography and color. */ declare const paginatorRangeLabelVariants: (props?: { size?: PaginatorSize; }) => string; /** * CVA variants for the page size select element. * Controls sizing and styling of the native select. */ declare const paginatorSelectVariants: (props?: { size?: PaginatorSize; }) => string; /** * CVA variants for numbered page buttons. * Controls button sizing, active state, and interactive states. */ declare const paginatorPageButtonVariants: (props?: { size?: PaginatorSize; active?: boolean; }) => string; /** * CVA variants for the ellipsis indicator. * Controls sizing and styling of the "..." text. */ declare const paginatorEllipsisVariants: (props?: { size?: PaginatorSize; }) => string; type PaginatorContainerVariants = VariantProps; type PaginatorButtonVariants = VariantProps; type PaginatorRangeLabelVariants = VariantProps; type PaginatorSelectVariants = VariantProps; type PaginatorPageButtonVariants = VariantProps; type PaginatorEllipsisVariants = VariantProps; /** Represents a page number or ellipsis marker in the page range. */ type PageRangeItem = number | 'ellipsis'; /** * Paginator component — provides navigation for paginated content. * * Displays navigation controls, optional page size selector, and range label * showing current position within the data set. Supports numbered page buttons * when `showPageNumbers` is enabled. * * @tokens `--color-foreground`, `--color-muted-foreground`, * `--color-border`, `--color-muted`, * `--color-disabled`, `--color-disabled-foreground`, * `--color-ring`, `--color-primary`, `--color-primary-foreground` * * @example Basic usage * ```html * * ``` * * @example With page size options * ```html * * ``` * * @example With first/last buttons * ```html * * ``` * * @example With numbered page buttons * ```html * * ``` * * @example Spread layout (summary left, controls right) * ```html * * ``` * * @example Small size * ```html * * ``` * * @example Custom range label (i18n) * ```html * * ``` * ```ts * customLabel = (page, pageSize, length) => `Seite ${page + 1} von ${Math.ceil(length / pageSize)}`; * ``` */ declare class ComPaginator { /** Page number buttons for keyboard navigation. */ private readonly pageButtons; /** Total number of items being paged. */ readonly length: InputSignal; /** Number of items to display per page. */ readonly pageSize: InputSignal; /** Current zero-based page index. */ readonly pageIndex: InputSignal; /** Available page size options. Hides selector if empty. */ readonly pageSizeOptions: InputSignal; /** Whether to show first/last navigation buttons. */ readonly showFirstLastButtons: InputSignalWithTransform; /** Whether to show numbered page buttons. */ readonly showPageNumbers: InputSignalWithTransform; /** Whether all controls are disabled. */ readonly disabled: InputSignalWithTransform; /** Whether to hide the page size selector. */ readonly hidePageSize: InputSignalWithTransform; /** Size variant. */ readonly size: InputSignal; /** Layout variant. Only applies when showPageNumbers is true. */ readonly layout: InputSignal; /** Number of pages to show on each side of the current page. */ readonly siblingCount: InputSignal; /** Number of pages to always show at the start and end. */ readonly boundaryCount: InputSignal; /** Accessible label for the nav element. */ readonly ariaLabel: InputSignal; /** Custom function for range label formatting. */ readonly rangeLabel: InputSignal; /** Emits when page index or page size changes. */ readonly page: OutputEmitterRef; /** Total number of pages. */ protected readonly numberOfPages: Signal; /** Whether there is a previous page. */ protected readonly hasPreviousPage: Signal; /** Whether there is a next page. */ protected readonly hasNextPage: Signal; /** The formatted range label text. */ protected readonly rangeLabelText: Signal; /** Icon size based on component size. */ protected readonly iconSize: Signal<'xs' | 'sm'>; /** Unique ID for page size label. */ protected readonly pageSizeLabelId: Signal; /** Unique ID for page size select element. */ protected readonly pageSizeSelectId: Signal; /** Classes for the container. */ protected readonly containerClasses: Signal; /** Classes for navigation buttons. */ protected readonly buttonClasses: Signal; /** Classes for the range label. */ protected readonly rangeLabelClasses: Signal; /** Classes for the page size select. */ protected readonly selectClasses: Signal; /** Classes for the ellipsis indicator. */ protected readonly ellipsisClasses: Signal; /** Cached classes for active page button. */ protected readonly activePageButtonClasses: Signal; /** Cached classes for inactive page button. */ protected readonly inactivePageButtonClasses: Signal; /** * Computed page range for numbered pagination. * Returns array like [0, 'ellipsis', 3, 4, 5, 'ellipsis', 9] (zero-indexed). */ protected readonly pageRange: Signal; /** Navigate to the first page. */ firstPage(): void; /** Navigate to the previous page. */ previousPage(): void; /** Navigate to the next page. */ nextPage(): void; /** Navigate to the last page. */ lastPage(): void; /** Navigate to a specific page by index (zero-based). */ goToPage(pageIndex: number): void; /** Handle page size selection change. */ protected onPageSizeChange(event: Event): void; /** Handle keyboard navigation within page buttons (roving tabindex). */ protected onPageButtonsKeydown(event: KeyboardEvent): void; /** Track function for page items. */ protected trackPageItem(index: number, item: PageRangeItem): string; private emitPageEvent; /** Generate a range of numbers from start to end (inclusive). */ private range; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } export { ComPaginator, defaultRangeLabel, paginatorButtonVariants, paginatorContainerVariants, paginatorEllipsisVariants, paginatorPageButtonVariants, paginatorRangeLabelVariants, paginatorSelectVariants }; export type { PageEvent, PageRangeItem, PaginatorButtonVariants, PaginatorContainerVariants, PaginatorEllipsisVariants, PaginatorLayout, PaginatorPageButtonVariants, PaginatorRangeLabelVariants, PaginatorSelectVariants, PaginatorSize, RangeLabelFn };