@liquidcommerce/elements-sdk 2.6.7 → 2.7.0
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 +302 -71
- package/dist/index.checkout.esm.js +16034 -0
- package/dist/index.esm.js +14201 -12166
- package/dist/types/auto-initialize/checkout.d.ts +2 -0
- package/dist/types/auto-initialize/shared-utils.d.ts +22 -0
- package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +11 -1
- package/dist/types/clients/checkout.d.ts +13 -0
- package/dist/types/constants/core.constant.d.ts +9 -3
- package/dist/types/core/api/api-client.service.d.ts +0 -2
- package/dist/types/core/client/actions/base-action.service.d.ts +15 -0
- package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
- package/dist/types/core/client/actions/client-cart-action.service.d.ts +37 -0
- package/dist/types/core/client/actions/client-checkout-action.service.d.ts +50 -0
- package/dist/types/core/client/actions/client-product-action.service.d.ts +12 -0
- package/dist/types/core/client/client-action.service.d.ts +6 -73
- package/dist/types/core/client/client-config.service.d.ts +3 -4
- package/dist/types/core/store/interfaces/core.interface.d.ts +14 -1
- package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
- package/dist/types/core/store/interfaces/product-list.interface.d.ts +45 -0
- package/dist/types/core/store/interfaces/product.interface.d.ts +1 -0
- package/dist/types/core/store/store.constant.d.ts +4 -0
- package/dist/types/enums/core.enum.d.ts +3 -1
- package/dist/types/enums/index.d.ts +0 -1
- package/dist/types/index.checkout.d.ts +7 -0
- package/dist/types/index.checkout.umd.d.ts +4 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/interfaces/api/checkout.interface.d.ts +2 -1
- package/dist/types/interfaces/api/product-list.interface.d.ts +13 -5
- package/dist/types/interfaces/configs/checkout.interface.d.ts +1 -0
- package/dist/types/interfaces/configs/global.interface.d.ts +4 -2
- package/dist/types/interfaces/configs/index.d.ts +1 -0
- package/dist/types/interfaces/configs/product-list.interface.d.ts +28 -0
- package/dist/types/interfaces/core.interface.d.ts +28 -6
- package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +6 -2
- package/dist/types/modules/checkout/checkout.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
- package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product-list/components/card-components/index.d.ts +4 -0
- package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
- package/dist/types/modules/product-list/components/card-components/product-fulfillments.d.ts +10 -0
- package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +10 -0
- package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +9 -0
- package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +14 -0
- package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-price-filter.components.d.ts → filter-components/product-list-price-filter.d.ts} +1 -1
- package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +13 -0
- package/dist/types/modules/product-list/components/index.d.ts +6 -3
- package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +2 -1
- package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +6 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +58 -37
- package/dist/types/modules/product-list/components/product-list-retailers.component.d.ts +18 -0
- package/dist/types/modules/product-list/components/product-list-search.component.d.ts +22 -0
- package/dist/types/modules/product-list/product-list-card.component.d.ts +35 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +53 -3
- package/dist/types/modules/product-list/product-list.component.d.ts +16 -43
- package/dist/types/{enums/cloud.enum.d.ts → modules/product-list/product-list.constants.d.ts} +20 -1
- package/dist/types/modules/product-list/product-list.interface.d.ts +32 -24
- package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
- package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
- package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -1
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +4 -1
- package/dist/types/modules/ui-components/input/index.d.ts +0 -1
- package/dist/types/modules/ui-components/input/input.component.d.ts +8 -1
- package/dist/types/modules/ui-components/modal/modal.component.d.ts +23 -0
- package/dist/types/modules/ui-components/styles/modal.style.d.ts +1 -0
- package/dist/types/modules/ui-components/ui.commands.d.ts +3 -1
- package/dist/types/static/icon/check.icon.d.ts +2 -0
- package/dist/types/static/icon/index.d.ts +1 -0
- package/docs/ACTIONS.md +1 -0
- package/docs/CONFIGURATION.md +178 -34
- package/docs/DOCUMENTATION_INDEX.md +12 -4
- package/docs/THEMING.md +107 -18
- package/package.json +19 -12
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +0 -37
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +0 -16
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
- package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
- package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
- package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
- package/umd/elements.js +0 -1
- /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
- /package/dist/types/{elements-builder-client.d.ts → clients/builder.d.ts} +0 -0
- /package/dist/types/{elements-client-helper.d.ts → clients/helpers.d.ts} +0 -0
- /package/dist/types/{elements-client.d.ts → clients/main.d.ts} +0 -0
- /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
- /package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts → filter-components/product-list-checkbox-filter.d.ts} +0 -0
- /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DeepPartial } from '@/interfaces/core.interface';
|
|
2
|
+
export type ProductListCardStyle = 'card' | 'ghost';
|
|
3
|
+
export type ProductListCardCornerRadius = 'rounded' | 'sharp';
|
|
4
|
+
export interface IProductListTheme {
|
|
5
|
+
backgroundColor: string;
|
|
6
|
+
}
|
|
7
|
+
export type IDisplayMode = 'modal' | 'drawer';
|
|
8
|
+
export interface IProductListLayout {
|
|
9
|
+
productCard: {
|
|
10
|
+
style: ProductListCardStyle;
|
|
11
|
+
cornerRadius: ProductListCardCornerRadius;
|
|
12
|
+
showPrice: boolean;
|
|
13
|
+
showSizeSelector: boolean;
|
|
14
|
+
showFulfillment: boolean;
|
|
15
|
+
showRetailerName: boolean;
|
|
16
|
+
showQuantityCounter: boolean;
|
|
17
|
+
enableShippingFulfillment: boolean;
|
|
18
|
+
enableOnDemandFulfillment: boolean;
|
|
19
|
+
showCollections: boolean;
|
|
20
|
+
enablePersonalization: boolean;
|
|
21
|
+
};
|
|
22
|
+
displayMode: IDisplayMode;
|
|
23
|
+
}
|
|
24
|
+
export interface IProductListComponent {
|
|
25
|
+
theme: IProductListTheme;
|
|
26
|
+
layout: IProductListLayout;
|
|
27
|
+
}
|
|
28
|
+
export type UpdateProductListComponent = DeepPartial<IProductListComponent>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { IAddressActions
|
|
1
|
+
import type { PRODUCT_LIST_FILTER_TYPES } from '@/constants';
|
|
2
|
+
import type { IAddressActions } from '@/core/client/actions/client-address-action.service';
|
|
3
|
+
import type { ICartActions } from '@/core/client/actions/client-cart-action.service';
|
|
4
|
+
import type { ICheckoutActions } from '@/core/client/actions/client-checkout-action.service';
|
|
5
|
+
import type { IProductActions } from '@/core/client/actions/client-product-action.service';
|
|
3
6
|
import type { IClientConfigs } from '@/core/client/client-config.service';
|
|
4
7
|
import type { ComponentType, DebugMode, ElementsEnv } from '@/enums';
|
|
5
8
|
import type { IAddressOptions } from '@/modules/address/address.interface';
|
|
@@ -23,12 +26,15 @@ export interface IClientCustomThemeConfig {
|
|
|
23
26
|
cart?: UpdateCartComponent;
|
|
24
27
|
checkout?: UpdateCheckoutComponent;
|
|
25
28
|
}
|
|
29
|
+
export interface ILiquidCommerceElementsCheckoutConfig {
|
|
30
|
+
pageUrl: string;
|
|
31
|
+
}
|
|
26
32
|
export interface ILiquidCommerceElementsBaseConfig {
|
|
27
33
|
env?: ElementsEnv;
|
|
28
34
|
promoTicker?: IPromoTicker[];
|
|
29
35
|
customTheme?: IClientCustomThemeConfig;
|
|
30
36
|
debugMode?: DebugMode;
|
|
31
|
-
|
|
37
|
+
checkout?: ILiquidCommerceElementsCheckoutConfig;
|
|
32
38
|
}
|
|
33
39
|
export interface ILiquidCommerceElementsBuilderConfig extends ILiquidCommerceElementsBaseConfig {
|
|
34
40
|
}
|
|
@@ -36,21 +42,33 @@ export interface ILiquidCommerceElementsConfig extends ILiquidCommerceElementsBa
|
|
|
36
42
|
proxy?: IElementsProxyConfig;
|
|
37
43
|
development?: ILiquidCommerceElementsDevelopmentConfig;
|
|
38
44
|
}
|
|
45
|
+
export interface ILiquidCommerceElementsCheckoutClientConfig {
|
|
46
|
+
env?: ElementsEnv;
|
|
47
|
+
customTheme?: IClientCustomThemeConfig;
|
|
48
|
+
debugMode?: DebugMode;
|
|
49
|
+
checkout?: ILiquidCommerceElementsCheckoutConfig;
|
|
50
|
+
proxy?: IElementsProxyConfig;
|
|
51
|
+
development?: ILiquidCommerceElementsDevelopmentConfig;
|
|
52
|
+
}
|
|
39
53
|
export interface IInjectProductElement {
|
|
40
54
|
containerId: string;
|
|
41
55
|
identifier: string;
|
|
42
56
|
}
|
|
43
|
-
export type ProductListCardVariantType = (typeof PRODUCT_LIST_CARD_VARIANT)[keyof typeof PRODUCT_LIST_CARD_VARIANT];
|
|
44
57
|
export type ProductListFilterType = (typeof PRODUCT_LIST_FILTER_TYPES)[keyof typeof PRODUCT_LIST_FILTER_TYPES];
|
|
45
58
|
export interface IInjectProductListParams {
|
|
46
59
|
containerId: string;
|
|
47
60
|
rows?: number;
|
|
48
61
|
columns?: number;
|
|
49
|
-
cardVariant?: ProductListCardVariantType;
|
|
50
|
-
fillCard?: boolean;
|
|
51
62
|
filters?: ProductListFilterType[];
|
|
52
63
|
productUrl?: string;
|
|
53
64
|
}
|
|
65
|
+
export interface IInjectProductListSearchParams {
|
|
66
|
+
containerId: string;
|
|
67
|
+
}
|
|
68
|
+
export interface IInjectProductListFiltersParams {
|
|
69
|
+
containerId: string;
|
|
70
|
+
filters: ProductListFilterType[];
|
|
71
|
+
}
|
|
54
72
|
export interface IBuilderInjectElementParams {
|
|
55
73
|
type: ComponentType;
|
|
56
74
|
containerId: string;
|
|
@@ -67,10 +85,12 @@ export interface IProcessInjectElementParams {
|
|
|
67
85
|
identifier?: string;
|
|
68
86
|
options?: IAddressOptions;
|
|
69
87
|
checkoutId?: string;
|
|
88
|
+
hideHeader?: boolean;
|
|
70
89
|
}
|
|
71
90
|
export interface IInjectCheckoutParams {
|
|
72
91
|
containerId: string;
|
|
73
92
|
checkoutId?: string;
|
|
93
|
+
hideHeader?: boolean;
|
|
74
94
|
}
|
|
75
95
|
export interface ILiquidCommerceElementsUIMethod {
|
|
76
96
|
cartButton(containerId: string, showItemsCount?: boolean): void;
|
|
@@ -109,6 +129,8 @@ export interface ILiquidCommerceElementsClient {
|
|
|
109
129
|
injectCartElement(containerId: string): Promise<IInjectedComponent | null>;
|
|
110
130
|
injectCheckoutElement(params: IInjectCheckoutParams): Promise<IInjectedComponent | null>;
|
|
111
131
|
injectProductList(params: IInjectProductListParams): Promise<void>;
|
|
132
|
+
injectProductListSearch(params: IInjectProductListSearchParams): Promise<void>;
|
|
133
|
+
injectProductListFilters(params: IInjectProductListFiltersParams): Promise<void>;
|
|
112
134
|
ui: ILiquidCommerceElementsUIMethod;
|
|
113
135
|
actions: ILiquidCommerceElementsActions;
|
|
114
136
|
getInjectedComponents(): Map<string, IInjectedComponent>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -10,7 +10,8 @@ export declare class CheckoutCommands extends BaseCommand {
|
|
|
10
10
|
static getInstance(): CheckoutCommands;
|
|
11
11
|
addPresaleItem(params: AddItemParams): Promise<void>;
|
|
12
12
|
loadCheckout(params: {
|
|
13
|
-
|
|
13
|
+
checkoutId?: string;
|
|
14
|
+
cartId?: string;
|
|
14
15
|
isForPresale?: boolean;
|
|
15
16
|
}): Promise<void>;
|
|
16
17
|
toggleIsGift(active?: boolean): Promise<void>;
|
|
@@ -24,7 +25,10 @@ export declare class CheckoutCommands extends BaseCommand {
|
|
|
24
25
|
applyGiftCard(code: string): Promise<void>;
|
|
25
26
|
removeGiftCard(code: string): Promise<void>;
|
|
26
27
|
clearGiftCardError(): Promise<void>;
|
|
27
|
-
|
|
28
|
+
showPresaleExpired(reason?: PresaleExpiredReason): void;
|
|
29
|
+
openCheckout(): void;
|
|
30
|
+
getReturnUrl(): string | null;
|
|
31
|
+
private resolveCheckoutPageUrl;
|
|
28
32
|
rerenderCheckout(): void;
|
|
29
33
|
updateCheckoutItemQuantity(itemId: string, delta: number): Promise<void>;
|
|
30
34
|
removeItemEngraving(productItemId: string): Promise<void>;
|
|
@@ -3,8 +3,10 @@ import type { ICheckoutComponent } from '@/interfaces/configs';
|
|
|
3
3
|
export interface ICheckoutComponentParams {
|
|
4
4
|
checkoutId: string;
|
|
5
5
|
isIndependentComponent: boolean;
|
|
6
|
+
hideHeader: boolean;
|
|
6
7
|
}
|
|
7
8
|
export declare class CheckoutComponent extends BaseComponent<ICheckoutComponentParams, ICheckoutComponent> {
|
|
8
9
|
constructor();
|
|
9
10
|
protected template(): HTMLElement[];
|
|
11
|
+
private createHeader;
|
|
10
12
|
}
|
|
@@ -6,6 +6,8 @@ export interface ICheckoutCompletedComponentParams {
|
|
|
6
6
|
cardLast4: string;
|
|
7
7
|
customerEmail: string;
|
|
8
8
|
giftRecipientEmail: string | null;
|
|
9
|
+
checkoutToken?: string;
|
|
10
|
+
cartId?: string;
|
|
9
11
|
}
|
|
10
12
|
export declare class CheckoutCompletedComponent extends BaseComponent<ICheckoutCompletedComponentParams, ICheckoutComponent> {
|
|
11
13
|
get hostClasses(): string[];
|
|
@@ -2,6 +2,7 @@ import { BaseComponent } from '@/core/base-component.service';
|
|
|
2
2
|
export interface ICheckoutHeaderParams {
|
|
3
3
|
onClose?: () => void;
|
|
4
4
|
onBackToCart?: () => void;
|
|
5
|
+
isHostedCheckout?: boolean;
|
|
5
6
|
}
|
|
6
7
|
export declare class CheckoutHeaderComponent extends BaseComponent<ICheckoutHeaderParams> {
|
|
7
8
|
get hostClasses(): string[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ProductListCardCornerRadius } from 'interfaces/configs';
|
|
2
|
+
export interface IAddToCartButtonParams {
|
|
3
|
+
isPresale: boolean;
|
|
4
|
+
hasAvailability: boolean;
|
|
5
|
+
state: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
borderRadius: ProductListCardCornerRadius;
|
|
8
|
+
hasAddress: boolean;
|
|
9
|
+
onClick?: (e: MouseEvent) => void | Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare const createAddToCartButton: ({ isPresale, hasAvailability, state, disabled, borderRadius, hasAddress, onClick, }: IAddToCartButtonParams) => HTMLElement;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IProductFulfillmentStore } from 'core/store/interfaces/product.interface';
|
|
2
|
+
export interface IFulfillmentSectionParams {
|
|
3
|
+
shippingVariants: Record<string, IProductFulfillmentStore>;
|
|
4
|
+
onDemandVariants: Record<string, IProductFulfillmentStore>;
|
|
5
|
+
enableShippingFulfillment: boolean;
|
|
6
|
+
enableOnDemandFulfillment: boolean;
|
|
7
|
+
productId: string;
|
|
8
|
+
onDeliveryOptionsClick: (productId: string) => void | Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare const createFulfillmentSection: (params: IFulfillmentSectionParams) => HTMLElement;
|
package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ProductListCardCornerRadius, ProductListCardStyle } from 'interfaces/configs';
|
|
2
|
+
export interface IQuantitySelectorParams {
|
|
3
|
+
initialQuantity: number;
|
|
4
|
+
minQuantity: number;
|
|
5
|
+
maxQuantity: number;
|
|
6
|
+
cornerRadius: ProductListCardCornerRadius;
|
|
7
|
+
cardStyle: ProductListCardStyle;
|
|
8
|
+
onChange: (quantity: number) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const createQuantitySelector: ({ initialQuantity, minQuantity, maxQuantity, cornerRadius, cardStyle, onChange, }: IQuantitySelectorParams) => HTMLElement;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IProductSizeStore } from 'core/store/interfaces/product.interface';
|
|
2
|
+
import type { ProductListCardCornerRadius } from 'interfaces/configs';
|
|
3
|
+
export interface ISizeSelectorParams {
|
|
4
|
+
sizes: Record<string, IProductSizeStore>;
|
|
5
|
+
selectedSize: IProductSizeStore;
|
|
6
|
+
cornerRadius: ProductListCardCornerRadius;
|
|
7
|
+
onSelect?: (size: IProductSizeStore) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const createProductSizesList: ({ sizes, selectedSize, cornerRadius, onSelect }: ISizeSelectorParams) => HTMLElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './product-list-apply-filter-button';
|
|
2
|
+
export * from './product-list-checkbox-filter';
|
|
3
|
+
export * from './product-list-chip';
|
|
4
|
+
export * from './product-list-filters-chips';
|
|
5
|
+
export * from './product-list-fulfillment-filter';
|
|
6
|
+
export * from './product-list-price-filter';
|
|
7
|
+
export * from './product-list-toggle-filters';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createApplyFiltersButton(onApplyFilters: VoidFunction): HTMLElement;
|
package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IExtendedFilterSchema, IProductListFilters } from 'modules/product-list/product-list.interface';
|
|
2
|
+
export interface ICreateChipsContainerParams {
|
|
3
|
+
currentFilters?: IProductListFilters;
|
|
4
|
+
sanitizedFilters?: IExtendedFilterSchema[];
|
|
5
|
+
onRemoveFilter: (key: string, value: string) => void;
|
|
6
|
+
onClearAllFilters: VoidFunction;
|
|
7
|
+
}
|
|
8
|
+
export interface IActiveFilter {
|
|
9
|
+
key: string;
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function createChipsContainer(params: ICreateChipsContainerParams): HTMLElement;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { FULFILLMENT_OPTIONS } from 'modules/product-list/product-list.constants';
|
|
2
|
+
import type { IProductListFilters } from 'modules/product-list/product-list.interface';
|
|
3
|
+
export interface ICreateFulfillmentFilterParams {
|
|
4
|
+
currentFilters?: IProductListFilters;
|
|
5
|
+
deliveryCollapsed: boolean;
|
|
6
|
+
isSameDayDeliveryDisabled: boolean;
|
|
7
|
+
onFulfillmentOptionsChange?: (value: typeof FULFILLMENT_OPTIONS.ALL | typeof FULFILLMENT_OPTIONS.SHIPPING | typeof FULFILLMENT_OPTIONS.ON_DEMAND) => void;
|
|
8
|
+
onToggleCollapse: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function createFulfillmentFilter(params: ICreateFulfillmentFilterParams): {
|
|
11
|
+
elements: HTMLElement[];
|
|
12
|
+
chevronContainer: HTMLElement;
|
|
13
|
+
fulfillmentList: HTMLElement;
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IProductListFilters } from 'modules/product-list/product-list.interface';
|
|
2
|
+
export interface ICreateEngravingFilterParams {
|
|
3
|
+
currentFilters?: IProductListFilters;
|
|
4
|
+
isPersonalizationDisabled: boolean;
|
|
5
|
+
onEngravingChange?: (enabled: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
export interface ICreatePresaleFilterParams {
|
|
8
|
+
currentFilters?: IProductListFilters;
|
|
9
|
+
isPresaleDisabled: boolean;
|
|
10
|
+
onPresaleChange?: (enabled: boolean) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function createEngravingFilter(params: ICreateEngravingFilterParams): HTMLElement[];
|
|
13
|
+
export declare function createPresaleFilter(params: ICreatePresaleFilterParams): HTMLElement[];
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
export * from '
|
|
1
|
+
export * from '../product-list-card.component';
|
|
2
|
+
export * from './filter-components';
|
|
3
|
+
export * from './filter-components/product-list-apply-filter-button';
|
|
2
4
|
export * from './product-list-card-loading.component';
|
|
5
|
+
export * from './product-list-engraving.component';
|
|
3
6
|
export * from './product-list-filters.component';
|
|
4
|
-
export * from './product-list-
|
|
5
|
-
export * from './product-list-
|
|
7
|
+
export * from './product-list-retailers.component';
|
|
8
|
+
export * from './product-list-search.component';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { IProductListComponent } from 'interfaces/configs';
|
|
1
2
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
3
|
import type { IProductListComponentParams } from '@/modules/product-list/product-list.component';
|
|
3
|
-
export declare class ProductListCardLoadingComponent extends BaseComponent<IProductListComponentParams> {
|
|
4
|
+
export declare class ProductListCardLoadingComponent extends BaseComponent<IProductListComponentParams, IProductListComponent> {
|
|
4
5
|
get hostClasses(): string[];
|
|
5
6
|
private createSkeletonCard;
|
|
6
7
|
protected template(): HTMLElement[];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BaseComponent } from 'core/base-component.service';
|
|
2
|
+
import type { IEngravingFormComponentParams } from 'modules/ui-components/engraving';
|
|
3
|
+
export declare class ProductListEngravingComponent extends BaseComponent<IEngravingFormComponentParams> {
|
|
4
|
+
protected template(): HTMLElement;
|
|
5
|
+
private createHeader;
|
|
6
|
+
}
|
|
@@ -1,43 +1,64 @@
|
|
|
1
|
-
import { BaseComponent } from '
|
|
2
|
-
import type {
|
|
1
|
+
import { BaseComponent } from 'core/base-component.service';
|
|
2
|
+
import type { ProductListFilterType } from 'interfaces/core.interface';
|
|
3
3
|
export interface IProductListFiltersParams {
|
|
4
|
-
|
|
5
|
-
enablePreOrder: boolean;
|
|
6
|
-
enableDeliveryOptions: boolean;
|
|
7
|
-
sanitizedFilters?: IExtendedFilterSchema[];
|
|
8
|
-
currentFilters?: ICurrentFilters;
|
|
9
|
-
priceConfig?: IPriceConfig;
|
|
10
|
-
isDrawerMode?: boolean;
|
|
11
|
-
onPersonalizedChange?: (enabled: boolean) => void;
|
|
12
|
-
onPreOrderChange?: (enabled: boolean) => void;
|
|
13
|
-
onDeliveryOptionsChange?: (value: 'all' | 'shipping' | 'onDemand') => void;
|
|
14
|
-
onPriceChange?: (min: string, max: string) => void;
|
|
15
|
-
onCheckboxFilterChange?: (category: string, selectedValues: string[]) => void;
|
|
16
|
-
onApplyFilters?: () => void;
|
|
4
|
+
filters: ProductListFilterType[];
|
|
17
5
|
}
|
|
18
6
|
export declare class ProductListFiltersComponent extends BaseComponent<IProductListFiltersParams> {
|
|
19
|
-
private
|
|
20
|
-
private
|
|
21
|
-
private
|
|
22
|
-
private
|
|
23
|
-
private
|
|
24
|
-
private
|
|
25
|
-
private
|
|
26
|
-
private
|
|
27
|
-
private
|
|
7
|
+
private readonly DEFAULT_MIN_PRICE;
|
|
8
|
+
private readonly DEFAULT_MAX_PRICE;
|
|
9
|
+
private readonly FILTER_DEBOUNCE_DELAY_MS;
|
|
10
|
+
private isRenderedInDrawerMode;
|
|
11
|
+
private permanentFilters;
|
|
12
|
+
private availableDynamicFilters;
|
|
13
|
+
private checkboxFilterStateMap;
|
|
14
|
+
private isPriceFilterCollapsed;
|
|
15
|
+
private isFulfillmentFilterCollapsed;
|
|
16
|
+
private appliedFiltersChipsContainer;
|
|
17
|
+
private engravingFiltersContainer?;
|
|
18
|
+
private presaleFilterContainer?;
|
|
19
|
+
private fulfillmentFilterContainer?;
|
|
20
|
+
private priceFiltersContainer?;
|
|
21
|
+
private dynamicFiltersContainer?;
|
|
22
|
+
private filterButtonContainer?;
|
|
23
|
+
private fulfillmentOptionsList?;
|
|
24
|
+
private priceFilterChevronIcon?;
|
|
25
|
+
private fulfillmentFilterChevronIcon?;
|
|
26
|
+
private priceSliderWrapper?;
|
|
27
|
+
private resizeHandler;
|
|
28
|
+
private priceFilterDebounceTimer;
|
|
29
|
+
constructor();
|
|
28
30
|
get hostClasses(): string[];
|
|
29
|
-
|
|
30
|
-
private
|
|
31
|
-
private
|
|
32
|
-
private
|
|
33
|
-
|
|
34
|
-
private
|
|
35
|
-
private
|
|
36
|
-
private
|
|
37
|
-
private
|
|
38
|
-
private
|
|
39
|
-
private renderCheckboxItemsWrapper;
|
|
40
|
-
private handleCheckboxChange;
|
|
41
|
-
private toggleCheckboxFilter;
|
|
31
|
+
protected connected(): Promise<void>;
|
|
32
|
+
private setupDrawerCloseListener;
|
|
33
|
+
private setupResizeListener;
|
|
34
|
+
private detectIfRenderedInDrawer;
|
|
35
|
+
onStoreWatch(): void;
|
|
36
|
+
private syncFiltersFromStore;
|
|
37
|
+
private refreshUIStates;
|
|
38
|
+
private transformFilterValue;
|
|
39
|
+
private fetchFilters;
|
|
40
|
+
private applyFiltersAndCloseDrawer;
|
|
42
41
|
protected template(): HTMLElement[];
|
|
42
|
+
private buildFilterButton;
|
|
43
|
+
private openFilterDrawer;
|
|
44
|
+
private buildFilterHeader;
|
|
45
|
+
private clearAllActiveFilters;
|
|
46
|
+
private removeSingleFilter;
|
|
47
|
+
private getFilteredAndSanitizedFilters;
|
|
48
|
+
private buildAppliedFiltersChipsContainer;
|
|
49
|
+
private handleFilterChange;
|
|
50
|
+
private isEngravingCurrentlyDisabled;
|
|
51
|
+
private buildEngravingFilterElements;
|
|
52
|
+
private buildPresaleFilterElements;
|
|
53
|
+
private isSameDayDeliveryCurrentlyDisabled;
|
|
54
|
+
private toggleFulfillmentFilterCollapse;
|
|
55
|
+
private buildFulfillmentFilterElements;
|
|
56
|
+
private togglePriceFilterCollapse;
|
|
57
|
+
private buildPriceFilterElements;
|
|
58
|
+
private buildDynamicFiltersElements;
|
|
59
|
+
private getFilterElements;
|
|
60
|
+
private buildCheckboxFilterElements;
|
|
61
|
+
private toggleCheckboxFilterExpansion;
|
|
62
|
+
private renderCheckboxItemsForFilter;
|
|
63
|
+
private handleCheckboxSelectionChange;
|
|
43
64
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IDisplayMode, IProductListComponent } from 'interfaces/configs';
|
|
2
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
3
|
+
export interface IProductListRetailersParams {
|
|
4
|
+
productId: string;
|
|
5
|
+
config?: IProductListComponent;
|
|
6
|
+
displayMode?: IDisplayMode;
|
|
7
|
+
}
|
|
8
|
+
export declare class ProductListRetailersComponent extends BaseComponent<IProductListRetailersParams, IProductListComponent> {
|
|
9
|
+
get hostClasses(): string[];
|
|
10
|
+
constructor();
|
|
11
|
+
private getProductId;
|
|
12
|
+
protected template(): HTMLElement[];
|
|
13
|
+
private extractFulfillments;
|
|
14
|
+
private onFulfillmentTabClick;
|
|
15
|
+
private onRetailerCardClick;
|
|
16
|
+
private createHeader;
|
|
17
|
+
private createNoAvailabilityMessage;
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
export declare class ProductListSearchComponent extends BaseComponent {
|
|
3
|
+
private searchInput?;
|
|
4
|
+
private clearButton?;
|
|
5
|
+
private debounceTimer;
|
|
6
|
+
private currentSearchTerm;
|
|
7
|
+
private readonly ALLOWED_CHARACTERS;
|
|
8
|
+
private readonly MAX_LENGTH;
|
|
9
|
+
private readonly DEFAULT_DEBOUNCE_MS;
|
|
10
|
+
get hostClasses(): string[];
|
|
11
|
+
disconnectedCallback(): void;
|
|
12
|
+
getCurrentSearchTerm(): string;
|
|
13
|
+
private fetchProducts;
|
|
14
|
+
private buildCurrentFiltersFromState;
|
|
15
|
+
protected template(): HTMLElement[];
|
|
16
|
+
private handleDebouncedSearch;
|
|
17
|
+
private handleClearSearch;
|
|
18
|
+
private cleanInput;
|
|
19
|
+
private normalizeForSearch;
|
|
20
|
+
private updateClearButtonVisibility;
|
|
21
|
+
private cleanupDebounceTimer;
|
|
22
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { IProductListProduct } from 'core/store/interfaces/product-list.interface';
|
|
2
|
+
import type { IProductListComponent } from 'interfaces/configs';
|
|
3
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
4
|
+
import type { IFulfillment } from '@/interfaces/api/product.interface';
|
|
5
|
+
export interface IProductListCardParams {
|
|
6
|
+
product: IProductListProduct;
|
|
7
|
+
shippingFulfillment: IFulfillment | null;
|
|
8
|
+
onDemandFulfillment: IFulfillment | null;
|
|
9
|
+
productUrl?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class ProductListCardComponent extends BaseComponent<IProductListCardParams, IProductListComponent> {
|
|
12
|
+
private selectedSize;
|
|
13
|
+
private unsubscribeFromState?;
|
|
14
|
+
constructor();
|
|
15
|
+
get hostClasses(): string[];
|
|
16
|
+
protected connected(): Promise<void>;
|
|
17
|
+
disconnected(): void;
|
|
18
|
+
private reRender;
|
|
19
|
+
private getAvailabilityData;
|
|
20
|
+
private isPresaleActive;
|
|
21
|
+
private handleAddToCart;
|
|
22
|
+
protected template(): HTMLElement[];
|
|
23
|
+
private generateProductUrl;
|
|
24
|
+
private createVariantStandard;
|
|
25
|
+
private createImageSection;
|
|
26
|
+
private createContentSection;
|
|
27
|
+
private createBadgesSection;
|
|
28
|
+
private createTitleSection;
|
|
29
|
+
private createPricePersonalizationSection;
|
|
30
|
+
private createSizesSection;
|
|
31
|
+
private handleDeliveryOptionsClick;
|
|
32
|
+
private createFulfillmentSectionWrapper;
|
|
33
|
+
createFulfillmentTextSection(selectedFulfillmentType: string, selectedFulfillmentRetailerName: string): HTMLElement;
|
|
34
|
+
private createAddToCartSection;
|
|
35
|
+
}
|
|
@@ -1,17 +1,67 @@
|
|
|
1
|
+
import type { IModalContentConfig } from 'core/store/interfaces/core.interface';
|
|
2
|
+
import type { IProductListProduct, IProductListStore } from 'core/store/interfaces/product-list.interface';
|
|
1
3
|
import { BaseCommand } from '@/core/command/base-command.service';
|
|
2
|
-
import type
|
|
3
|
-
import type {
|
|
4
|
+
import { type FulfillmentType } from '@/enums';
|
|
5
|
+
import type { IProduct, IRetailer } from '@/interfaces/api/product.interface';
|
|
6
|
+
import type { IFilterSchema, INavigationResponse, IProductSearchParams, IProductSearchResponse } from '@/interfaces/api/product-list.interface';
|
|
7
|
+
import type { ProductListFilterType } from '@/interfaces/core.interface';
|
|
4
8
|
import { type AddItemParams } from '@/modules/cart/cart.commands';
|
|
9
|
+
import type { IExtendedFilterSchema, IPagination, IProductListFilters } from './product-list.interface';
|
|
10
|
+
type StateListener = (state: IProductListStore) => void;
|
|
5
11
|
export declare class ProductListCommands extends BaseCommand {
|
|
6
12
|
private readonly uiCommands;
|
|
7
13
|
private readonly cartCommands;
|
|
8
14
|
private readonly checkoutCommands;
|
|
15
|
+
private readonly FILTER_TYPE_MAP;
|
|
16
|
+
private listeners;
|
|
9
17
|
constructor();
|
|
10
18
|
static getInstance(): ProductListCommands;
|
|
19
|
+
subscribe(listener: StateListener): () => void;
|
|
20
|
+
private getStoreState;
|
|
21
|
+
updateSearchTerm(searchTerm: string): void;
|
|
22
|
+
setLoading(isLoading: boolean): void;
|
|
23
|
+
private notifyListeners;
|
|
24
|
+
private initializeProductFulfillment;
|
|
25
|
+
private transformProductVariantsToFulfillments;
|
|
26
|
+
private transformSingleProduct;
|
|
27
|
+
private transformProductSize;
|
|
28
|
+
private addShippingFulfillments;
|
|
29
|
+
private addOnDemandFulfillments;
|
|
30
|
+
loadInitialProducts(page: number, perPage: number, searchTerm: string, currentFilters: IProductListFilters, configuredFilters: ProductListFilterType[]): Promise<void>;
|
|
31
|
+
loadMoreProducts(perPage: number, searchTerm: string, currentFilters: IProductListFilters, configuredFilters: ProductListFilterType[]): Promise<void>;
|
|
11
32
|
getProductList(params: IProductSearchParams): Promise<IProductSearchResponse>;
|
|
33
|
+
syncFiltersFromComponent(filters: IProductListFilters): void;
|
|
34
|
+
getSanitizedFilters(filters: IFilterSchema[], configuredFilters: ProductListFilterType[]): IExtendedFilterSchema[];
|
|
35
|
+
buildSearchParams(page: number, perPage: number, searchTerm: string, currentFilters: IProductListFilters, configuredFilters: ProductListFilterType[]): IProductSearchParams;
|
|
36
|
+
private buildFilters;
|
|
37
|
+
private addToggleFilters;
|
|
38
|
+
private getBooleanFilterValue;
|
|
39
|
+
private addEngravingFilter;
|
|
40
|
+
private addPresaleFilter;
|
|
41
|
+
private addFulfillmentFilter;
|
|
42
|
+
private addPriceFilter;
|
|
43
|
+
private addDynamicFilters;
|
|
44
|
+
setGridConfig(rows: number, columns: number): void;
|
|
45
|
+
getItemsPerPage(): number;
|
|
46
|
+
updatePagination(navigation: INavigationResponse | undefined): IPagination;
|
|
47
|
+
createInitialPagination(): IPagination;
|
|
48
|
+
mergeRetailers(existingRetailers: Record<string, IRetailer>, newRetailers: Record<string, IRetailer>): Record<string, IRetailer>;
|
|
49
|
+
extractProductCardData(product: IProductListProduct, retailers: Record<string, IRetailer>): {
|
|
50
|
+
product: IProductListProduct;
|
|
51
|
+
retailer: IRetailer;
|
|
52
|
+
} | null;
|
|
53
|
+
private getFilterKeyToTypeMap;
|
|
12
54
|
addToCart(params: AddItemParams): Promise<void>;
|
|
13
55
|
addPresaleToCart(params: AddItemParams): Promise<void>;
|
|
14
56
|
trackViewItemList(products: IProduct[]): void;
|
|
15
|
-
trackSelectItem(product:
|
|
57
|
+
trackSelectItem(product: IProductListProduct): void;
|
|
16
58
|
private convertProductToBaseItem;
|
|
59
|
+
openProductListModal(productId: string, contentType: IModalContentConfig['type'], data?: Record<string, any>): void;
|
|
60
|
+
closeProductListModal(productId: string): void;
|
|
61
|
+
selectFulfillmentType: (productId: string, selectedFulfillmentType: FulfillmentType) => Promise<void>;
|
|
62
|
+
selectFulfillment: (productId: string, fulfillmentId: string) => Promise<void>;
|
|
63
|
+
selectSize: (productId: string, sizeId: string) => Promise<void>;
|
|
64
|
+
private getFulfillmentForSize;
|
|
65
|
+
updateQuantity: (productId: string, quantity: number) => void;
|
|
17
66
|
}
|
|
67
|
+
export {};
|