@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
67 lines (66 loc) • 2.86 kB
TypeScript
import { ESLPopup } from '../../esl-popup/core';
import type { ESLPopupActionParams } from '../../esl-popup/core';
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;
/** text directionality of popups content */
dir?: string;
/** language of popups text content */
lang?: string;
/** popup without arrow */
disableArrow?: boolean;
}
/** List of ESLSharePopup config keys */
export declare const ESL_SHARE_POPUP_CONFIG_KEYS: (keyof ESLSharePopupActionParams)[];
/**
* 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 config keys */
static CONFIG_KEYS: string[];
/** 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 popup */
protected setInitialState(): void;
onShow(params: ESLSharePopupActionParams): void;
/** Actions to execute on popup 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;
}
}