UNPKG

devextreme

Version:

HTML5 JavaScript Component Suite for Responsive Web Development

134 lines (116 loc) 5.18 kB
/** * DevExtreme (ui/box.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<TKey> = string | Item<TKey> | any; export type ContentReadyEvent<TItem extends ItemLike<TKey> = any, TKey = any> = EventInfo<dxBox<TItem, TKey>>; export type DisposingEvent<TItem extends ItemLike<TKey> = any, TKey = any> = EventInfo<dxBox<TItem, TKey>>; export type InitializedEvent<TItem extends ItemLike<TKey> = any, TKey = any> = InitializedEventInfo<dxBox<TItem, TKey>>; export type ItemClickEvent<TItem extends ItemLike<TKey> = any, TKey = any> = NativeEventInfo<dxBox<TItem, TKey>, MouseEvent | PointerEvent> & ItemInfo<TItem>; export type ItemContextMenuEvent<TItem extends ItemLike<TKey> = any, TKey = any> = NativeEventInfo<dxBox<TItem, TKey>, MouseEvent | PointerEvent | TouchEvent> & ItemInfo<TItem>; export type ItemHoldEvent<TItem extends ItemLike<TKey> = any, TKey = any> = NativeEventInfo<dxBox<TItem, TKey>, MouseEvent | PointerEvent | TouchEvent> & ItemInfo<TItem>; export type ItemRenderedEvent<TItem extends ItemLike<TKey> = any, TKey = any> = EventInfo<dxBox<TItem, TKey>> & ItemInfo<TItem>; export type OptionChangedEvent<TItem extends ItemLike<TKey> = any, TKey = any> = EventInfo<dxBox<TItem, TKey>> & ChangedOptionInfo; /** * @deprecated use Properties instead */ export interface dxBoxOptions< TItem extends ItemLike<TKey> = any, TKey = any, > extends CollectionWidgetOptions<dxBox<TItem, TKey>, TItem, TKey> { /** * Specifies how UI component items are aligned along the main direction. */ align?: 'center' | 'end' | 'space-around' | 'space-between' | 'start'; /** * Specifies how UI component items are aligned cross-wise. */ crossAlign?: 'center' | 'end' | 'start' | 'stretch'; /** * Binds the UI component to data. */ dataSource?: DataSourceLike<TItem, TKey>; /** * Specifies the direction of item positioning in the UI component. */ direction?: 'col' | 'row'; /** * An array of items displayed by the UI component. */ items?: Array<TItem>; } /** * The Box UI component allows you to arrange various elements within it. Separate and adaptive, the Box UI component acts as a building block for the layout. */ export default class dxBox< TItem extends ItemLike<TKey> = any, TKey = any, > extends CollectionWidget<dxBoxOptions<TItem, TKey>, TItem, TKey> { } export type Item<TKey = any> = dxBoxItem<TKey>; /** * @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 dxBoxItem<TKey = any> extends CollectionWidgetItem { /** * Specifies the base size of an item element along the main direction. */ baseSize?: number | 'auto'; /** * Holds a Box configuration object for the item. */ box?: dxBoxOptions<any, TKey>; /** * Specifies the ratio value used to count the item element size along the main direction. */ ratio?: number; /** * A factor that defines how much an item shrinks relative to the rest of the items in the container. */ shrink?: number; } export type ExplicitTypes< TItem extends ItemLike<TKey>, 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<TKey> = any, TKey = any, > = dxBoxOptions<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<TKey> = any, TKey = any, > = Properties<TItem, TKey>;