UNPKG

@exadel/esl

Version:

Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components

58 lines (57 loc) 2.08 kB
import { ESLMixinElement } from '../../esl-mixin-element/core'; /** Temporary wrapper object */ interface MatchItem { /** Wrapped HTMLElement */ $el: HTMLElement; /** Order based on order parameter */ order: number; /** Top position of the element on the page */ top: number; /** Height of the element */ height: number; } /** * ESLMatchHeight - mixin element to equalize heights of child elements within a container * @author Feoktyst Shovchko, Alexey Stsefanovich (ala'n) * * Use example: * ```html * <div esl-match-height="selector" * esl-match-height-order="selectorTopPriority | selectorSecondPriority"> * ... div.selector * n * </div> * ``` */ export declare class ESLMatchHeightMixin extends ESLMixinElement { static is: string; static observedAttributes: string[]; /** Default selector for child elements to normalize */ static readonly DEFAULT_SELECTOR = "[match-height]"; /** Selector to find all the child elements that should be normalized by height */ selector: string; /** A list of selectors in the order of priority (always ends with '*' matcher) */ orders: string[]; /** List of HTMLElements to normalize height */ get $elements(): HTMLElement[]; protected connectedCallback(): void; protected disconnectedCallback(): void; protected attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void; /** Starts elements normalization */ update(): void; protected onResize(): void; protected onFontsLoaded(): void; /** Compares two {@link MatchItem} objects */ compare(a: MatchItem, b: MatchItem): number; /** Creates a wrapper object based on the passed element */ protected toMatchItem($el: HTMLElement): MatchItem; /** Resets height values */ clear($els?: HTMLElement[]): void; /** Update height values for passed elements */ resize($els?: HTMLElement[]): void; } declare global { export interface ESLLibrary { MatchHeight: typeof ESLMatchHeightMixin; } } export {};