UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

155 lines (137 loc) 5.79 kB
/** * DevExtreme (ui/tile_view.d.ts) * Version: 21.2.4 * Build date: Mon Dec 06 2021 * * Copyright (c) 2012 - 2021 Developer Express Inc. ALL RIGHTS RESERVED * Read about DevExtreme licensing here: https://js.devexpress.com/Licensing/ */ import { DataSourceLike } from '../data/data_source'; import { EventInfo, NativeEventInfo, InitializedEventInfo, ChangedOptionInfo, ItemInfo, } from '../events/index'; import CollectionWidget, { CollectionWidgetItem, CollectionWidgetOptions, } from './collection/ui.collection_widget.base'; /** * @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}. */ type ItemLike = string | Item | any; export type ContentReadyEvent<TItem extends ItemLike = any, TKey = any> = EventInfo<dxTileView<TItem, TKey>>; export type DisposingEvent<TItem extends ItemLike = any, TKey = any> = EventInfo<dxTileView<TItem, TKey>>; export type InitializedEvent<TItem extends ItemLike = any, TKey = any> = InitializedEventInfo<dxTileView<TItem, TKey>>; export type ItemClickEvent<TItem extends ItemLike = any, TKey = any> = NativeEventInfo<dxTileView<TItem, TKey>, KeyboardEvent | MouseEvent | PointerEvent> & ItemInfo<TItem>; export type ItemContextMenuEvent<TItem extends ItemLike = any, TKey = any> = NativeEventInfo<dxTileView<TItem, TKey>, MouseEvent | PointerEvent | TouchEvent> & ItemInfo<TItem>; export type ItemHoldEvent<TItem extends ItemLike = any, TKey = any> = NativeEventInfo<dxTileView<TItem, TKey>, MouseEvent | PointerEvent | TouchEvent> & ItemInfo<TItem>; export type ItemRenderedEvent<TItem extends ItemLike = any, TKey = any> = EventInfo<dxTileView<TItem, TKey>> & ItemInfo<TItem>; export type OptionChangedEvent<TItem extends ItemLike = any, TKey = any> = EventInfo<dxTileView<TItem, TKey>> & ChangedOptionInfo; /** * @deprecated use Properties instead */ export interface dxTileViewOptions< TItem extends ItemLike = any, TKey = any, > extends CollectionWidgetOptions<dxTileView<TItem, TKey>, TItem, TKey> { /** * A Boolean value specifying whether or not the UI component changes its state when interacting with a user. */ activeStateEnabled?: boolean; /** * Specifies the height of the base tile view item. */ baseItemHeight?: number; /** * Specifies the width of the base tile view item. */ baseItemWidth?: number; /** * Binds the UI component to data. */ dataSource?: DataSourceLike<TItem, TKey>; /** * Specifies whether the UI component is oriented horizontally or vertically. */ direction?: 'horizontal' | 'vertical'; /** * Specifies whether the UI component can be focused using keyboard navigation. */ focusStateEnabled?: boolean; /** * Specifies the UI component&apos;s height. */ height?: number | string | (() => number | string); /** * Specifies whether the UI component changes its state when a user pauses on it. */ hoverStateEnabled?: boolean; /** * Specifies the distance in pixels between adjacent tiles. */ itemMargin?: number; /** * An array of items displayed by the UI component. */ items?: Array<TItem>; /** * A Boolean value specifying whether or not to display a scrollbar. */ showScrollbar?: boolean; } /** * The TileView UI component contains a collection of tiles. Tiles can store much more information than ordinary buttons, that is why they are very popular in apps designed for touch devices. */ export default class dxTileView< TItem extends ItemLike = any, TKey = any, > extends CollectionWidget<dxTileViewOptions<TItem, TKey>, TItem, TKey> { /** * Gets the current scroll position. */ scrollPosition(): number; } export type Item = dxTileViewItem; /** * @deprecated Use Item instead * @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}. */ export interface dxTileViewItem extends CollectionWidgetItem { /** * Specifies a multiplier for the baseItemHeight property value (for the purpose of obtaining the actual item height). */ heightRatio?: number; /** * Specifies a multiplier for the baseItemWidth property value (for the purpose of obtaining the actual item width). */ widthRatio?: number; } export type ExplicitTypes< TItem extends ItemLike, TKey, > = { Properties: Properties<TItem, TKey>; ContentReadyEvent: ContentReadyEvent<TItem, TKey>; DisposingEvent: DisposingEvent<TItem, TKey>; InitializedEvent: InitializedEvent<TItem, TKey>; ItemClickEvent: ItemClickEvent<TItem, TKey>; ItemContextMenuEvent: ItemContextMenuEvent<TItem, TKey>; ItemHoldEvent: ItemHoldEvent<TItem, TKey>; ItemRenderedEvent: ItemRenderedEvent<TItem, TKey>; OptionChangedEvent: OptionChangedEvent<TItem, TKey>; }; export type Properties< TItem extends ItemLike = any, TKey = any, > = dxTileViewOptions<TItem, TKey>; /** * @deprecated use Properties instead * @deprecated Attention! This type is for internal purposes only. If you used it previously, please describe your scenario in the following GitHub Issue, and we will suggest a public alternative: {@link https://github.com/DevExpress/DevExtreme/issues/17885|Internal Types}. */ export type Options< TItem extends ItemLike = any, TKey = any, > = Properties<TItem, TKey>;