layout
Ce contenu n’est pas encore disponible dans votre langue.
Utilities for layouting elements.
Type Aliases
LayoutBetweenOptions
Additional options for the space between layout utilities.
Type declaration
centerBased?
Whether to use a center based approach, or a bounds based approach. Defaults to bounds.
minGap?
Min gap between elements.
Defined in
tmp/commons/src/lib/utils/layout.ts:121
LayoutOptions
Additional options for the layout utilities.
Type declaration
refPos?
Index of the reference element. Defaults to 0.
Defined in
tmp/commons/src/lib/utils/layout.ts:27
LayoutRect
Structure used by the layout utilities.
It represents a bounding rect for a layout element.
Type declaration
h
Height of the bounding rect.
w
Width of the bounding rect.
x
Position on the x axis of top left corner.
y
Position on the y axis of top left corner.
Defined in
tmp/commons/src/lib/utils/layout.ts:13
Functions
getAlignBetweenOffsets()
Returns offsets to space elements evenly on the y axis with a minimum gap.
Parameters
• rects: LayoutRect
[]
Bounding rectangles of elements to align.
• options: LayoutBetweenOptions
= {}
Additional options for the layout.
Returns
Vector2D
[]
Array of offsets for each element.
Defined in
tmp/commons/src/lib/utils/layout.ts:195
getAlignBottomOffsets()
Returns offsets to align the bottoms of elements to the bottom of a reference element.
Parameters
• rects: LayoutRect
[]
Bounding rectangles of elements to align.
• options?: LayoutOptions
Additional options for the layout.
Returns
Vector2D
[]
Array of offsets for each element.
Defined in
tmp/commons/src/lib/utils/layout.ts:74
getAlignMiddleOffsets()
Returns offsets to align the middles of elements to the middle of a reference element.
Parameters
• rects: LayoutRect
[]
Bounding rectangles of elements to align.
• options?: LayoutOptions
Additional options for the layout.
Returns
Vector2D
[]
Array of offsets for each element.
Defined in
tmp/commons/src/lib/utils/layout.ts:84
getAlignTopOffsets()
Returns offsets to align the tops of elements to the top of a reference element.
Parameters
• rects: LayoutRect
[]
Bounding rectangles of elements to align.
• options?: LayoutOptions
Additional options for the layout.
Returns
Vector2D
[]
Array of offsets for each element.
Defined in
tmp/commons/src/lib/utils/layout.ts:64
getJustifyBetweenOffsets()
Returns offsets to space elements evenly on the x axis with a minimum gap.
Parameters
• rects: LayoutRect
[]
Bounding rectangles of elements to align.
• options: LayoutBetweenOptions
= {}
Additional options for the layout.
Returns
Vector2D
[]
Array of offsets for each element.
Defined in
tmp/commons/src/lib/utils/layout.ts:134
getJustifyCenterOffsets()
Returns offsets to align the centers of elements to the center of a reference element.
Parameters
• rects: LayoutRect
[]
Bounding rectangles of elements to align.
• options?: LayoutOptions
Additional options for the layout.
Returns
Vector2D
[]
Array of offsets for each element.
Defined in
tmp/commons/src/lib/utils/layout.ts:114
getJustifyLeftOffsets()
Returns offsets to align the lefts of elements to the left of a reference element.
Parameters
• rects: LayoutRect
[]
Bounding rectangles of elements to align.
• options?: LayoutOptions
Additional options for the layout.
Returns
Vector2D
[]
Array of offsets for each element.
Defined in
tmp/commons/src/lib/utils/layout.ts:94
getJustifyRightOffsets()
Returns offsets to align the rights of elements to the right of a reference element.
Parameters
• rects: LayoutRect
[]
Bounding rectangles of elements to align.
• options?: LayoutOptions
Additional options for the layout.
Returns
Vector2D
[]
Array of offsets for each element.