@beamimpact/web-sdk
Version:
The Beam SDK enables brands to connect with their customers over shared values, not transactional discounts, to build stronger loyalty. Our integration achieves this by allowing customers to (a) choose a nonprofit where the brand will donate part of their
93 lines (89 loc) • 3.09 kB
TypeScript
import * as lit_html from 'lit-html';
import * as lit from 'lit';
import { LitElement, PropertyValues } from 'lit';
import * as lodash from 'lodash';
import '../chunks/progress-bar-CveZ8E6Q.esm.js';
import '../chunks/promo-pill-label-BXRqZHET.esm.js';
import { T as TNumericId } from '../chunks/types-CPxMwnoR.esm.js';
import { L as LANGUAGES } from '../chunks/types-DfRc36jU.esm.js';
import { T as TCart } from '../chunks/cart-contents-CLT7p7Gd.esm.js';
import '../chunks/openapi-spec-Bk7E2QQP.esm.js';
declare class BeamNotificationBlip extends LitElement {
static get styles(): lit.CSSResult;
render(): lit_html.TemplateResult<1>;
}
declare global {
interface HTMLElementTagNameMap {
"beam-notification-blip": BeamNotificationBlip;
}
}
interface RequiredConfig {
apiKey: string;
storeId: TNumericId;
}
declare class BeamSelectNonprofit extends LitElement {
static tagName: string;
baseUrl: string;
apiKey?: RequiredConfig["apiKey"];
storeId?: TNumericId;
countryCode?: string;
postalCode?: string;
cart?: TCart;
selectedNonprofitId: TNumericId | null;
lang: LANGUAGES;
debug: boolean;
draftConfig: boolean;
promoCodes?: string;
domain?: string;
private lastSelectionActionDate;
private isMobile;
private enableNonprofitDeselection;
private selectionId?;
private didTryToCreateNewSelectionFromCache;
private pluginPromoCodes;
get configLang(): LANGUAGES;
get parsedPromoCodes(): string[];
private handlePromoCodesStored;
private getManualPromoCodes;
private handleValidatedPromoCodes;
private getChainNonprofits;
private postSelectNonprofit;
private nonprofitListDataController;
private selectionDataController;
private localStorage;
private getNonprofitById;
private handleCartChange;
private handleNonprofitSelect;
private handleInitialNonprofitSync;
connectedCallback(): Promise<void>;
firstUpdated(): Promise<void>;
updated(changedProperties: PropertyValues): Promise<void>;
disconnectedCallback(): void;
private restoreStateFromCache;
private createNewSelectionForCachedNonprofit;
/**
* Factory for selection event handler
*
* Nonprofit selector implements radio-button semantics:
* * If nothing is selected, tabbing into selector selects first card
* * Arrow keys changes focus between cards, but doesn't select
* * Enter/Space sets selection
* * If a nonprofit is selected, arrow keys change focus AND selection
* * Click sets selection
* @param {number} id
* @param {number} index
* @param {{id: number}[]} nonprofits
* @returns {(evt: Event) => void}
*/
private makeHandleSelect;
evaluateBreakPoints: lodash.DebouncedFuncLeading<() => void>;
get cssVariables(): any;
static styles: lit.CSSResult[];
protected render(): "" | lit_html.TemplateResult<1>;
}
declare global {
interface HTMLElementTagNameMap {
"beam-select-nonprofit": BeamSelectNonprofit;
}
}
export { BeamSelectNonprofit };