UNPKG

@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

94 lines (91 loc) 3.33 kB
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-0VS_AmEf.esm.js'; import '../chunks/promo-pill-label-3bA1z-la.esm.js'; import './beam-partner-logos.js'; import { T as TNumericId, a as TId } from '../chunks/types-zbTZ8-KP.esm.js'; import { T as TCart } from '../chunks/cart-contents-CMm57qu0.esm.js'; import { L as LANGUAGES } from '../chunks/types-aju0qrRe.esm.js'; import '../chunks/openapi-spec-hjdK2L9Q.esm.js'; interface TransactionRequiredConfig { apiKey: string; transactionId: TId; } interface SubscriptionRequiredConfig { apiKey: string; subscriptionId: string; } type TRequiredConfig = TransactionRequiredConfig | SubscriptionRequiredConfig; declare class BeamRedeemTransaction extends LitElement { static tagName: string; baseUrl: string; apiKey?: TRequiredConfig["apiKey"]; transactionId?: TransactionRequiredConfig["transactionId"]; subscriptionId?: SubscriptionRequiredConfig["subscriptionId"]; storeId?: TNumericId; countryCode?: string; postalCode?: string; cart?: TCart; selectedNonprofitId?: TNumericId; lang: LANGUAGES; debug: boolean; draftConfig: boolean; private isMobile; private didUserExpandNonprofits; private shouldUsePromoUI; get configLang(): LANGUAGES; private get hasCorrectTransactionConfig(); private get hasCorrectSubscriptionConfig(); private getChainNonprofits; private updateNonprofitIdForRecord; private putTransaction; private putSubscription; private nonprofitListDataController; private selectionDataController; private localStorage; connectedCallback(): void; firstUpdated(_changedProperties: PropertyValues): Promise<void>; updated(previousPropertyValues: PropertyValues): Promise<void>; disconnectedCallback(): void; private restoreStateFromCache; /** * 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; get allowChange(): boolean; get allowSubmit(): boolean; handleSubmit: () => Promise<void>; private get shouldUseStoredSelection(); evaluateBreakPoints: lodash.DebouncedFuncLeading<() => void>; get cssVariables(): any; static styles: lit.CSSResult[]; private handleChooseClick; get shouldCollapse(): boolean; private renderSubmitButton; private renderRadioButton; private renderNonprofitImage; private renderOptionDetail; private renderProgressBar; private renderNonprofitDetails; private renderPromoPill; protected render(): "" | lit_html.TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { "beam-redeem-transaction": BeamRedeemTransaction; } } export { BeamRedeemTransaction };