UNPKG

@gez/date-time-kit

Version:

68 lines (67 loc) 2.13 kB
import { type BaseAttrs, type BaseEmits, type Emit2EventMap, UiBase } from '../web-component-base'; export interface Attrs extends BaseAttrs { /** * The current number in the list. The component will scroll to this number when rendered. * @type {number} */ 'current-num': number; /** * The minimum number in the list (include). If not set, there is no minimum limit. * @type {number} * @default -Infinity */ 'min-num'?: number; /** * The maximum number in the list (include). If not set, there is no maximum limit. * @type {number} * @default Infinity */ 'max-num'?: number; } export interface Emits extends BaseEmits { 'select-num': { oldNum: number; newNum: number; }; } export type EventMap = Emit2EventMap<Emits>; /** * 基础的数字列表组件。允许无限滚动。点击后可以滚动定位到当前数字。 * * 存在一个 formatter 方法,可以重写该方法以自定义数字的显示格式。 */ export declare class Ele extends UiBase<Attrs, Emits> { static tagName: "dt-num-list"; protected static _style: string; protected static _template: string; static get observedAttributes(): string[]; get _staticEls(): { readonly container: HTMLElement; }; get _dynamicEls(): { readonly currentItem: HTMLElement | undefined; readonly items: any[]; }; get currentNum(): number; set currentNum(val: number); get minNum(): number; set minNum(val: number); get maxNum(): number; set maxNum(val: number); private _createItem; private _intersectionOb; private _destroyOb; private _initOb; private _loadBefore; private _loadAfter; connectedCallback(): void; disconnectedCallback(): boolean | void; protected _onAttrChanged(name: string, oldValue: string | null, newValue: string | null): void; private get _itemHeight(); private get _pageSize(); private _isScrolling; scrollToCurrent: () => void; private _render; private _onClick; formatter: (num: number) => string; }