import { DButton } from "./d-button"; import { DLayoutHorizontal, DLayoutHorizontalOptions, DThemeLayoutHorizontal } from "./d-layout-horizontal"; import { DPaginationDots } from "./d-pagination-dots"; import { DPaginationButtonLastOptions } from "./d-pagination-button-last"; import { DPaginationButtonNextOptions } from "./d-pagination-button-next"; import { DPaginationButtonPageOptions } from "./d-pagination-button-page"; import { DPaginationButtonPreviousOptions } from "./d-pagination-button-previous"; import { DPaginationButtonTopOptions } from "./d-pagination-button-top"; import { DPaginationPage, DPaginationPageOptions } from "./d-pagination-page"; import { DLayoutSpace, DLayoutSpaceOptions } from "./d-layout-space"; import { DImageBase } from "./d-image-base"; export interface DPaginationButtonOptions { /** * {@link DPagination} top button options. */ top?: DPaginationButtonTopOptions | boolean | null; /** * {@link DPagination} previous button options. */ previous?: DPaginationButtonPreviousOptions | boolean | null; /** * {@link DPagination} page button options. */ page?: DPaginationButtonPageOptions; /** * {@link DPagination} next button options. */ next?: DPaginationButtonNextOptions | boolean | null; /** * {@link DPagination} last button options. */ last?: DPaginationButtonLastOptions | boolean | null; /** * A space between page buttons and next / previous buttons. */ space?: DLayoutSpaceOptions | boolean | number | null; } export interface DPaginationOptions extends DLayoutHorizontalOptions { /** * An index number of a selected page. */ value?: number; /** * An index number of a selected page. * * @deprecated in favor of {@link value}. */ selected?: number; /** * A total number of pages. */ size?: number; /** * A total number of pages. * * @deprecated in favor of {@link size}; */ total?: number; /** * {@link DPagination} button options. */ button?: DPaginationButtonOptions; /** * {@link DPagination} page options. */ page?: DPaginationPageOptions; } export interface DThemePagination extends DThemeLayoutHorizontal { getButtonSpace(): number; } export declare class DPagination = DPaginationOptions> extends DLayoutHorizontal { protected _size: number; protected _value: number; protected _buttonTop?: DButton | null; protected _buttonPrevious?: DButton | null; protected _spaceLeft?: DLayoutSpace | null; protected _dots0?: DPaginationDots; protected _buttonPages0?: DButton[]; protected _page?: DPaginationPage; protected _buttonPages1?: DButton[]; protected _dots1?: DPaginationDots; protected _spaceRight?: DLayoutSpace | null; protected _buttonNext?: DButton | null; protected _buttonLast?: DButton | null; constructor(options?: OPTIONS); /** * Sets a value that is an index of a current page. * * @param value a value that is an index of a page */ set value(value: number); /** * Returns a value that is an index of a current page. * * @returns a value that is an index of a selected page. */ get value(): number; /** * Selects a page. * * @param index an index of a page * @deprecated in favor of {@link value}. */ set selected(index: number); /** * Returns an index of the selected page. * * @returns an index of the selected page. * @deprecated in favor of {@link value}. */ get selected(): number; /** * Sets a number of total pages. * * @param size a number of pages */ set size(size: number); /** * Returns a number of total pages. * * @returns a number of total pages. */ get size(): number; /** * Sets a number of total pages. * * @param total a number of pages * @deprecated in favor of {@link size} */ set total(total: number); /** * Returns a number of total pages. * * @returns a number of total pages. * @deprecated in favor of {@link size} */ get total(): number; protected get dots0(): DPaginationDots; protected get dots1(): DPaginationDots; protected newDots(): DPaginationDots; protected get buttonLast(): DButton | null; protected newButtonLast(): DButton | null; protected onButtonLastActive(): void; /** * Goes to the last page. * Unlike {@link value}, this method emits the change event if silently is not true. * * @param silently true to suppress the change event * @returns true if succeeded. */ goToLast(silently?: boolean): boolean; /** * Goes to the given page. * Unlike {@link value}, this method emits the change event if silently is not true. * * @param index a page index * @param silently true to suppress the change event * @returns this */ goTo(index: number, silently?: boolean): boolean; protected get buttonNext(): DButton | null; protected newButtonNext(): DButton | null; protected onButtonNextActive(): void; /** * Goes to the next page. * Unlike {@link value}, this method emits the change event if silently is not true. * * @param silently true to suppress the change event * @returns true if succeeded. */ goToNext(silently?: boolean): boolean; protected get buttonPrevious(): DButton | null; protected newButtonPrevious(): DButton | null; protected onButtonPreviousActive(): void; /** * Goes to the previous page. * Unlike {@link value}, this method emits the change event if silently is not true. * * @param silently true to suppress the change event * @returns true if succeeded. */ goToPrevious(silently?: boolean): boolean; protected get buttonTop(): DButton | null; protected newButtonTop(): DButton | null; protected onButtonTopActive(): void; /** * Goes to the top page. * Unlike {@link value}, this method emits the change event if silently is not true. * * @param silently true to suppress the change event * @returns true if succeeded. */ goToTop(silently?: boolean): boolean; protected newButtonPage(): DButton; protected get buttonPages0(): DButton[]; protected newButtonPages0(): DButton[]; protected allocButtonPages0(size: number): void; protected get buttonPages1(): DButton[]; protected newButtonPages1(): DButton[]; protected allocButtonPages1(size: number): void; protected get page(): DPaginationPage; protected newPage(): DPaginationPage; protected onButtonPageActive(button: DButton): void; protected get spaceLeft(): DLayoutSpace | null; protected newSpaceLeft(): DLayoutSpace | null; protected get spaceRight(): DLayoutSpace | null; protected newSpaceRight(): DLayoutSpace | null; protected newSpace(): DLayoutSpace | null; protected onReflow(): void; protected update(): void; protected doUpdate0(value: number, size: number): void; protected doUpdate1(value: number, size: number): void; protected doUpdate2(value: number, size: number, left: 0 | 1 | 2 | 3 | 4, right: 0 | 1 | 2 | 3 | 4, nleft1: number, nright1: number): void; protected showPage(button: DImageBase, index: number): void; protected hidePage(button: DImageBase): void; protected showDots(dots: DPaginationDots, from: number, to: number): void; protected hideDots(dots: DPaginationDots): void; protected getType(): string; }