@salla.sa/twilight-components
Version:
Salla Web Component
176 lines (175 loc) • 4.8 kB
TypeScript
import { GiftResponse, GiftImage, Region, Cities, Country } from './gift-schema';
/**
* @slot widget-btn-content - Used to customize widget button content.
*/
export declare class SallaGifting {
constructor();
private modal;
private uploader?;
private stepsWrapper?;
private textSelect?;
private customTextArea?;
private textArea?;
private calendarFormGroup?;
private step1Elems?;
private step2Elems?;
private defaultEvent;
sectionTitle: string;
sectionSubtitle: string;
sectionBtnText: string;
giftDetails: string;
selectImageForYourGift: string;
selectImageOrUpload: string;
selectGiftMessage: string;
giftCustomText: string;
textId: string;
incorrectGiftText: string;
nextStep: string;
senderNameLabel: string;
receiverNameFieldLabel: string;
receiverMobileFieldLabel: string;
receiverCountryFieldLabel: string;
ksa: string;
selectCountry: string;
selectCity: string;
selectCityInfo: string;
receiverCityFieldLabel: string;
receiverRegionFieldLabel: string;
selectRegion: string;
receiverEmailFieldLabel: string;
emailPlaceholder: string;
sendLater: string;
selectSendDateAndTime: string;
canNotEditOrderAfterSelectDate: string;
sendGift: string;
donationRequired: string;
currentStep: number;
showCalendar: boolean;
showGiftText: boolean;
currentLang: string;
parentClass: string;
errors: object;
gift: GiftResponse;
selectedGiftTextOption: string;
selectedCountryId: number;
selectedCountryCode: string;
loadingCities: boolean;
loadingRegions: boolean;
regions: Region[];
selectedRegionId: number;
isKSA: boolean;
selectedCountry: Country | null;
selectedRegion: Region | null;
displayedCities: Cities[];
selectedCity: Cities | null;
searchingCities: boolean;
enableCityAjaxSearch: boolean;
citySearchQuery: string;
private step2Animated;
private static readonly CITY_AJAX_THRESHOLD;
private static readonly CITY_SEARCH_DEBOUNCE_MS;
private citySearchTimer;
private citySearchCounter;
private locationRequestCounter;
parsedFormData?: Record<string, any>;
showTextArea: boolean;
selectedImage: string;
uploadedImage: string;
selectedText: string;
senderName: string;
errorMessage: string;
hasError: boolean;
quantity: number;
deliveryDate: string;
timeZone?: string;
receiverName: string;
receiverMobile: string;
receiverCountryCode: string;
receiverEmail: string;
hostId: string;
receiverCity: string;
/**
* The product id for which the gifting system is required.
*/
productId: number;
/**
* Widget title
*/
widgetTitle: string;
/**
* Widget subtitle
*/
widgetSubtitle: string;
/**
* Is Physical products
*/
physicalProducts: boolean;
/**
* Is Physical products (alias of `physicalProducts` for themes passing `physical`)
*/
physical: boolean;
private isPhysical;
/**
* Is Vertical widget
*/
vertical: boolean;
/**
* The form selector to be used to get the form data
*/
formSelector: string;
componentDidLoad(): void;
private getFormDataFromForm;
private mergeObjectToFormData;
/**
* Show / Open the gifting modal window
*/
open(): Promise<any>;
/**
*
* Hide / close the gifting modal window
*/
close(): Promise<HTMLElement>;
/**
* Update the modal height based on the changes on the inner elements height for a specific step OR just a pass a new fixed height
*/
private setWrapperHeight;
private toggleCalendar;
private toggleGiftText;
/**
*
* Go to the step 2
*/
goToStep2(): Promise<void>;
/**
*
* Go to the step 1
*/
goToStep1(e: any): void;
private getFilepondPlaceholder;
setPreview(image: GiftImage): void;
removePreview(): void;
private handleTextAreaChange;
private clearError;
private handleSenderName;
private handleReceiverName;
private resetCityState;
private setInitialCities;
private fetchCities;
private handleCitySearch;
private handleCitySelected;
private handleCityDropdownClosed;
private handleCountryDropdownClosed;
private handleRegionDropdownClosed;
private handleCountrySelected;
private handleRegionSelected;
private handleUploadImage;
private handleRemoveImage;
private handlePhoneInputChange;
private handleDateTimePicker;
private getCalendarClasses;
private submitForm;
private step2ItemClass;
private generateClass;
private handleGiftButtonClick;
render(): any[];
}