@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
57 lines (56 loc) • 2.51 kB
TypeScript
import { ESLPopup } from '../../esl-popup/core/esl-popup';
import type { ESLPopupActionParams } from '../../esl-popup/core/esl-popup';
import type { ESLShareButtonConfig } from './esl-share-config';
export type { ESLSharePopupTagShape } from './esl-share-popup.shape';
export interface ESLSharePopupActionParams extends ESLPopupActionParams {
/** list of social networks or groups of them to display */
list?: string;
}
/**
* ESLSharePopup component
* @author Dmytro Shovchko
*
* ESLSharePopup is an extension of {@link ESLPopup} that:
* - exists as a singleton
* - renders a list of {@link ESLShareButton}s based on the {@link ESLShareConfig} config from host {@link ESLShare} component
* - forwards the sharing attributes from the host share {@link ESLShare} component
*/
export declare class ESLSharePopup extends ESLPopup {
static is: string;
/** Default params to pass into the share popup */
static DEFAULT_PARAMS: ESLSharePopupActionParams;
/** List of attributes to forward from the activator to the {@link ESLSharePopup} */
static forwardedAttrs: string[];
/** Register {@link ESLSharePopup} component and dependent {@link ESLShareButton} */
static register(): void;
/** Shared instance of ESLSharePopup */
static get sharedInstance(): ESLSharePopup;
/** Hashstring with a list of buttons already rendered in the popup */
protected _list: string;
connectedCallback(): void;
/** Sets initial state of the Tooltip */
protected setInitialState(): void;
onShow(params: ESLSharePopupActionParams): void;
/** Actions to execute on Tooltip hiding. */
onHide(params: ESLSharePopupActionParams): void;
/** Checks that the button list from the config was already rendered in the popup. */
protected isEqual(config: ESLShareButtonConfig[]): boolean;
/** Appends a button to the popup. */
protected appendButton(btnCfg: ESLShareButtonConfig): void;
/** Appends buttons from the list to the popup. */
protected appendButtonsFromList(config: ESLShareButtonConfig[]): void;
/**
* Forwards share attributes from the activator (or its parents) to the {@link ESLSharePopup} instance.
* Skips empty attributes
*/
protected forwardAttributes(): void;
protected _onConfigChange(): void;
}
declare global {
export interface ESLLibrary {
SharePopup: typeof ESLSharePopup;
}
export interface HTMLElementTagNameMap {
'esl-share-popup': ESLSharePopup;
}
}