@liquidcommerce/elements-sdk 2.5.6-beta.2 → 2.5.6-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -25
- package/dist/index.esm.js +13044 -11746
- package/dist/types/constants/core.constant.d.ts +0 -1
- package/dist/types/core/{api-client.service.d.ts → api/api-client.service.d.ts} +3 -3
- package/dist/types/core/{auth.service.d.ts → api/auth-client.service.d.ts} +2 -3
- package/dist/types/core/api/http-client.service.d.ts +45 -0
- package/dist/types/core/client/client-action.service.d.ts +0 -4
- package/dist/types/core/client/client-config.service.d.ts +8 -0
- package/dist/types/core/command/base-command.service.d.ts +1 -1
- package/dist/types/core/fingerprint.service.d.ts +2 -1
- package/dist/types/core/google-tag-manager.service.d.ts +3 -20
- package/dist/types/core/logger/logger.service.d.ts +0 -2
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +0 -2
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +0 -10
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +14 -8
- package/dist/types/core/pubsub/interfaces/product.interface.d.ts +0 -6
- package/dist/types/core/singleton-manager.service.d.ts +6 -1
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +77 -80
- package/dist/types/core/store/interfaces/core.interface.d.ts +2 -2
- package/dist/types/core/store/store.constant.d.ts +1 -1
- package/dist/types/core/telemetry/telemetry.interface.d.ts +1 -1
- package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
- package/dist/types/elements-base-client.d.ts +3 -4
- package/dist/types/enums/core.enum.d.ts +15 -11
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/checkout.interface.d.ts +0 -1
- package/dist/types/interfaces/core.interface.d.ts +13 -7
- package/dist/types/modules/cart/components/cart-retailer.component.d.ts +0 -2
- package/dist/types/modules/checkout/checkout.commands.d.ts +28 -25
- package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +14 -0
- package/dist/types/modules/checkout/components/checkout-buyer-summary.component.d.ts +7 -0
- package/dist/types/modules/checkout/components/{checkout-information-section.component.d.ts → checkout-buyer.component.d.ts} +5 -5
- package/dist/types/modules/checkout/components/checkout-deliver-to-summary.component.d.ts +7 -0
- package/dist/types/modules/checkout/components/checkout-deliver-to.component.d.ts +13 -0
- package/dist/types/modules/checkout/components/checkout-information.component.d.ts +17 -0
- package/dist/types/modules/checkout/components/{checkout-summary-section.component.d.ts → checkout-order-summary.component.d.ts} +1 -1
- package/dist/types/modules/checkout/components/checkout-payment-summary.component.d.ts +7 -0
- package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +30 -0
- package/dist/types/modules/checkout/components/{summary/checkout-place-order-button.component.d.ts → checkout-place-order-button.component.d.ts} +1 -5
- package/dist/types/modules/checkout/components/checkout-send-as-gift.component.d.ts +7 -0
- package/dist/types/modules/checkout/components/{information/checkout-stripe-form.component.d.ts → checkout-stripe-form.component.d.ts} +5 -3
- package/dist/types/modules/checkout/components/checkout-stripe-handler.component.d.ts +50 -0
- package/dist/types/modules/checkout/components/index.d.ts +23 -18
- package/dist/types/modules/checkout/constant.d.ts +0 -1
- package/dist/types/modules/product/components/components.d.ts +1 -1
- package/dist/types/modules/product/utils/helpers.d.ts +0 -7
- package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +6 -4
- package/dist/types/modules/ui-components/input/input.component.d.ts +4 -4
- package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +3 -4
- package/docs/ACTIONS.md +29 -29
- package/docs/CONFIGURATION.md +20 -1
- package/docs/EVENTS.md +62 -29
- package/docs/THEMING.md +2 -5
- package/package.json +8 -8
- package/umd/elements.js +1 -1
- package/dist/types/core/utils.d.ts +0 -23
- package/dist/types/modules/checkout/checkout.commands.helper.d.ts +0 -13
- package/dist/types/modules/checkout/components/information/checkout-billing-form.component.d.ts +0 -18
- package/dist/types/modules/checkout/components/information/checkout-buyer-information-form.component.d.ts +0 -12
- package/dist/types/modules/checkout/components/information/checkout-delivery-information-form.component.d.ts +0 -17
- package/dist/types/modules/checkout/components/information/checkout-payment-form.component.d.ts +0 -21
- package/dist/types/modules/product/utils/index.d.ts +0 -2
- /package/dist/types/modules/checkout/components/{summary/checkout-amounts.component.d.ts → checkout-amounts.component.d.ts} +0 -0
- /package/dist/types/modules/checkout/components/{summary/checkout-completed.component.d.ts → checkout-completed.component.d.ts} +0 -0
- /package/dist/types/modules/checkout/components/{summary/checkout-gift-cards.component.d.ts → checkout-gift-cards.component.d.ts} +0 -0
- /package/dist/types/modules/checkout/components/{summary/checkout-item-quantity.component.d.ts → checkout-item-quantity.component.d.ts} +0 -0
- /package/dist/types/modules/checkout/components/{summary/checkout-item.component.d.ts → checkout-item.component.d.ts} +0 -0
- /package/dist/types/modules/checkout/components/{summary/checkout-items.component.d.ts → checkout-items.component.d.ts} +0 -0
- /package/dist/types/modules/checkout/components/{summary/checkout-presale-expired.component.d.ts → checkout-presale-expired.component.d.ts} +0 -0
- /package/dist/types/modules/checkout/components/{summary/checkout-promo-code.component.d.ts → checkout-promo-code.component.d.ts} +0 -0
- /package/dist/types/modules/checkout/components/{summary/checkout-tips.component.d.ts → checkout-tips.component.d.ts} +0 -0
- /package/dist/types/modules/checkout/components/{summary/promo-pc-gc.component.d.ts → promo-pc-gc.component.d.ts} +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export declare const ELEMENTS_ENV: {
|
|
2
|
-
readonly LOCAL: "local";
|
|
3
2
|
readonly DEVELOPMENT: "development";
|
|
4
3
|
readonly STAGING: "staging";
|
|
5
4
|
readonly PRODUCTION: "production";
|
|
@@ -7,6 +6,9 @@ export declare const ELEMENTS_ENV: {
|
|
|
7
6
|
export type ElementsEnv = (typeof ELEMENTS_ENV)[keyof typeof ELEMENTS_ENV];
|
|
8
7
|
export declare const ELEMENTS_ACTIONS_EVENT: {
|
|
9
8
|
readonly CLIENT_READY: "client_ready";
|
|
9
|
+
readonly ADDRESS_UPDATED: "address_updated";
|
|
10
|
+
readonly ADDRESS_CLEARED: "address_cleared";
|
|
11
|
+
readonly ADDRESS_FAILED: "address_failed";
|
|
10
12
|
readonly PRODUCT_LOADED: "product_loaded";
|
|
11
13
|
readonly PRODUCT_QUANTITY_INCREASE: "product_quantity_increase";
|
|
12
14
|
readonly PRODUCT_QUANTITY_DECREASE: "product_quantity_decrease";
|
|
@@ -30,9 +32,6 @@ export declare const ELEMENTS_ACTIONS_EVENT: {
|
|
|
30
32
|
readonly CART_PROMO_CODE_FAILED: "cart_promo_code_failed";
|
|
31
33
|
readonly CART_PRODUCT_ADD_SUCCESS: "cart_product_add_success";
|
|
32
34
|
readonly CART_PRODUCT_ADD_FAILED: "cart_product_add_failed";
|
|
33
|
-
readonly ADDRESS_UPDATED: "address_updated";
|
|
34
|
-
readonly ADDRESS_CLEARED: "address_cleared";
|
|
35
|
-
readonly ADDRESS_FAILED: "address_failed";
|
|
36
35
|
readonly CHECKOUT_LOADED: "checkout_loaded";
|
|
37
36
|
readonly CHECKOUT_OPENED: "checkout_opened";
|
|
38
37
|
readonly CHECKOUT_CLOSED: "checkout_closed";
|
|
@@ -41,8 +40,8 @@ export declare const ELEMENTS_ACTIONS_EVENT: {
|
|
|
41
40
|
readonly CHECKOUT_BILLING_SAME_AS_SHIPPING_TOGGLED: "checkout_billing_same_as_shipping_toggled";
|
|
42
41
|
readonly CHECKOUT_MARKETING_PREFERENCES_TOGGLED: "checkout_marketing_preferences_toggled";
|
|
43
42
|
readonly CHECKOUT_CUSTOMER_INFORMATION_UPDATED: "checkout_customer_information_updated";
|
|
44
|
-
readonly CHECKOUT_BILLING_INFORMATION_UPDATED: "checkout_billing_information_updated";
|
|
45
43
|
readonly CHECKOUT_GIFT_INFORMATION_UPDATED: "checkout_gift_information_updated";
|
|
44
|
+
readonly CHECKOUT_BILLING_INFORMATION_UPDATED: "checkout_billing_information_updated";
|
|
46
45
|
readonly CHECKOUT_ITEM_REMOVED: "checkout_item_removed";
|
|
47
46
|
readonly CHECKOUT_ITEM_QUANTITY_INCREASE: "checkout_item_quantity_increase";
|
|
48
47
|
readonly CHECKOUT_ITEM_QUANTITY_DECREASE: "checkout_item_quantity_decrease";
|
|
@@ -108,18 +107,22 @@ export declare const COMPONENT_TYPE: {
|
|
|
108
107
|
readonly CART_BODY: "cart-body";
|
|
109
108
|
readonly CART_FULFILLMENT: "cart-fulfillment";
|
|
110
109
|
readonly CHECKOUT: "checkout";
|
|
111
|
-
readonly
|
|
110
|
+
readonly CHECKOUT_INFORMATION: "checkout-information";
|
|
111
|
+
readonly CHECKOUT_STRIPE_HANDLER: "checkout-stripe-handler";
|
|
112
112
|
readonly CHECKOUT_STRIPE_FORM: "checkout-stripe-form";
|
|
113
|
-
readonly
|
|
114
|
-
readonly
|
|
115
|
-
readonly
|
|
113
|
+
readonly CHECKOUT_PAYMENT: "checkout-payment";
|
|
114
|
+
readonly CHECKOUT_PAYMENT_SUMMARY: "checkout-payment-summary";
|
|
115
|
+
readonly CHECKOUT_BILLING: "checkout-billing";
|
|
116
|
+
readonly CHECKOUT_ORDER_SUMMARY: "checkout-order-summary";
|
|
116
117
|
readonly CHECKOUT_PROMO_CODE: "checkout-promo-code";
|
|
117
118
|
readonly CHECKOUT_GIFT_CARDS: "checkout-gift-cards";
|
|
118
119
|
readonly CHECKOUT_AMOUNTS: "checkout-amounts";
|
|
119
120
|
readonly CHECKOUT_ITEMS: "checkout-items";
|
|
120
121
|
readonly CHECKOUT_COMPLETED: "checkout-completed";
|
|
121
|
-
readonly
|
|
122
|
-
readonly
|
|
122
|
+
readonly CHECKOUT_DELIVER_TO: "checkout-deliver-to";
|
|
123
|
+
readonly CHECKOUT_DELIVER_TO_SUMMARY: "checkout-deliver-to-summary";
|
|
124
|
+
readonly CHECKOUT_BUYER: "checkout-buyer";
|
|
125
|
+
readonly CHECKOUT_BUYER_SUMMARY: "checkout-buyer-summary";
|
|
123
126
|
readonly CHECKOUT_TIPS: "checkout-tips";
|
|
124
127
|
readonly CHECKOUT_PC_GC: "checkout-pc-gc";
|
|
125
128
|
readonly CHECKOUT_ITEM: "checkout-item";
|
|
@@ -128,6 +131,7 @@ export declare const COMPONENT_TYPE: {
|
|
|
128
131
|
readonly CHECKOUT_HEADER: "checkout-header";
|
|
129
132
|
readonly CHECKOUT_PRESALE_COUNTDOWN: "checkout-presale-countdown";
|
|
130
133
|
readonly CHECKOUT_PRESALE_EXPIRED: "checkout-presale-expired";
|
|
134
|
+
readonly CHECKOUT_SEND_AS_GIFT: "checkout-send-as-gift";
|
|
131
135
|
};
|
|
132
136
|
export type ComponentType = (typeof COMPONENT_TYPE)[keyof typeof COMPONENT_TYPE];
|
|
133
137
|
export declare const FULFILLMENT_TYPE: {
|
|
@@ -189,7 +189,7 @@ export interface ICheckoutPrepareResponse {
|
|
|
189
189
|
giftOptions: ICheckoutGiftOptions;
|
|
190
190
|
marketingPreferences: ICheckoutMarketingPreferences;
|
|
191
191
|
shippingAddress: IAddress;
|
|
192
|
-
billingAddress: ICheckoutBillingAddress
|
|
192
|
+
billingAddress: ICheckoutBillingAddress;
|
|
193
193
|
amounts: ICheckoutTotalAmounts;
|
|
194
194
|
items: ICheckoutItem[];
|
|
195
195
|
retailers: ICheckoutRetailer[];
|
|
@@ -17,7 +17,6 @@ export interface ICheckoutLayout {
|
|
|
17
17
|
thankYouButtonText: string;
|
|
18
18
|
drawerHeaderText: string;
|
|
19
19
|
placeOrderButtonText: string;
|
|
20
|
-
placeOrderButtonShowRequiredFields: boolean;
|
|
21
20
|
checkoutCompleted: ICheckoutCompleted;
|
|
22
21
|
}
|
|
23
22
|
export interface ICheckoutCompleted {
|
|
@@ -11,6 +11,11 @@ export interface IElementsProxyConfig {
|
|
|
11
11
|
baseUrl: string;
|
|
12
12
|
headers?: Record<string, string>;
|
|
13
13
|
}
|
|
14
|
+
export interface ILiquidCommerceElementsDevelopmentConfig {
|
|
15
|
+
customApiUrl?: string;
|
|
16
|
+
paymentMethodId?: string;
|
|
17
|
+
openShadowDom?: boolean;
|
|
18
|
+
}
|
|
14
19
|
export interface IClientCustomThemeConfig {
|
|
15
20
|
global?: UpdateComponentGlobalConfigs;
|
|
16
21
|
product?: UpdateProductComponent;
|
|
@@ -18,18 +23,17 @@ export interface IClientCustomThemeConfig {
|
|
|
18
23
|
cart?: UpdateCartComponent;
|
|
19
24
|
checkout?: UpdateCheckoutComponent;
|
|
20
25
|
}
|
|
21
|
-
export interface
|
|
26
|
+
export interface ILiquidCommerceElementsBaseConfig {
|
|
22
27
|
env?: ElementsEnv;
|
|
23
28
|
promoTicker?: IPromoTicker[];
|
|
24
29
|
customTheme?: IClientCustomThemeConfig;
|
|
25
30
|
debugMode?: DebugMode;
|
|
26
31
|
}
|
|
27
|
-
export interface
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
customTheme?: IClientCustomThemeConfig;
|
|
32
|
+
export interface ILiquidCommerceElementsBuilderConfig extends ILiquidCommerceElementsBaseConfig {
|
|
33
|
+
}
|
|
34
|
+
export interface ILiquidCommerceElementsConfig extends ILiquidCommerceElementsBaseConfig {
|
|
31
35
|
proxy?: IElementsProxyConfig;
|
|
32
|
-
|
|
36
|
+
development?: ILiquidCommerceElementsDevelopmentConfig;
|
|
33
37
|
}
|
|
34
38
|
export interface IInjectProductElement {
|
|
35
39
|
containerId: string;
|
|
@@ -66,7 +70,9 @@ export interface ILiquidCommerceElementsUIMethod {
|
|
|
66
70
|
cartButton(containerId: string, showItemsCount?: boolean): void;
|
|
67
71
|
floatingCartButton(showItemsCount?: boolean): void;
|
|
68
72
|
cartSubtotal(elementId: string): void;
|
|
69
|
-
cartItemsCount(elementId: string
|
|
73
|
+
cartItemsCount(elementId: string, options?: {
|
|
74
|
+
hideZero: boolean;
|
|
75
|
+
}): void;
|
|
70
76
|
}
|
|
71
77
|
export interface ILiquidCommerceElementsActions {
|
|
72
78
|
product: IProductActions;
|
|
@@ -17,7 +17,5 @@ export declare class CartRetailerComponent extends BaseComponent<ICartRetailerPa
|
|
|
17
17
|
onStoreChanged(changes: IOnStoreChanged[]): boolean | undefined;
|
|
18
18
|
afterRender(): void;
|
|
19
19
|
private setupSectionToggle;
|
|
20
|
-
protected beforeAutoDestroy(): void;
|
|
21
|
-
protected onAutoDestroy(): void;
|
|
22
20
|
protected template(): HTMLElement;
|
|
23
21
|
}
|
|
@@ -1,50 +1,53 @@
|
|
|
1
1
|
import { BaseCommand } from '@/core/command/base-command.service';
|
|
2
|
-
import type {
|
|
3
|
-
import type { ICart, ICheckoutFulfillment, ICheckoutItem, ICheckoutPrepareResponse, ICheckoutRetailer } from '@/interfaces/cloud';
|
|
4
|
-
import type { BillingFieldName, CustomerFieldName, GiftFieldName } from '@/modules/checkout/components/checkout.type';
|
|
5
|
-
export declare function buildCheckoutItemStore(apiItem: ICheckoutItem, retailer: ICheckoutRetailer, fulfillment: ICheckoutFulfillment): ICheckoutItemStore;
|
|
2
|
+
import type { ICheckoutBillingStore, ICheckoutCustomerStore, ICheckoutGiftRecipientStore, ICheckoutPaymentMethodStore } from '@/core/store/interfaces/checkout.interface';
|
|
6
3
|
export declare class CheckoutCommands extends BaseCommand {
|
|
7
4
|
private readonly uiCommands;
|
|
8
5
|
private readonly commonCommands;
|
|
9
6
|
constructor();
|
|
10
7
|
static getInstance(): CheckoutCommands;
|
|
11
8
|
loadCheckout(cartIdParam?: string): Promise<void>;
|
|
12
|
-
partialLoadCheckout(params?: {
|
|
13
|
-
cartId?: string;
|
|
14
|
-
response?: ICheckoutPrepareResponse;
|
|
15
|
-
cartResponse?: ICart;
|
|
16
|
-
}): Promise<void>;
|
|
17
9
|
toggleIsGift(active?: boolean): Promise<void>;
|
|
18
10
|
toggleBillingSameAsShipping(active?: boolean): Promise<void>;
|
|
19
|
-
toggleMarketingPreferences(fieldName: 'canEmail' | 'canSms', active?: boolean): void
|
|
11
|
+
toggleMarketingPreferences(fieldName: 'canEmail' | 'canSms', active?: boolean): Promise<void>;
|
|
20
12
|
getPaymentSession(): Promise<void>;
|
|
21
|
-
confirmPaymentSession(confirmationTokenId: string, setupIntentId: string): Promise<
|
|
13
|
+
confirmPaymentSession(confirmationTokenId: string, setupIntentId: string): Promise<ICheckoutPaymentMethodStore | null>;
|
|
22
14
|
applyPromoCode(code: string): Promise<void>;
|
|
23
|
-
clearPromoCodeError(): Promise<void>;
|
|
24
15
|
removePromoCode(): Promise<void>;
|
|
16
|
+
clearPromoCodeError(): Promise<void>;
|
|
25
17
|
applyGiftCard(code: string): Promise<void>;
|
|
26
|
-
clearGiftCardError(): Promise<void>;
|
|
27
18
|
removeGiftCard(code: string): Promise<void>;
|
|
28
|
-
|
|
29
|
-
updateBillingInfo(fieldName: BillingFieldName, fieldValue: string): void;
|
|
30
|
-
updateGiftInfo(fieldName: GiftFieldName, fieldValue: string): void;
|
|
31
|
-
private triggerAddShippingInfoEvent;
|
|
32
|
-
private validateAndUpdateFormStatus;
|
|
33
|
-
checkoutComplete(): Promise<void>;
|
|
34
|
-
startPreparingCheckoutSubmit(): Promise<void>;
|
|
19
|
+
clearGiftCardError(): Promise<void>;
|
|
35
20
|
openPresaleExpiredDrawer(): void;
|
|
36
21
|
rerenderCheckout(): void;
|
|
37
|
-
focusFirstInvalidField(): Promise<void>;
|
|
38
|
-
private buildItemUpdate;
|
|
39
22
|
updateCheckoutItemQuantity(itemId: string, delta: number): Promise<void>;
|
|
40
23
|
removeItemEngraving(productItemId: string): Promise<void>;
|
|
41
24
|
removeItem(itemId: string, isNotStandAlone?: boolean): Promise<void>;
|
|
42
25
|
updateTips(percentage: number): Promise<void>;
|
|
43
26
|
updateFulfillmentTip(fulfillmentId: string, tipAmount: number): Promise<void>;
|
|
44
27
|
removeFulfillmentTip(fulfillmentId: string): Promise<void>;
|
|
28
|
+
clearCheckoutError(): Promise<void>;
|
|
29
|
+
editCustomerForm(): Promise<void>;
|
|
30
|
+
saveCustomerForm({ shippingAddressTwo, deliveryInstructions, customerData, }: {
|
|
31
|
+
customerData: ICheckoutCustomerStore;
|
|
32
|
+
shippingAddressTwo: string;
|
|
33
|
+
deliveryInstructions: string;
|
|
34
|
+
}): Promise<void>;
|
|
35
|
+
editGiftRecipientForm(): Promise<void>;
|
|
36
|
+
saveGiftRecipientForm({ shippingAddressTwo, deliveryInstructions, ...giftRecipientData }: ICheckoutGiftRecipientStore & {
|
|
37
|
+
shippingAddressTwo: string;
|
|
38
|
+
deliveryInstructions: string;
|
|
39
|
+
}): Promise<void>;
|
|
40
|
+
editPaymentForm(): Promise<void>;
|
|
41
|
+
savePaymentForm({ billingFormData, paymentSession, }: {
|
|
42
|
+
billingFormData?: ICheckoutBillingStore;
|
|
43
|
+
paymentSession?: {
|
|
44
|
+
confirmationTokenId: string;
|
|
45
|
+
setupIntentId: string;
|
|
46
|
+
};
|
|
47
|
+
}): Promise<void>;
|
|
48
|
+
checkoutComplete(): Promise<void>;
|
|
45
49
|
private updateStoreFromCheckoutResponse;
|
|
46
|
-
|
|
47
|
-
removeCheckoutError(): Promise<void>;
|
|
48
|
-
updateDeliveryInstructions(instructions: string): Promise<void>;
|
|
50
|
+
private partialLoadCheckout;
|
|
49
51
|
private dataForCheckoutPrepare;
|
|
52
|
+
private buildCheckoutItemStore;
|
|
50
53
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { ICheckoutBillingStore } from '@/core/store/interfaces/checkout.interface';
|
|
3
|
+
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
4
|
+
export interface ICheckoutBillingComponentParams {
|
|
5
|
+
isFormValid: (isValid: boolean, data: ICheckoutBillingStore) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare class CheckoutBillingComponent extends BaseComponent<ICheckoutBillingComponentParams, ICheckoutComponent> {
|
|
8
|
+
private billingData;
|
|
9
|
+
get hostClasses(): string[];
|
|
10
|
+
constructor();
|
|
11
|
+
private billingSameAsShippingToggle;
|
|
12
|
+
private updateSaveButtonState;
|
|
13
|
+
protected template(): HTMLElement[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
+
export declare class CheckoutBuyerSummaryComponent extends BaseComponent<null, ICheckoutComponent> {
|
|
4
|
+
get hostClasses(): string[];
|
|
5
|
+
constructor();
|
|
6
|
+
protected template(): HTMLElement[];
|
|
7
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
2
2
|
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
export declare class CheckoutBuyer extends BaseComponent<null, ICheckoutComponent> {
|
|
4
|
+
private customerData;
|
|
5
|
+
private saveButtonText;
|
|
6
|
+
private saveButton;
|
|
7
7
|
get hostClasses(): string[];
|
|
8
8
|
constructor();
|
|
9
9
|
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
10
|
-
private
|
|
10
|
+
private updateSaveButtonState;
|
|
11
11
|
protected template(): HTMLElement[];
|
|
12
12
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
+
export declare class CheckoutDeliverToSummaryComponent extends BaseComponent<null, ICheckoutComponent> {
|
|
4
|
+
get hostClasses(): string[];
|
|
5
|
+
constructor();
|
|
6
|
+
protected template(): HTMLElement[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
2
|
+
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
+
export declare class CheckoutDeliverToComponent extends BaseComponent<null, ICheckoutComponent> {
|
|
4
|
+
private customerData;
|
|
5
|
+
private giftData;
|
|
6
|
+
private saveButtonText;
|
|
7
|
+
private saveButton;
|
|
8
|
+
get hostClasses(): string[];
|
|
9
|
+
constructor();
|
|
10
|
+
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
11
|
+
private updateSaveButtonState;
|
|
12
|
+
protected template(): HTMLElement[];
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
+
export interface ICheckoutInformationSectionComponentParams {
|
|
4
|
+
isIndependentComponent: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare class CheckoutInformationComponent extends BaseComponent<ICheckoutInformationSectionComponentParams, ICheckoutComponent> {
|
|
7
|
+
private deliveryToForm;
|
|
8
|
+
private deliverToSummary;
|
|
9
|
+
private buyerForm;
|
|
10
|
+
private buyerSummary;
|
|
11
|
+
private paymentForm;
|
|
12
|
+
private paymentSummary;
|
|
13
|
+
get hostClasses(): string[];
|
|
14
|
+
constructor();
|
|
15
|
+
onStoreWatch(): void;
|
|
16
|
+
protected template(): HTMLElement[];
|
|
17
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
2
2
|
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class CheckoutOrderSummaryComponent extends BaseComponent<null, ICheckoutComponent> {
|
|
4
4
|
get hostClasses(): string[];
|
|
5
5
|
constructor();
|
|
6
6
|
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
+
export declare class CheckoutPaymentSummaryComponent extends BaseComponent<null, ICheckoutComponent> {
|
|
4
|
+
get hostClasses(): string[];
|
|
5
|
+
constructor();
|
|
6
|
+
protected template(): HTMLElement[];
|
|
7
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
2
|
+
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
+
export interface ICheckoutSendToFormComponentParams {
|
|
4
|
+
isIndependentComponent: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare class CheckoutPaymentComponent extends BaseComponent<ICheckoutSendToFormComponentParams, ICheckoutComponent> {
|
|
7
|
+
private stripeHandlerElement;
|
|
8
|
+
private hardcodedPaymentElement;
|
|
9
|
+
private saveButton;
|
|
10
|
+
private errorMessageElement;
|
|
11
|
+
private billingFormData;
|
|
12
|
+
private isValidBillingForm;
|
|
13
|
+
private isBillingSameAsShipping;
|
|
14
|
+
private stripeFormStatus;
|
|
15
|
+
private savedCardInfo;
|
|
16
|
+
private showingStripeSummary;
|
|
17
|
+
private isSavingPayment;
|
|
18
|
+
get hostClasses(): string[];
|
|
19
|
+
constructor();
|
|
20
|
+
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
21
|
+
private handleBillingSameAsShippingChange;
|
|
22
|
+
afterRender(): Promise<void>;
|
|
23
|
+
private updateSaveButtonState;
|
|
24
|
+
private updateErrorMessage;
|
|
25
|
+
private showError;
|
|
26
|
+
protected template(): HTMLElement[];
|
|
27
|
+
private handleSaveButtonClick;
|
|
28
|
+
private validatePrerequisites;
|
|
29
|
+
disconnected(): void;
|
|
30
|
+
}
|
|
@@ -8,15 +8,11 @@ export declare class CheckoutPlaceOrderButtonComponent extends BaseComponent<nul
|
|
|
8
8
|
constructor();
|
|
9
9
|
afterRender(): void;
|
|
10
10
|
disconnected(): void;
|
|
11
|
-
|
|
11
|
+
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
12
12
|
private updateButtonState;
|
|
13
|
-
private determineErrorMessage;
|
|
14
13
|
private clearErrorTimeout;
|
|
15
14
|
private updateErrorDisplay;
|
|
16
15
|
private determineButtonState;
|
|
17
|
-
private applyButtonState;
|
|
18
16
|
private handlePlaceOrderClick;
|
|
19
|
-
private showPaymentError;
|
|
20
|
-
private handleCheckoutReadyForSubmit;
|
|
21
17
|
protected template(): HTMLElement[];
|
|
22
18
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
+
export declare class CheckoutSendAsGiftComponent extends BaseComponent<null, ICheckoutComponent> {
|
|
4
|
+
get hostClasses(): string[];
|
|
5
|
+
constructor();
|
|
6
|
+
protected template(): HTMLElement[];
|
|
7
|
+
}
|
|
@@ -17,9 +17,10 @@ export interface IStripeConfig {
|
|
|
17
17
|
elementOptions?: Record<string, any>;
|
|
18
18
|
}
|
|
19
19
|
export interface IStripeFormStatus {
|
|
20
|
-
|
|
21
|
-
hasError: boolean;
|
|
20
|
+
isFormComplete: boolean;
|
|
22
21
|
isProcessing: boolean;
|
|
22
|
+
hasCompletedPayment: boolean;
|
|
23
|
+
hasError: boolean;
|
|
23
24
|
errorMessage: string | null;
|
|
24
25
|
}
|
|
25
26
|
export declare class CheckoutStripeFormComponent extends HTMLElement {
|
|
@@ -31,6 +32,7 @@ export declare class CheckoutStripeFormComponent extends HTMLElement {
|
|
|
31
32
|
private _isFormComplete;
|
|
32
33
|
private _hasUsedCurrentSession;
|
|
33
34
|
private _stripeConfig;
|
|
35
|
+
private _sessionRefreshPromise;
|
|
34
36
|
initialize({ data }: {
|
|
35
37
|
data: {
|
|
36
38
|
stripeConfig: IStripeConfig;
|
|
@@ -38,11 +40,11 @@ export declare class CheckoutStripeFormComponent extends HTMLElement {
|
|
|
38
40
|
}): Promise<void>;
|
|
39
41
|
private initializeStripe;
|
|
40
42
|
private setupEventListeners;
|
|
41
|
-
private handleSubmitEvent;
|
|
42
43
|
private handleRefreshSession;
|
|
43
44
|
private handleSubmit;
|
|
44
45
|
private requestSessionRefresh;
|
|
45
46
|
private refreshPaymentSession;
|
|
47
|
+
private resetForm;
|
|
46
48
|
private updateStripeFormStatus;
|
|
47
49
|
private createConfirmationTokenId;
|
|
48
50
|
disconnected(): Promise<void>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
2
|
+
import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
3
|
+
import type { IStripeFormStatus } from '@/modules/checkout/components/checkout-stripe-form.component';
|
|
4
|
+
export interface ICheckoutStripeHandlerCallbacks {
|
|
5
|
+
onStripeFormStatusChanged?: (status: IStripeFormStatus) => void;
|
|
6
|
+
onSavedCardInfoChanged?: (cardInfo: {
|
|
7
|
+
brand?: string;
|
|
8
|
+
last4?: string;
|
|
9
|
+
} | null) => void;
|
|
10
|
+
onEditModeVisibilityChanged?: (showingSummary: boolean) => void;
|
|
11
|
+
onPaymentSessionConfirmed?: (confirmationTokenId: string, setupIntentId: string) => Promise<void>;
|
|
12
|
+
}
|
|
13
|
+
export interface ICheckoutStripeHandlerComponentParams {
|
|
14
|
+
isIndependentComponent: boolean;
|
|
15
|
+
callbacks?: ICheckoutStripeHandlerCallbacks;
|
|
16
|
+
}
|
|
17
|
+
export declare class CheckoutStripeHandlerComponent extends BaseComponent<ICheckoutStripeHandlerComponentParams, ICheckoutComponent> {
|
|
18
|
+
private stripeFormElement;
|
|
19
|
+
private rootComponent;
|
|
20
|
+
private isCreatingStripeForm;
|
|
21
|
+
private stripeFormContainer;
|
|
22
|
+
private stripeSummaryContainer;
|
|
23
|
+
private callbacks;
|
|
24
|
+
private stripeFormStatus;
|
|
25
|
+
private isInEditMode;
|
|
26
|
+
private savedCardInfo;
|
|
27
|
+
private isChangingPayment;
|
|
28
|
+
get hostClasses(): string[];
|
|
29
|
+
constructor();
|
|
30
|
+
beforeConnected(): void;
|
|
31
|
+
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
32
|
+
private handleSavedCardChange;
|
|
33
|
+
private handleEditModeChange;
|
|
34
|
+
private updateDisplayState;
|
|
35
|
+
afterRender(): Promise<void>;
|
|
36
|
+
private setupStripeFormEventListeners;
|
|
37
|
+
private showStripeSummary;
|
|
38
|
+
private hideStripeSummary;
|
|
39
|
+
private showStripeForm;
|
|
40
|
+
private hideStripeForm;
|
|
41
|
+
private handleChangePayment;
|
|
42
|
+
protected template(): HTMLElement[];
|
|
43
|
+
submitStripeForm(): void;
|
|
44
|
+
getStripeFormStatus(): IStripeFormStatus;
|
|
45
|
+
private findRootComponent;
|
|
46
|
+
private removeExistingStripeForm;
|
|
47
|
+
private doStripeConfig;
|
|
48
|
+
private createAndMountStripeForm;
|
|
49
|
+
disconnected(): void;
|
|
50
|
+
}
|
|
@@ -1,20 +1,25 @@
|
|
|
1
|
+
export * from './checkout-amounts.component';
|
|
2
|
+
export * from './checkout-billing.component';
|
|
3
|
+
export * from './checkout-buyer.component';
|
|
4
|
+
export * from './checkout-buyer-summary.component';
|
|
5
|
+
export * from './checkout-completed.component';
|
|
6
|
+
export * from './checkout-deliver-to.component';
|
|
7
|
+
export * from './checkout-deliver-to-summary.component';
|
|
8
|
+
export * from './checkout-gift-cards.component';
|
|
1
9
|
export * from './checkout-header.component';
|
|
2
|
-
export * from './checkout-information
|
|
10
|
+
export * from './checkout-information.component';
|
|
11
|
+
export * from './checkout-item.component';
|
|
12
|
+
export * from './checkout-item-quantity.component';
|
|
13
|
+
export * from './checkout-items.component';
|
|
14
|
+
export * from './checkout-order-summary.component';
|
|
15
|
+
export * from './checkout-payment.component';
|
|
16
|
+
export * from './checkout-payment-summary.component';
|
|
17
|
+
export * from './checkout-place-order-button.component';
|
|
3
18
|
export * from './checkout-presale-countdown.component';
|
|
4
|
-
export * from './checkout-
|
|
5
|
-
export * from './
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
8
|
-
export * from './
|
|
9
|
-
export * from './
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './summary/checkout-completed.component';
|
|
12
|
-
export * from './summary/checkout-gift-cards.component';
|
|
13
|
-
export * from './summary/checkout-item.component';
|
|
14
|
-
export * from './summary/checkout-item-quantity.component';
|
|
15
|
-
export * from './summary/checkout-items.component';
|
|
16
|
-
export * from './summary/checkout-place-order-button.component';
|
|
17
|
-
export * from './summary/checkout-presale-expired.component';
|
|
18
|
-
export * from './summary/checkout-promo-code.component';
|
|
19
|
-
export * from './summary/checkout-tips.component';
|
|
20
|
-
export * from './summary/promo-pc-gc.component';
|
|
19
|
+
export * from './checkout-presale-expired.component';
|
|
20
|
+
export * from './checkout-promo-code.component';
|
|
21
|
+
export * from './checkout-send-as-gift.component';
|
|
22
|
+
export * from './checkout-stripe-form.component';
|
|
23
|
+
export * from './checkout-stripe-handler.component';
|
|
24
|
+
export * from './checkout-tips.component';
|
|
25
|
+
export * from './promo-pc-gc.component';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IProductFulfillmentStore } from '@/core/store/interfaces/product.interface';
|
|
2
2
|
import { type FulfillmentType } from '@/enums';
|
|
3
3
|
import type { IProductSizeAttributes } from '@/interfaces/cloud';
|
|
4
|
-
import {
|
|
4
|
+
import type { RetailerStatus } from '@/modules/product/utils/retailer-hours';
|
|
5
5
|
export declare function renderPopupRetailerCard({ fulfillment, selectedFulfillmentType, isSelected, fulfillmentStatus, selectedSizeAttributes, }: {
|
|
6
6
|
fulfillment: IProductFulfillmentStore;
|
|
7
7
|
selectedFulfillmentType: FulfillmentType;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
1
|
import type { IProductFulfillmentStore } from '@/core/store/interfaces/product.interface';
|
|
2
2
|
import { type FulfillmentType } from '@/enums';
|
|
3
|
-
import type { IProductSize, IRetailer } from '@/interfaces/cloud';
|
|
4
|
-
export declare const filterRetailersByFulfillmentType: ({ retailers, selectedSize, engravingLines, fulfillmentType, }: {
|
|
5
|
-
retailers: IRetailer[];
|
|
6
|
-
selectedSize: IProductSize | null;
|
|
7
|
-
engravingLines: string[];
|
|
8
|
-
fulfillmentType: FulfillmentType;
|
|
9
|
-
}) => IRetailer[];
|
|
10
3
|
export declare function fulfillmentAddress(address: IProductFulfillmentStore['retailerAddress'], selectedFulfillmentType: FulfillmentType): string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseComponent
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
2
|
export interface IBirthdateValidation {
|
|
3
3
|
required?: boolean;
|
|
4
4
|
minYear?: number;
|
|
@@ -16,7 +16,6 @@ export interface IBirthdateInputComponentParams {
|
|
|
16
16
|
label?: string;
|
|
17
17
|
name: string;
|
|
18
18
|
disabled?: boolean;
|
|
19
|
-
storePath?: string;
|
|
20
19
|
}
|
|
21
20
|
export declare class BirthdateInputComponent extends BaseComponent<IBirthdateInputComponentParams, null> {
|
|
22
21
|
get hostClasses(): string[];
|
|
@@ -24,16 +23,19 @@ export declare class BirthdateInputComponent extends BaseComponent<IBirthdateInp
|
|
|
24
23
|
private dayInput;
|
|
25
24
|
private yearInput;
|
|
26
25
|
private errorContainer;
|
|
27
|
-
|
|
28
|
-
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
26
|
+
private validationTimeout;
|
|
29
27
|
afterRender(): void;
|
|
30
28
|
private populateInitialValue;
|
|
31
29
|
private setupEventListeners;
|
|
32
30
|
private formatMonth;
|
|
33
31
|
private formatDay;
|
|
34
32
|
private formatYear;
|
|
33
|
+
private padMonthOnBlur;
|
|
34
|
+
private padDayOnBlur;
|
|
35
35
|
private handleNavigation;
|
|
36
36
|
private handleChange;
|
|
37
|
+
private isFieldsComplete;
|
|
38
|
+
private scheduleValidation;
|
|
37
39
|
private getFormattedValue;
|
|
38
40
|
private validateDate;
|
|
39
41
|
private calculateAge;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseComponent
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
2
|
export interface IInputValidation {
|
|
3
3
|
required?: boolean;
|
|
4
4
|
min?: number;
|
|
@@ -19,21 +19,21 @@ export interface IInputComponentParams {
|
|
|
19
19
|
name: string;
|
|
20
20
|
autocomplete?: boolean;
|
|
21
21
|
disabled?: boolean;
|
|
22
|
-
storePath?: string;
|
|
23
22
|
}
|
|
24
23
|
export declare class InputComponent extends BaseComponent<IInputComponentParams, null> {
|
|
25
24
|
get hostClasses(): string[];
|
|
26
25
|
private inputElement;
|
|
27
26
|
private errorContainer;
|
|
28
|
-
|
|
29
|
-
onStoreChanged(changes: IOnStoreChanged[]): boolean;
|
|
27
|
+
private validationTimeout;
|
|
30
28
|
private handlePhoneKeydown;
|
|
31
29
|
private formatPhoneNumber;
|
|
32
30
|
private formatDate;
|
|
33
31
|
private validateEmail;
|
|
34
32
|
private validateTel;
|
|
35
33
|
private validateDate;
|
|
34
|
+
private isFieldComplete;
|
|
36
35
|
private validateInput;
|
|
36
|
+
private scheduleValidation;
|
|
37
37
|
private showErrors;
|
|
38
38
|
private clearErrors;
|
|
39
39
|
getValue(): string;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { IRetailerFulfillmentStore } from '@/core/store/interfaces/cart.interface';
|
|
2
|
-
export declare const shouldShowMinimumPurchaseAlert: (fulfillment: IRetailerFulfillmentStore, isPack?: boolean) => boolean;
|
|
3
|
-
export declare const getMinimumPurchaseMessage: (fulfillment: IRetailerFulfillmentStore, isPack?: boolean) => {
|
|
2
|
+
export declare const shouldShowMinimumPurchaseAlert: (fulfillment: IRetailerFulfillmentStore | undefined, isPack?: boolean) => boolean;
|
|
3
|
+
export declare const getMinimumPurchaseMessage: (fulfillment: IRetailerFulfillmentStore | undefined, isPack?: boolean) => {
|
|
4
4
|
message: string;
|
|
5
5
|
type: "warning" | "info";
|
|
6
6
|
};
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const hasUnmetMinimum: (fulfillment: IRetailerFulfillmentStore, isPack?: boolean) => boolean;
|
|
7
|
+
export declare const hasUnmetMinimum: (fulfillment: IRetailerFulfillmentStore | undefined, isPack?: boolean) => boolean;
|