UNPKG

1.54 kBTypeScriptView Raw
1import { LayoutBase } from '../layout-base';
2import { Length } from '../../styling/style-properties';
3import { Property } from '../../core/properties';
4import { CoreTypes } from '../../../core-types';
5
6/**
7 * WrapLayout position children in rows or columns depending on orientation property
8 * until space is filled and then wraps them on new row or column.
9 */
10export class WrapLayout extends LayoutBase {
11 /**
12 * Gets or sets the flow direction. Default value is horizontal.
13 * If orientation is horizontal items are arranged in rows, else items are arranged in columns.
14 */
15 orientation: CoreTypes.OrientationType;
16
17 /**
18 * Gets or sets the width used to measure and layout each child.
19 * Default value is Number.NaN which does not restrict children.
20 */
21 itemWidth: CoreTypes.LengthType;
22
23 /**
24 * Gets or sets the height used to measure and layout each child.
25 * Default value is Number.NaN which does not restrict children.
26 */
27 itemHeight: CoreTypes.LengthType;
28}
29
30/**
31 * Represents the observable property backing the orientation property of each WrapLayout instance.
32 */
33export const orientationProperty: Property<WrapLayout, CoreTypes.OrientationType>;
34
35/**
36 * Represents the observable property backing the itemWidth property of each WrapLayout instance.
37 */
38export const itemWidthProperty: Property<WrapLayout, CoreTypes.LengthType>;
39
40/**
41 * Represents the observable property backing the itemHeight property of each WrapLayout instance.
42 */
43export const itemHeightProperty: Property<WrapLayout, CoreTypes.LengthType>;