UNPKG

ng-devui

Version:

DevUI components based on Angular

147 lines (146 loc) 6.1 kB
import { ConnectedPosition } from '@angular/cdk/overlay'; import { AfterViewInit, ApplicationRef, ChangeDetectorRef, ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core'; import { DropDownAppendToBodyComponent } from 'ng-devui/dropdown'; import { I18nInterface, I18nService } from 'ng-devui/i18n'; import { AppendToBodyDirection } from 'ng-devui/utils'; import { Subscription } from 'rxjs'; import * as i0 from "@angular/core"; export declare class PaginationComponent implements OnChanges, AfterViewInit, OnDestroy, OnInit { private ref; private i18n; private appRef; static EFFECT_PAGE_RANGE_KEYS: string[]; /** * 【可选】每页显示最大条目数量,默认10条 */ pageSize: number; /** * 【可选】用于选择更改分页每页最大条目数量的下拉框的数据源,默认为`[5, 10, 20, 50]` */ pageSizeOptions: number[]; pageSizeDirection: Array<AppendToBodyDirection | ConnectedPosition>; /** * 【可选】初始化页码 */ pageIndex: number; /** * 页码变化的回调 */ pageIndexChange: EventEmitter<number>; /** * 每页最大条目数量变更时的回调 */ pageSizeChange: EventEmitter<number>; /** * 分页最多显示几个按钮,默认10个 */ maxItems: number; /** * @depreted 存在xxs风险,后续将替换为模板,使用方需根据自身场景做好防护 * 【可选】前一页按钮文字,默认为左箭头图标 */ preLink: string; /** * @depreted 存在xxs风险,后续将替换为模板,使用方需根据自身场景做好防护 * 【可选】后一页按钮文字,默认为左箭头图标 */ nextLink: string; /** * 【可选】分页组件尺寸 */ size: '' | 'sm' | 'lg'; /** * 【可选】是否显示分页输入跳转 */ canJumpPage: boolean; /** * 【可选】是否显示用于选择更改分页每页最大条目数量的下拉框 */ canChangePageSize: boolean; /** * 【可选】是否显示总条目 */ canViewTotal: boolean; /** * @deprecated */ cssClass: string; showJumpButton: boolean; showTruePageIndex: boolean; /** * @deprecated */ id: any; showPages: any[]; totalPage: number; _total: number; jumpPage: any; rotateDegrees: number; totalItemText: string; goToText: string; /** * @deprecated * 下拉菜单默认方向 */ selectDirection: 'auto' | 'up' | 'down'; /** * 极简模式开关 */ lite: boolean; showPageSelector: boolean; haveConfigMenu: boolean; autoFixPageIndex: boolean; /** * 是否自动隐藏 */ autoHide: boolean; minPageSizeOptions: number; litePaginatorIndex: { value: number; label: string; } | null; litePaginatorOptions: any[]; private litePaginatorOptionsLengthCache; showConfig: boolean; litePaginator: ElementRef; dropDownElement: DropDownAppendToBodyComponent; activeBlock: ElementRef; private configButtonLoseFocusHandler; private loseFocusListener; i18nText: I18nInterface['pagination']; i18nLocale: I18nInterface['locale']; i18nSubscription: Subscription; activeBlockInfo: any; constructor(ref: ChangeDetectorRef, i18n: I18nService, appRef: ApplicationRef); ngOnInit(): void; set total(total: any); get total(): any; first(): void; last(): void; prev(): void; next(): void; jump(): void; validateInput(): void; preRange(): void; nextRange(): void; onPageIndexChange(pageIndex: number): void; onPageSizeChange(size: any): void; hasPrev(): boolean; hasNext(): boolean; private getTotalPage; ngOnChanges(changes: SimpleChanges): void; ngAfterViewInit(): void; setActiveAnimation(): void; private updateShowPageRange; private extractRange; private constructLitePaginatorOptions; private adjustPaginatorWidth; onToggle(event: any): void; toggleMenu(force?: boolean): void; private closeMenu; private unsubscribeLoseFocusHandler; ngOnDestroy(): void; private subscribeLoseFocusHandler; static ɵfac: i0.ɵɵFactoryDeclaration<PaginationComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<PaginationComponent, "d-pagination", ["pagination"], { "pageSize": { "alias": "pageSize"; "required": false; }; "pageSizeOptions": { "alias": "pageSizeOptions"; "required": false; }; "pageSizeDirection": { "alias": "pageSizeDirection"; "required": false; }; "pageIndex": { "alias": "pageIndex"; "required": false; }; "maxItems": { "alias": "maxItems"; "required": false; }; "preLink": { "alias": "preLink"; "required": false; }; "nextLink": { "alias": "nextLink"; "required": false; }; "size": { "alias": "size"; "required": false; }; "canJumpPage": { "alias": "canJumpPage"; "required": false; }; "canChangePageSize": { "alias": "canChangePageSize"; "required": false; }; "canViewTotal": { "alias": "canViewTotal"; "required": false; }; "cssClass": { "alias": "cssClass"; "required": false; }; "showJumpButton": { "alias": "showJumpButton"; "required": false; }; "showTruePageIndex": { "alias": "showTruePageIndex"; "required": false; }; "id": { "alias": "id"; "required": false; }; "totalItemText": { "alias": "totalItemText"; "required": false; }; "goToText": { "alias": "goToText"; "required": false; }; "selectDirection": { "alias": "selectDirection"; "required": false; }; "lite": { "alias": "lite"; "required": false; }; "showPageSelector": { "alias": "showPageSelector"; "required": false; }; "haveConfigMenu": { "alias": "haveConfigMenu"; "required": false; }; "autoFixPageIndex": { "alias": "autoFixPageIndex"; "required": false; }; "autoHide": { "alias": "autoHide"; "required": false; }; "total": { "alias": "total"; "required": false; }; }, { "pageIndexChange": "pageIndexChange"; "pageSizeChange": "pageSizeChange"; }, never, ["*"], false, never>; }