|
| 1 | +/** |
| 2 | + * @license |
| 3 | + * Copyright (c) 2017 - 2022 Vaadin Ltd. |
| 4 | + * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/ |
| 5 | + */ |
| 6 | +import type { Constructor } from '@open-wc/dedupe-mixin'; |
| 7 | + |
| 8 | +export declare function PositionMixin<T extends Constructor<HTMLElement>>(base: T): Constructor<PositionMixinClass> & T; |
| 9 | + |
| 10 | +export declare class PositionMixinClass { |
| 11 | + /** |
| 12 | + * The element next to which this overlay should be aligned. |
| 13 | + * The position of the overlay relative to the positionTarget can be adjusted |
| 14 | + * with properties `horizontalAlign`, `verticalAlign`, `noHorizontalOverlap` |
| 15 | + * and `noVerticalOverlap`. |
| 16 | + */ |
| 17 | + positionTarget: HTMLElement; |
| 18 | + |
| 19 | + /** |
| 20 | + * When `positionTarget` is set, this property defines whether to align the overlay's |
| 21 | + * left or right side to the target element by default. |
| 22 | + * Possible values are `start` and `end`. |
| 23 | + * RTL is taken into account when interpreting the value. |
| 24 | + * The overlay is automatically flipped to the opposite side when it doesn't fit into |
| 25 | + * the default side defined by this property. |
| 26 | + * |
| 27 | + * @attr {start|end} horizontal-align |
| 28 | + */ |
| 29 | + horizontalAlign: 'end' | 'start'; |
| 30 | + |
| 31 | + /** |
| 32 | + * When `positionTarget` is set, this property defines whether to align the overlay's |
| 33 | + * top or bottom side to the target element by default. |
| 34 | + * Possible values are `top` and `bottom`. |
| 35 | + * The overlay is automatically flipped to the opposite side when it doesn't fit into |
| 36 | + * the default side defined by this property. |
| 37 | + * |
| 38 | + * @attr {top|bottom} vertical-align |
| 39 | + */ |
| 40 | + verticalAlign: 'bottom' | 'top'; |
| 41 | + |
| 42 | + /** |
| 43 | + * When `positionTarget` is set, this property defines whether the overlay should overlap |
| 44 | + * the target element in the x-axis, or be positioned right next to it. |
| 45 | + * |
| 46 | + * @attr {boolean} no-horizontal-overlap |
| 47 | + */ |
| 48 | + noHorizontalOverlap: boolean; |
| 49 | + |
| 50 | + /** |
| 51 | + * When `positionTarget` is set, this property defines whether the overlay should overlap |
| 52 | + * the target element in the y-axis, or be positioned right above/below it. |
| 53 | + * |
| 54 | + * @attr {boolean} no-vertical-overlap |
| 55 | + */ |
| 56 | + noVerticalOverlap: boolean; |
| 57 | +} |
0 commit comments