import { JSXInterface } from '../jsx'; import { BasicElement, CSSResultGroup, PropertyValues, TemplateResult } from '@refinitiv-ui/core'; import { Ref } from '@refinitiv-ui/core/directives/ref.js'; import '@refinitiv-ui/phrasebook/locale/en/pagination.js'; import { Translate, TranslateDirectiveResult } from '@refinitiv-ui/translate'; import '../button-bar/index.js'; import '../button/index.js'; import '../layout/index.js'; declare enum Direction { increment = "increment", decrement = "decrement" } /** * Used to control and navigate through multiple pages * @fires value-changed - Fired when the user interacts with the control to change pages and so the `value` property changed. The event is not triggered if `value` is changed programmatically. */ export declare class Pagination extends BasicElement { /** * Element version number * @returns version number */ static get version(): string; /** * Current page internal current page value */ private _value; /** * Internal current page * @returns current page */ private get internalValue(); /** * Current page * @default - */ get value(): string; /** * Set current page * @param value current page */ set value(value: string); /** * Max page */ protected _max: string; /** * Internal max page * @returns max page */ private get internalMax(); /** * Maximum page limit * @default - * @returns max page */ get max(): string; /** * Set max page * @param value max page */ set max(value: string); /** * Set disabled state */ disabled: boolean; /** * Get infinite pagination state * @returns infinite pagination state */ private get infinitePaginate(); /** * Reference input element */ protected inputRef: Ref; /** * Getter for input element * @returns input element */ protected get inputElement(): HTMLInputElement | null; /** * Used for translations */ protected t: Translate; /** * Getter for display page number or text depends on focusing the input * @returns string page number value or translate directive result */ protected get inputValue(): string | TranslateDirectiveResult; /** * Get page text format in various translation * @returns translate directive result */ protected get inputTextFormat(): TranslateDirectiveResult; /** * State for check the input focus */ private inputFocused; /** * State for checking the first page button is available */ protected get useFirstButton(): boolean; /** * State for checking the previous page button is available */ protected get usePreviousButton(): boolean; /** * State for checking the next page button is available */ protected get useNextButton(): boolean; /** * State for checking the last page button is available */ protected get useLastButton(): boolean; /** * @override */ protected updated(changedProperties: PropertyValues): void; /** * Select text in input when update element complete * @returns returns a promise void */ private selectInput; /** * Validate page value which returns true when value is valid * @param value value * @param warning show warning message when value is invalid * @param propName property name to show in warning message * @returns result of validation */ private validatePage; /** * Set page to the pagination * @param value page number * @returns {void} */ private setPage; /** * Updates page value depending on direction * @param direction page value direction * @param withEvent whether the event page-changed should fire * @returns {void} */ private updatePage; /** * Update input value. Do not update pagination actual value until Enter key is pressed or blur event is fired * @param value input value * @param direction update from old value * @returns void */ protected updateInputValue(value?: number, direction?: Direction | null): void; /** * Fires event when value change * @returns {void} */ private notifyValueChange; /** * Go to the next page * @returns {void} */ next(): void; /** * Go to the next page and fires event * @returns {void} */ private onNextTap; /** * Go to the previous page * @returns {void} */ previous(): void; /** * Go to the previous page and fires event * @returns {void} */ private onPreviousTap; /** * Go to the first page * @returns {void} */ first(): void; /** * Go to the first page and fires event * @returns {void} */ private onFirstTap; /** * Go to the last page * @returns {void} */ last(): void; /** * Go to the last page and fires event * @returns {void} */ private onLastTap; /** * Check pagination has a next page * @param page current page number * @returns true if pagination has a next page */ protected hasNextPage(page: number): boolean; /** * Check pagination has a previous page * @param page current page number * @returns true if pagination has a previous page */ protected hasPreviousPage(page: number): boolean; /** * Check pagination has a last page * @returns true if pagination has a last page */ protected hasLastPage(): boolean; /** * Handles action when input focused change * @param event focus change event * @returns {void} */ private onFocusedChanged; /** * Runs on input element `input` event * @param event `input` event * @returns {void} */ protected onInputInput(): void; /** * Handles key down event * @param event Key down event object * @returns {void} */ private onKeyDown; /** * A `CSSResultGroup` that will be used * to style the host, slotted children * and the internal template of the element. * @return CSS template */ static get styles(): CSSResultGroup; /** * A `TemplateResult` that will be used * to render the updated internal template. * @return Render template */ protected render(): TemplateResult; } declare global { interface HTMLElementTagNameMap { 'ef-pagination': Pagination; } } export {}; declare global { interface HTMLElementTagNameMap { 'ef-pagination': Pagination; } namespace JSX { interface IntrinsicElements { 'ef-pagination': Partial | JSXInterface.HTMLAttributes; } } } export {};