@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
46 lines (45 loc) • 2.23 kB
TypeScript
import { ESLMixinElement } from '../../esl-mixin-element/core';
import { ESLMediaRuleList } from '../../esl-media-query/core';
/**
* ESLLineClamp mixin element
* @author Dmytro Shovchko
*
* ESLLineClamp is a custom mixin element that applies line clamping to its content based on the specified number of lines.
* It uses CSS custom properties to control the number of lines and applies truncation when necessary.
* The element also handles focus management and scroll behavior to ensure a smooth user experience.
*/
export declare class ESLLineClamp extends ESLMixinElement {
static is: string;
/** Default mask for media query parsing, can be overridden by setting the static property */
static DEFAULT_MASK: string;
/** Tolerance factor for determining clamping state, used to account for minor discrepancies in height calculations */
TOLERANCE: number;
/** Indicates whether the line clamping is active */
clamped: boolean;
/** Media query to activate clamping with number of lines */
lines: string;
/** Media conditions tuple string (uses '|' as separator), to be used in case of tuple syntax */
mask: string;
/**
* Returns parsed media rule list for line clamping configuration
* @returns ESLMediaRuleList instance for managing responsive line limits
*/
get linesQuery(): ESLMediaRuleList<string>;
protected get lineHeight(): number;
protected get linesExpected(): string | null;
protected connectedCallback(): void;
protected disconnectedCallback(): void;
protected attributeChangedCallback(): void;
protected updateLines(): void;
/** Handles query change and sets the CSS custom property for line clamping */
protected onQueryChange(): void;
/** Handles focus out event and resets scroll position */
protected onFocusOut(e: FocusEvent): void;
protected lastHeight: number;
/** Handles resize events to update clamped state */
protected onResize(): void;
/** Observes custom broadcast 'esl:refresh' event to force refresh */
protected onRefresh({ target }: Event): void;
/** Handles show request events to scroll target into view */
protected onShowRequest(e: CustomEvent): void;
}