@liquidcommerce/elements-sdk 2.6.7 → 2.7.1
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 +83 -2519
- package/dist/index.checkout.esm.js +16086 -0
- package/dist/index.esm.js +16267 -13788
- package/dist/types/auto-initialize/checkout.d.ts +2 -0
- package/dist/types/auto-initialize/shared-utils.d.ts +27 -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 +5 -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/pubsub/interfaces/checkout.interface.d.ts +1 -0
- 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 +14 -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/address-input.component.d.ts +11 -0
- 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 +7 -0
- package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +8 -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 +12 -0
- package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +13 -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/card-components/product-title.d.ts +6 -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 +7 -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 +10 -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-product-pre-cart.component.d.ts +28 -0
- package/dist/types/modules/product-list/components/product-list-retailers.component.d.ts +26 -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 +30 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +62 -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 +33 -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 +13 -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/gitbook/actions.md +160 -0
- package/docs/gitbook/address.md +48 -0
- package/docs/gitbook/cart.md +65 -0
- package/docs/gitbook/checkout.md +131 -0
- package/docs/gitbook/events.md +137 -0
- package/docs/gitbook/overview.md +166 -0
- package/docs/gitbook/product.md +64 -0
- package/docs/gitbook/quick-start-guide.md +393 -0
- package/docs/v1/README.md +210 -0
- package/docs/v1/api/actions/address-actions.md +281 -0
- package/docs/v1/api/actions/cart-actions.md +337 -0
- package/docs/v1/api/actions/checkout-actions.md +387 -0
- package/docs/v1/api/actions/product-actions.md +115 -0
- package/docs/v1/api/client.md +482 -0
- package/docs/v1/api/configuration.md +1 -0
- package/docs/v1/api/injection-methods.md +247 -0
- package/docs/v1/api/typescript-types.md +1 -0
- package/docs/v1/api/ui-helpers.md +200 -0
- package/docs/v1/examples/advanced-patterns.md +96 -0
- package/docs/v1/examples/checkout-flow.md +91 -0
- package/docs/v1/examples/custom-theming.md +63 -0
- package/docs/v1/examples/multi-product-page.md +90 -0
- package/docs/v1/examples/simple-product-page.md +89 -0
- package/docs/v1/getting-started/concepts.md +507 -0
- package/docs/v1/getting-started/installation.md +328 -0
- package/docs/v1/getting-started/quick-start.md +405 -0
- package/docs/v1/guides/address-component.md +431 -0
- package/docs/v1/guides/best-practices.md +324 -0
- package/docs/v1/guides/cart-component.md +737 -0
- package/docs/v1/guides/checkout-component.md +672 -0
- package/docs/v1/guides/events.md +191 -0
- package/docs/v1/guides/product-component.md +686 -0
- package/docs/v1/guides/product-list-component.md +598 -0
- package/docs/v1/guides/theming.md +216 -0
- package/docs/v1/integration/angular.md +39 -0
- package/docs/v1/integration/laravel.md +41 -0
- package/docs/v1/integration/nextjs.md +60 -0
- package/docs/v1/integration/proxy-setup.md +89 -0
- package/docs/v1/integration/react.md +64 -0
- package/docs/v1/integration/vanilla-js.md +84 -0
- package/docs/v1/integration/vue.md +34 -0
- package/docs/v1/reference/browser-support.md +35 -0
- package/docs/v1/reference/error-handling.md +70 -0
- package/docs/v1/reference/performance.md +54 -0
- package/docs/v1/reference/troubleshooting.md +64 -0
- 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/docs/ACTIONS.md +0 -1300
- package/docs/BROWSER_SUPPORT.md +0 -279
- package/docs/CONFIGURATION.md +0 -853
- package/docs/DOCUMENTATION_INDEX.md +0 -311
- package/docs/EVENTS.md +0 -798
- package/docs/PROXY.md +0 -228
- package/docs/THEMING.md +0 -592
- package/docs/TROUBLESHOOTING.md +0 -793
- 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
|
@@ -4,6 +4,7 @@ import type { IAddressComponent } from './address.interface';
|
|
|
4
4
|
import type { ICartComponent } from './cart.interface';
|
|
5
5
|
import type { ICheckoutComponent } from './checkout.interface';
|
|
6
6
|
import type { IProductComponent } from './product.interface';
|
|
7
|
+
import type { IProductListComponent } from './product-list.interface';
|
|
7
8
|
export interface IFontFamily {
|
|
8
9
|
name: string;
|
|
9
10
|
weights: number[];
|
|
@@ -55,6 +56,7 @@ export interface IAllConfigs {
|
|
|
55
56
|
address: IAddressComponent;
|
|
56
57
|
cart: ICartComponent;
|
|
57
58
|
checkout: ICheckoutComponent;
|
|
59
|
+
productList: IProductListComponent;
|
|
58
60
|
}
|
|
59
|
-
export type ConfigsKeyType = 'all' | 'configurations' | 'global' | 'product' | 'address' | 'cart' | 'checkout';
|
|
60
|
-
export type ConfigsType = IAllConfigs | IElementsConfigurations | IComponentGlobalConfigs | IProductComponent | IAddressComponent | ICartComponent | ICheckoutComponent;
|
|
61
|
+
export type ConfigsKeyType = 'all' | 'configurations' | 'global' | 'product' | 'address' | 'cart' | 'checkout' | 'productList';
|
|
62
|
+
export type ConfigsType = IAllConfigs | IElementsConfigurations | IComponentGlobalConfigs | IProductComponent | IAddressComponent | ICartComponent | ICheckoutComponent | IProductListComponent;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { DisplayModeType } from 'enums';
|
|
2
|
+
import type { DeepPartial } from '@/interfaces/core.interface';
|
|
3
|
+
export type ProductListCardStyle = 'card' | 'ghost';
|
|
4
|
+
export type ProductListCardCornerRadius = 'rounded' | 'sharp';
|
|
5
|
+
export interface IProductListTheme {
|
|
6
|
+
backgroundColor: string;
|
|
7
|
+
}
|
|
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: DisplayModeType;
|
|
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>;
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import type { IProductListProduct } from 'core/store/interfaces/product-list.interface';
|
|
2
|
+
import { type NavigationSourceType } from 'enums';
|
|
3
|
+
import type { IFulfillment } from 'interfaces/api/product.interface';
|
|
4
|
+
import type { IProductListComponent } from 'interfaces/configs';
|
|
1
5
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
6
|
import type { IAddressComponent } from '@/interfaces/configs';
|
|
3
7
|
import type { IAddressOptions } from './address.interface';
|
|
@@ -5,6 +9,12 @@ export interface IAddressInputComponentParams {
|
|
|
5
9
|
productId?: string;
|
|
6
10
|
isIndependentComponent?: boolean;
|
|
7
11
|
options?: IAddressOptions;
|
|
12
|
+
navigationSource?: NavigationSourceType;
|
|
13
|
+
product?: IProductListProduct;
|
|
14
|
+
shippingFulfillment?: IFulfillment | null;
|
|
15
|
+
onDemandFulfillment?: IFulfillment | null;
|
|
16
|
+
showCollections?: boolean;
|
|
17
|
+
config?: IProductListComponent;
|
|
8
18
|
}
|
|
9
19
|
export declare class AddressInputComponent extends BaseComponent<IAddressInputComponentParams, IAddressComponent> {
|
|
10
20
|
private suggestions;
|
|
@@ -24,6 +34,7 @@ export declare class AddressInputComponent extends BaseComponent<IAddressInputCo
|
|
|
24
34
|
private closeDrawer;
|
|
25
35
|
private handleCancel;
|
|
26
36
|
private handleCheckAvailability;
|
|
37
|
+
private reopenAddToCartDrawer;
|
|
27
38
|
private handleSuggestionClick;
|
|
28
39
|
private handleDocumentClick;
|
|
29
40
|
private searchAddresses;
|
|
@@ -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,7 @@
|
|
|
1
|
+
export * from './product-badge';
|
|
2
|
+
export * from './product-button';
|
|
3
|
+
export * from './product-fulfillments';
|
|
4
|
+
export * from './product-price-and-personalization';
|
|
5
|
+
export * from './product-quantity-selector';
|
|
6
|
+
export * from './product-sizes-list';
|
|
7
|
+
export * from './product-title';
|
|
@@ -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,12 @@
|
|
|
1
|
+
import type { IProductFulfillmentStore } from 'core/store/interfaces/product.interface';
|
|
2
|
+
import { type NavigationSourceType } from 'enums';
|
|
3
|
+
export interface IFulfillmentSectionParams {
|
|
4
|
+
shippingVariants: Record<string, IProductFulfillmentStore>;
|
|
5
|
+
onDemandVariants: Record<string, IProductFulfillmentStore>;
|
|
6
|
+
enableShippingFulfillment: boolean;
|
|
7
|
+
enableOnDemandFulfillment: boolean;
|
|
8
|
+
productId: string;
|
|
9
|
+
navigationSource?: NavigationSourceType;
|
|
10
|
+
onDeliveryOptionsClick: (productId: string) => void | Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export declare const createFulfillmentSection: (params: IFulfillmentSectionParams) => HTMLElement;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface IPricePersonalizationSectionParams {
|
|
2
|
+
price: number;
|
|
3
|
+
showPrice: boolean;
|
|
4
|
+
hasPersonalization: boolean;
|
|
5
|
+
showPersonalization: boolean;
|
|
6
|
+
hasAddress: boolean;
|
|
7
|
+
wrapperClassName?: string;
|
|
8
|
+
priceClassName?: string;
|
|
9
|
+
personalizeClassName?: string;
|
|
10
|
+
personalizeText?: string;
|
|
11
|
+
onPersonalizeClick?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const createPricePersonalizationSection: ({ price, showPrice, hasPersonalization, showPersonalization, hasAddress, wrapperClassName, priceClassName, personalizeClassName, personalizeText, onPersonalizeClick, }: IPricePersonalizationSectionParams) => HTMLElement | null;
|
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,9 @@
|
|
|
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-product-pre-cart.component';
|
|
8
|
+
export * from './product-list-retailers.component';
|
|
9
|
+
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,10 @@
|
|
|
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
|
+
private handleClose;
|
|
7
|
+
private handleEngravingComplete;
|
|
8
|
+
private handleEngravingCancel;
|
|
9
|
+
private reopenAddToCartDrawer;
|
|
10
|
+
}
|
|
@@ -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
|
}
|
package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BaseComponent } from 'core/base-component.service';
|
|
2
|
+
import type { IProductListProduct } from 'core/store/interfaces/product-list.interface';
|
|
3
|
+
import { type DisplayModeType } from 'enums';
|
|
4
|
+
import type { IFulfillment } from 'interfaces/api/product.interface';
|
|
5
|
+
import type { IProductListComponent } from 'interfaces/configs';
|
|
6
|
+
export interface IProductListProductPreCartComponentParams {
|
|
7
|
+
displayMode: DisplayModeType;
|
|
8
|
+
product: IProductListProduct;
|
|
9
|
+
shippingFulfillment: IFulfillment | null;
|
|
10
|
+
onDemandFulfillment: IFulfillment | null;
|
|
11
|
+
config: IProductListComponent;
|
|
12
|
+
}
|
|
13
|
+
export declare class ProductListProductPreCartComponent extends BaseComponent<IProductListProductPreCartComponentParams, IProductListComponent> {
|
|
14
|
+
private selectedSize;
|
|
15
|
+
constructor();
|
|
16
|
+
protected template(): HTMLElement[];
|
|
17
|
+
private createCartHeader;
|
|
18
|
+
private createImageSection;
|
|
19
|
+
private createPricePersonalizationSection;
|
|
20
|
+
private createDeliversToSection;
|
|
21
|
+
private createSizesSection;
|
|
22
|
+
private handleDeliveryOptionsClick;
|
|
23
|
+
private createFulfillmentSectionWrapper;
|
|
24
|
+
createFulfillmentTextSection(selectedFulfillmentType: string, selectedFulfillmentRetailerName: string): HTMLElement;
|
|
25
|
+
private createAddToCartSection;
|
|
26
|
+
private handleAddToCart;
|
|
27
|
+
private createExpectationArrivalInfoSection;
|
|
28
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { IProductListProduct } from 'core/store/interfaces/product-list.interface';
|
|
2
|
+
import { type DisplayModeType, type NavigationSourceType } from 'enums';
|
|
3
|
+
import type { IFulfillment } from 'interfaces/api/product.interface';
|
|
4
|
+
import type { IProductListComponent } from 'interfaces/configs';
|
|
5
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
6
|
+
export interface IProductListRetailersParams {
|
|
7
|
+
product?: IProductListProduct;
|
|
8
|
+
productId: string;
|
|
9
|
+
config?: IProductListComponent;
|
|
10
|
+
displayMode?: DisplayModeType;
|
|
11
|
+
navigationSource?: NavigationSourceType;
|
|
12
|
+
shippingFulfillment?: IFulfillment | null;
|
|
13
|
+
onDemandFulfillment?: IFulfillment | null;
|
|
14
|
+
}
|
|
15
|
+
export declare class ProductListRetailersComponent extends BaseComponent<IProductListRetailersParams, IProductListComponent> {
|
|
16
|
+
get hostClasses(): string[];
|
|
17
|
+
constructor();
|
|
18
|
+
private getProductId;
|
|
19
|
+
protected template(): HTMLElement[];
|
|
20
|
+
private extractFulfillments;
|
|
21
|
+
private onFulfillmentTabClick;
|
|
22
|
+
private onRetailerCardClick;
|
|
23
|
+
private reopenAddToCartDrawer;
|
|
24
|
+
private createHeader;
|
|
25
|
+
private createNoAvailabilityMessage;
|
|
26
|
+
}
|
|
@@ -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
|
+
}
|