@liquidcommerce/elements-sdk 2.6.0 → 2.6.2
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 +1 -0
- package/dist/index.esm.js +10881 -10331
- package/dist/types/constants/core.constant.d.ts +11 -0
- package/dist/types/core/api/api-client.service.d.ts +11 -11
- package/dist/types/core/api/auth-client.service.d.ts +20 -18
- package/dist/types/core/client/client-action.service.d.ts +18 -11
- package/dist/types/core/client/client-config.service.d.ts +1 -0
- package/dist/types/core/command/base-command.service.d.ts +2 -2
- package/dist/types/core/command/common-command.service.d.ts +2 -1
- package/dist/types/core/google-tag-manager.service.d.ts +13 -10
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -12
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +26 -63
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +11 -1
- package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -81
- package/dist/types/core/store/interfaces/address.interface.d.ts +3 -12
- package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -54
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +2 -2
- package/dist/types/core/store/interfaces/core.interface.d.ts +5 -4
- package/dist/types/core/store/interfaces/product.interface.d.ts +12 -66
- package/dist/types/core/store/store.constant.d.ts +1 -1
- package/dist/types/core/telemetry/telemetry.interface.d.ts +0 -1
- package/dist/types/elements-base-client.d.ts +1 -1
- package/dist/types/enums/cloud.enum.d.ts +20 -0
- package/dist/types/enums/core.enum.d.ts +1 -0
- package/dist/types/interfaces/api/address.interface.d.ts +28 -0
- package/dist/types/interfaces/api/cart.interface.d.ts +91 -0
- package/dist/types/interfaces/api/product-list.interface.d.ts +30 -0
- package/dist/types/interfaces/api/product.interface.d.ts +106 -0
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +14 -10
- package/dist/types/interfaces/cloud/index.d.ts +0 -4
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +2 -2
- package/dist/types/interfaces/configs/configurations.interface.d.ts +5 -5
- package/dist/types/interfaces/configs/global.interface.d.ts +1 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +1 -0
- package/dist/types/modules/address/address.command.d.ts +3 -3
- package/dist/types/modules/address/address.interface.d.ts +0 -7
- package/dist/types/modules/cart/cart.commands.d.ts +0 -1
- package/dist/types/modules/cart/components/cart-body.component.d.ts +2 -1
- package/dist/types/modules/cart/components/cart-footer.component.d.ts +0 -1
- package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +0 -2
- package/dist/types/modules/product/components/components.d.ts +2 -4
- package/dist/types/modules/product/product.commands.d.ts +2 -2
- package/dist/types/modules/product-list/components/index.d.ts +2 -0
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +3 -2
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +6 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +1 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts +7 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +16 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-price-filter.components.d.ts +22 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +16 -0
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +18 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +27 -5
- package/dist/types/modules/product-list/product-list.commands.d.ts +3 -2
- package/dist/types/modules/product-list/product-list.component.d.ts +13 -5
- package/dist/types/modules/product-list/product-list.interface.d.ts +77 -0
- package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
- package/dist/types/static/icon/chevron-up.icon.d.ts +2 -0
- package/dist/types/static/icon/filter.icon.d.ts +2 -0
- package/dist/types/static/icon/index.d.ts +1 -0
- package/dist/types/utils/format.d.ts +0 -13
- package/dist/types/utils/helper.d.ts +2 -1
- package/docs/THEMING.md +3 -0
- package/package.json +6 -7
- package/umd/elements.js +1 -1
- package/dist/types/interfaces/cloud/address.interface.d.ts +0 -36
- package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
- package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -43
- package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
- package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
- package/dist/types/modules/product/utils/helpers.d.ts +0 -3
- package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
- package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
|
@@ -2,6 +2,7 @@ import type { DeepPartial } from '@/interfaces/core.interface';
|
|
|
2
2
|
export type FulfillmentDisplayType = 'carousel' | 'popup';
|
|
3
3
|
export interface IProductLayout {
|
|
4
4
|
showImages: boolean;
|
|
5
|
+
showOnlyMainImage: boolean;
|
|
5
6
|
showTitle: boolean;
|
|
6
7
|
showDescription: boolean;
|
|
7
8
|
showQuantityCounter: boolean;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BaseCommand } from '@/core/command/base-command.service';
|
|
2
|
-
import type {
|
|
3
|
-
import type { IAddressData } from './address.interface';
|
|
2
|
+
import type { IAddressAddress, IAddressAutocompleteResult, IAddressCoordinates, IAddressData, IAddressDetailsResult } from '@/interfaces/api/address.interface';
|
|
4
3
|
export declare class AddressCommands extends BaseCommand {
|
|
5
4
|
private productCommands;
|
|
6
5
|
private cartCommands;
|
|
@@ -9,7 +8,8 @@ export declare class AddressCommands extends BaseCommand {
|
|
|
9
8
|
searchAddresses(query: string): Promise<IAddressAutocompleteResult[]>;
|
|
10
9
|
getAddressDetails(addressId: string): Promise<IAddressDetailsResult>;
|
|
11
10
|
setSelectedAddress(addressData: IAddressData): Promise<void>;
|
|
12
|
-
setAddressManually(address:
|
|
11
|
+
setAddressManually(address: IAddressAddress, coordinates: IAddressCoordinates): Promise<void>;
|
|
13
12
|
clearSelectedAddress(): Promise<void>;
|
|
14
13
|
getDetails(): IAddressData | null;
|
|
14
|
+
private buildFormattedAddressString;
|
|
15
15
|
}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import type { IAddress, ICoords } from '@/interfaces/cloud/address.interface';
|
|
2
1
|
export interface IAddressOptions {
|
|
3
2
|
showLabel?: boolean;
|
|
4
3
|
}
|
|
5
|
-
export interface IAddressData {
|
|
6
|
-
id: string;
|
|
7
|
-
formattedAddress: string;
|
|
8
|
-
address: Omit<IAddress, 'id'>;
|
|
9
|
-
coordinates: ICoords;
|
|
10
|
-
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseCommand } from '@/core/command/base-command.service';
|
|
2
2
|
import type { IBaseCartEventData } from '@/core/pubsub/interfaces/cart.interface';
|
|
3
3
|
export interface AddItemParams {
|
|
4
|
-
upc: string;
|
|
5
4
|
fulfillmentId: string;
|
|
6
5
|
partNumber: string;
|
|
7
6
|
quantity: number;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
2
|
-
|
|
2
|
+
import type { ICartComponent } from '@/interfaces/configs';
|
|
3
|
+
export declare class CartBodyComponent extends BaseComponent<null, ICartComponent> {
|
|
3
4
|
get hostClasses(): string[];
|
|
4
5
|
constructor();
|
|
5
6
|
private createEmptyCartElement;
|
|
@@ -12,7 +12,6 @@ export declare class CartFooterComponent extends BaseComponent<ICartFooterCompon
|
|
|
12
12
|
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
13
13
|
afterRender(): void;
|
|
14
14
|
private isAnythingLoading;
|
|
15
|
-
private hasUnmetMinimum;
|
|
16
15
|
private shouldDisableCheckout;
|
|
17
16
|
private updateCheckoutButtonState;
|
|
18
17
|
private updateSubtotalItemsCount;
|
|
@@ -6,7 +6,6 @@ export declare class CartFulfillmentComponent extends BaseComponent<ICartFulfill
|
|
|
6
6
|
get hostClasses(): string[];
|
|
7
7
|
constructor();
|
|
8
8
|
private getFulfillmentId;
|
|
9
|
-
private getProductStore;
|
|
10
9
|
private handleItemsUpdate;
|
|
11
10
|
private setupItemElements;
|
|
12
11
|
private setupMinimumPurchaseAlert;
|
|
@@ -17,7 +16,6 @@ export declare class CartFulfillmentComponent extends BaseComponent<ICartFulfill
|
|
|
17
16
|
private isAnyItemUpdating;
|
|
18
17
|
private checkAndUpdateLoadingState;
|
|
19
18
|
onStoreChanged(changes: IOnStoreChanged[]): boolean | undefined;
|
|
20
|
-
private hasFulfillmentFeesChanged;
|
|
21
19
|
private hasFulfillmentDataChanged;
|
|
22
20
|
protected afterRender(): void;
|
|
23
21
|
protected disconnected(): void;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import type { IProductFulfillmentStore } from '@/core/store/interfaces/product.interface';
|
|
2
2
|
import { type FulfillmentType } from '@/enums';
|
|
3
|
-
import type { IProductSizeAttributes } from '@/interfaces/
|
|
4
|
-
|
|
5
|
-
export declare function renderPopupRetailerCard({ fulfillment, selectedFulfillmentType, isSelected, fulfillmentStatus, selectedSizeAttributes, }: {
|
|
3
|
+
import type { IProductSizeAttributes } from '@/interfaces/api/product.interface';
|
|
4
|
+
export declare function renderPopupRetailerCard({ fulfillment, selectedFulfillmentType, isSelected, selectedSizeAttributes, }: {
|
|
6
5
|
fulfillment: IProductFulfillmentStore;
|
|
7
6
|
selectedFulfillmentType: FulfillmentType;
|
|
8
7
|
isSelected: boolean;
|
|
9
|
-
fulfillmentStatus: RetailerStatus;
|
|
10
8
|
selectedSizeAttributes: IProductSizeAttributes | null;
|
|
11
9
|
}): HTMLElement;
|
|
12
10
|
export declare function renderFulfillmentTabsContainer({ shippingFulfillments, onDemandFulfillments, shippingSelected, onDemandSelected, onTabClick, enableShippingFulfillment, enableOnDemandFulfillment, }: {
|
|
@@ -2,7 +2,7 @@ import { BaseCommand } from '@/core/command/base-command.service';
|
|
|
2
2
|
import type { IBaseProductEventData } from '@/core/pubsub/interfaces/product.interface';
|
|
3
3
|
import type { IProductDrawerContentConfig } from '@/core/store/interfaces/product.interface';
|
|
4
4
|
import { type FulfillmentType } from '@/enums';
|
|
5
|
-
import type {
|
|
5
|
+
import type { IProductAvailabilityResponse } from '@/interfaces/api/product.interface';
|
|
6
6
|
import { type AddItemParams } from '@/modules/cart/cart.commands';
|
|
7
7
|
export declare class ProductCommands extends BaseCommand {
|
|
8
8
|
private readonly uiCommands;
|
|
@@ -11,7 +11,7 @@ export declare class ProductCommands extends BaseCommand {
|
|
|
11
11
|
static getInstance(): ProductCommands;
|
|
12
12
|
createProductInstance(productId: string, firstTime?: boolean): Promise<void>;
|
|
13
13
|
loadMultipleProducts(productIds: string[]): Promise<void>;
|
|
14
|
-
loadProduct(productId: string, customProductData?:
|
|
14
|
+
loadProduct(productId: string, customProductData?: IProductAvailabilityResponse | null): Promise<void>;
|
|
15
15
|
selectSize(productId: string, sizeId: string): Promise<void>;
|
|
16
16
|
selectFulfillment(productId: string, selectedFulfillmentId: string): Promise<void>;
|
|
17
17
|
updateQuantity(productId: string, delta: number): Promise<void>;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export * from './product-list-card.component';
|
|
2
2
|
export * from './product-list-card-loading.component';
|
|
3
3
|
export * from './product-list-filters.component';
|
|
4
|
+
export * from './product-list-filters-subcomponents';
|
|
5
|
+
export * from './product-list-filters-subcomponents/product-list-apply-filter-button.component';
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IFulfillment, IProduct } from '@/interfaces/api/product.interface';
|
|
3
3
|
import type { ProductListCardVariantType } from '@/interfaces/core.interface';
|
|
4
4
|
export interface IProductListCardParams {
|
|
5
5
|
variant: ProductListCardVariantType;
|
|
6
6
|
fillCard: boolean;
|
|
7
7
|
product: IProduct;
|
|
8
|
-
|
|
8
|
+
shippingFulfillment: IFulfillment | null;
|
|
9
|
+
onDemandFulfillment: IFulfillment | null;
|
|
9
10
|
productUrl?: string;
|
|
10
11
|
}
|
|
11
12
|
export interface IProductAvailabilityData {
|
package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export * from './product-list-apply-filter-button.component';
|
|
2
|
+
export * from './product-list-checkbox-filter.components';
|
|
3
|
+
export * from './product-list-delivery-options-filter.components';
|
|
4
|
+
export * from './product-list-price-filter.components';
|
|
5
|
+
export * from './product-list-search.component';
|
|
6
|
+
export * from './product-list-toggle-filters.components';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createApplyFiltersButton(onCloseDrawer: VoidFunction): HTMLElement;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ICheckboxLabelStates, ICreateCheckboxFilterHeaderParams, ICreateCheckboxFilterSearchContainerParams, ICreateCheckboxItemParams, IHandleCheckboxFilterSearchParams, IRenderCheckboxItemsParams } from '../../product-list.interface';
|
|
2
|
+
export declare function createCheckboxItem(params: ICreateCheckboxItemParams): HTMLElement;
|
|
3
|
+
export declare function handleCheckboxFilterSearch(params: IHandleCheckboxFilterSearchParams): void;
|
|
4
|
+
export declare function createCheckboxFilterHeader(params: ICreateCheckboxFilterHeaderParams): HTMLElement;
|
|
5
|
+
export declare function createCheckboxFilterSearchContainer(params: ICreateCheckboxFilterSearchContainerParams): HTMLElement;
|
|
6
|
+
export declare function renderCheckboxItems(params: IRenderCheckboxItemsParams): void;
|
|
7
|
+
export declare function updateFilterExpandState(state: ICheckboxLabelStates): void;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface ICreateDeliveryOptionsFilterParams {
|
|
2
|
+
currentFilters?: {
|
|
3
|
+
deliveryOptions?: string;
|
|
4
|
+
personalized?: boolean;
|
|
5
|
+
preOrder?: boolean;
|
|
6
|
+
};
|
|
7
|
+
deliveryCollapsed: boolean;
|
|
8
|
+
isSameDayDeliveryDisabled: boolean;
|
|
9
|
+
onDeliveryOptionsChange?: (value: 'all' | 'shipping' | 'onDemand') => void;
|
|
10
|
+
onToggleCollapse: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function createDeliveryOptionsFilter(params: ICreateDeliveryOptionsFilterParams): {
|
|
13
|
+
elements: HTMLElement[];
|
|
14
|
+
chevronContainer: HTMLElement;
|
|
15
|
+
deliveryOptionsList: HTMLElement;
|
|
16
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ICreatePriceFilterParams {
|
|
2
|
+
priceConfig?: {
|
|
3
|
+
min?: string;
|
|
4
|
+
max?: string;
|
|
5
|
+
};
|
|
6
|
+
currentFilters?: {
|
|
7
|
+
price?: {
|
|
8
|
+
min?: string;
|
|
9
|
+
max?: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
priceCollapsed: boolean;
|
|
13
|
+
onPriceChange?: (min: string, max: string) => void;
|
|
14
|
+
onToggleCollapse: () => void;
|
|
15
|
+
DEFAULT_MIN: string;
|
|
16
|
+
DEFAULT_MAX: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function createPriceFilter(params: ICreatePriceFilterParams): {
|
|
19
|
+
elements: HTMLElement[];
|
|
20
|
+
chevronContainer: HTMLElement;
|
|
21
|
+
sliderContainer: HTMLElement;
|
|
22
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
export interface IProductListSearchParams {
|
|
3
|
+
searchTerm?: string;
|
|
4
|
+
handleInputChange?: (search: string) => void;
|
|
5
|
+
clearSearch?: VoidFunction;
|
|
6
|
+
}
|
|
7
|
+
export declare class ProductListSearchComponent extends BaseComponent<IProductListSearchParams> {
|
|
8
|
+
private searchInput?;
|
|
9
|
+
private clearButton?;
|
|
10
|
+
private readonly ALLOWED_CHARACTERS;
|
|
11
|
+
private readonly MAX_LENGTH;
|
|
12
|
+
get hostClasses(): string[];
|
|
13
|
+
protected template(): HTMLElement[];
|
|
14
|
+
private sanitizeInput;
|
|
15
|
+
private updateClearButtonVisibility;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface ICreatePersonalizedFilterParams {
|
|
2
|
+
currentFilters?: {
|
|
3
|
+
personalized?: boolean;
|
|
4
|
+
deliveryOptions?: string;
|
|
5
|
+
};
|
|
6
|
+
isPersonalizationDisabled: boolean;
|
|
7
|
+
onPersonalizedChange?: (enabled: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
export interface ICreatePreOrderFilterParams {
|
|
10
|
+
currentFilters?: {
|
|
11
|
+
preOrder?: boolean;
|
|
12
|
+
deliveryOptions?: string;
|
|
13
|
+
};
|
|
14
|
+
isPreOrderDisabled: boolean;
|
|
15
|
+
onPreOrderChange?: (enabled: boolean) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function createPersonalizedFilter(params: ICreatePersonalizedFilterParams): HTMLElement[];
|
|
18
|
+
export declare function createPreOrderFilter(params: ICreatePreOrderFilterParams): HTMLElement[];
|
|
@@ -1,21 +1,43 @@
|
|
|
1
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { ICurrentFilters, IExtendedFilterSchema, IPriceConfig } from '../product-list.interface';
|
|
2
3
|
export interface IProductListFiltersParams {
|
|
3
4
|
enablePersonalized: boolean;
|
|
4
5
|
enablePreOrder: boolean;
|
|
5
6
|
enableDeliveryOptions: boolean;
|
|
7
|
+
sanitizedFilters?: IExtendedFilterSchema[];
|
|
8
|
+
currentFilters?: ICurrentFilters;
|
|
9
|
+
priceConfig?: IPriceConfig;
|
|
10
|
+
isDrawerMode?: boolean;
|
|
6
11
|
onPersonalizedChange?: (enabled: boolean) => void;
|
|
7
12
|
onPreOrderChange?: (enabled: boolean) => void;
|
|
8
13
|
onDeliveryOptionsChange?: (value: 'all' | 'shipping' | 'onDemand') => void;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
deliveryOptions: 'all' | 'shipping' | 'onDemand';
|
|
13
|
-
};
|
|
14
|
+
onPriceChange?: (min: string, max: string) => void;
|
|
15
|
+
onCheckboxFilterChange?: (category: string, selectedValues: string[]) => void;
|
|
16
|
+
onApplyFilters?: () => void;
|
|
14
17
|
}
|
|
15
18
|
export declare class ProductListFiltersComponent extends BaseComponent<IProductListFiltersParams> {
|
|
19
|
+
private priceCollapsed;
|
|
20
|
+
private deliveryCollapsed;
|
|
21
|
+
private checkboxFilterStates;
|
|
22
|
+
private readonly DEFAULT_MIN;
|
|
23
|
+
private readonly DEFAULT_MAX;
|
|
24
|
+
private priceChevronContainer?;
|
|
25
|
+
private priceSliderContainer?;
|
|
26
|
+
private deliveryChevronContainer?;
|
|
27
|
+
private deliveryOptionsList?;
|
|
16
28
|
get hostClasses(): string[];
|
|
17
29
|
private isSameDayDeliveryDisabled;
|
|
18
30
|
private isPersonalizationDisabled;
|
|
19
31
|
private isPreOrderDisabled;
|
|
32
|
+
private createPersonalizedFilterWrapper;
|
|
33
|
+
private createPreOrderFilterWrapper;
|
|
34
|
+
private createDeliveryOptionsFilterWrapper;
|
|
35
|
+
private toggleDeliveryCollapse;
|
|
36
|
+
private createPriceFilterWrapper;
|
|
37
|
+
private togglePriceCollapse;
|
|
38
|
+
private createCheckboxFilter;
|
|
39
|
+
private renderCheckboxItemsWrapper;
|
|
40
|
+
private handleCheckboxChange;
|
|
41
|
+
private toggleCheckboxFilter;
|
|
20
42
|
protected template(): HTMLElement[];
|
|
21
43
|
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { BaseCommand } from '@/core/command/base-command.service';
|
|
2
|
-
import type {
|
|
2
|
+
import type { IProduct } from '@/interfaces/api/product.interface';
|
|
3
|
+
import type { IProductSearchParams, IProductSearchResponse } from '@/interfaces/api/product-list.interface';
|
|
3
4
|
import { type AddItemParams } from '@/modules/cart/cart.commands';
|
|
4
5
|
export declare class ProductListCommands extends BaseCommand {
|
|
5
6
|
private readonly uiCommands;
|
|
6
7
|
private readonly cartCommands;
|
|
7
8
|
constructor();
|
|
8
9
|
static getInstance(): ProductListCommands;
|
|
9
|
-
getProductList(params:
|
|
10
|
+
getProductList(params: IProductSearchParams): Promise<IProductSearchResponse>;
|
|
10
11
|
addToCart(params: AddItemParams): Promise<void>;
|
|
11
12
|
addPresaleToCart(params: AddItemParams): Promise<void>;
|
|
12
13
|
trackViewItemList(products: IProduct[]): void;
|
|
@@ -8,18 +8,16 @@ export interface IProductListComponentParams {
|
|
|
8
8
|
filters: ProductListFilterType[];
|
|
9
9
|
productUrl?: string;
|
|
10
10
|
}
|
|
11
|
-
export interface IProductListFilters {
|
|
12
|
-
personalized: boolean;
|
|
13
|
-
preOrder: boolean;
|
|
14
|
-
deliveryOptions: 'all' | 'shipping' | 'onDemand';
|
|
15
|
-
}
|
|
16
11
|
export declare class ProductListComponent extends BaseComponent<IProductListComponentParams> {
|
|
17
12
|
private products;
|
|
18
13
|
private retailers;
|
|
19
14
|
private pagination;
|
|
15
|
+
private filters;
|
|
16
|
+
private searchFilter;
|
|
20
17
|
private currentFilters;
|
|
21
18
|
private cardsContainer;
|
|
22
19
|
private filtersContainer;
|
|
20
|
+
private searchContainer;
|
|
23
21
|
private sentinelElement;
|
|
24
22
|
private personalizedSwitch;
|
|
25
23
|
private preOrderSwitch;
|
|
@@ -28,6 +26,9 @@ export declare class ProductListComponent extends BaseComponent<IProductListComp
|
|
|
28
26
|
private loadingState;
|
|
29
27
|
private scrollObserver;
|
|
30
28
|
private initializationPromise;
|
|
29
|
+
private filterDebounceTimer;
|
|
30
|
+
private readonly FILTER_DEBOUNCE_MS;
|
|
31
|
+
private filterButton;
|
|
31
32
|
get hostClasses(): string[];
|
|
32
33
|
constructor();
|
|
33
34
|
protected connected(): Promise<void>;
|
|
@@ -37,6 +38,7 @@ export declare class ProductListComponent extends BaseComponent<IProductListComp
|
|
|
37
38
|
private setLoadingState;
|
|
38
39
|
private renderCurrentState;
|
|
39
40
|
private loadInitialProducts;
|
|
41
|
+
private updateFiltersComponent;
|
|
40
42
|
private loadMoreProducts;
|
|
41
43
|
private mergeRetailers;
|
|
42
44
|
private updatePagination;
|
|
@@ -54,12 +56,18 @@ export declare class ProductListComponent extends BaseComponent<IProductListComp
|
|
|
54
56
|
private isPreOrderDisabled;
|
|
55
57
|
private isSameDayDeliveryDisabled;
|
|
56
58
|
private createCardsContainer;
|
|
59
|
+
private getResponsiveColumns;
|
|
57
60
|
private renderLoadingState;
|
|
58
61
|
private renderProducts;
|
|
59
62
|
private appendNewProducts;
|
|
60
63
|
private createProductCard;
|
|
64
|
+
private filterSanitizedFilters;
|
|
65
|
+
private buildFiltersParams;
|
|
66
|
+
private createSearchContainer;
|
|
61
67
|
private createFiltersContainer;
|
|
62
68
|
private storeFilterElementReferences;
|
|
69
|
+
private openFiltersDrawer;
|
|
70
|
+
private createFilterButton;
|
|
63
71
|
private setupInfiniteScroll;
|
|
64
72
|
private createScrollSentinel;
|
|
65
73
|
private updateSentinel;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { IFilterValue } from '@/interfaces/api/product-list.interface';
|
|
2
|
+
export interface IProductListFilters {
|
|
3
|
+
personalized: boolean;
|
|
4
|
+
preOrder: boolean;
|
|
5
|
+
deliveryOptions: 'all' | 'shipping' | 'onDemand';
|
|
6
|
+
price?: {
|
|
7
|
+
min?: string;
|
|
8
|
+
max?: string;
|
|
9
|
+
};
|
|
10
|
+
[key: string]: any;
|
|
11
|
+
}
|
|
12
|
+
export interface IExtendedFilterSchema {
|
|
13
|
+
category: string;
|
|
14
|
+
values: IFilterValue[];
|
|
15
|
+
}
|
|
16
|
+
export interface IProductListSearch {
|
|
17
|
+
searchTerm?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface IPagination {
|
|
20
|
+
currentPage: number;
|
|
21
|
+
totalPages: number;
|
|
22
|
+
hasMorePages: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface ICheckboxLabelStates {
|
|
25
|
+
isExpanded: boolean;
|
|
26
|
+
selectedValues: Set<string>;
|
|
27
|
+
searchInput: HTMLInputElement | null;
|
|
28
|
+
checkboxList: HTMLElement | null;
|
|
29
|
+
filteredItems: IFilterValue[];
|
|
30
|
+
contentElement: HTMLElement | null;
|
|
31
|
+
iconElement: HTMLElement | null;
|
|
32
|
+
hasUserInteraction: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface ICurrentFilters {
|
|
35
|
+
personalized: boolean;
|
|
36
|
+
preOrder: boolean;
|
|
37
|
+
deliveryOptions: 'all' | 'shipping' | 'onDemand';
|
|
38
|
+
price?: {
|
|
39
|
+
min?: string;
|
|
40
|
+
max?: string;
|
|
41
|
+
};
|
|
42
|
+
[key: string]: any;
|
|
43
|
+
}
|
|
44
|
+
export interface IPriceConfig {
|
|
45
|
+
min: string;
|
|
46
|
+
max: string;
|
|
47
|
+
}
|
|
48
|
+
export interface ICreateCheckboxItemParams {
|
|
49
|
+
filter: IExtendedFilterSchema;
|
|
50
|
+
state: ICheckboxLabelStates;
|
|
51
|
+
item: IFilterValue;
|
|
52
|
+
onChange: VoidFunction;
|
|
53
|
+
}
|
|
54
|
+
export interface IHandleCheckboxFilterSearchParams {
|
|
55
|
+
filter: IExtendedFilterSchema;
|
|
56
|
+
state: ICheckboxLabelStates;
|
|
57
|
+
searchTerm: string;
|
|
58
|
+
renderCheckboxItems: VoidFunction;
|
|
59
|
+
}
|
|
60
|
+
export interface ICreateCheckboxFilterHeaderParams {
|
|
61
|
+
filter: IExtendedFilterSchema;
|
|
62
|
+
state: ICheckboxLabelStates;
|
|
63
|
+
onToggle: (bucket: string) => void;
|
|
64
|
+
}
|
|
65
|
+
export interface ICreateCheckboxFilterSearchContainerParams {
|
|
66
|
+
filter: IExtendedFilterSchema;
|
|
67
|
+
state: ICheckboxLabelStates;
|
|
68
|
+
onSearch: (searchTerm: string) => void;
|
|
69
|
+
}
|
|
70
|
+
export interface IRenderCheckboxItemsParams {
|
|
71
|
+
filter: IExtendedFilterSchema;
|
|
72
|
+
state: ICheckboxLabelStates;
|
|
73
|
+
onCheckboxChange: (value: string, checked: boolean) => void;
|
|
74
|
+
}
|
|
75
|
+
export interface ICreateFiltersContainerParams {
|
|
76
|
+
isDrawerMode?: boolean;
|
|
77
|
+
}
|
|
@@ -3,6 +3,7 @@ export * from './bag.icon';
|
|
|
3
3
|
export * from './checkbox.icon';
|
|
4
4
|
export * from './chevron-down.icon';
|
|
5
5
|
export * from './chevron-left.icon';
|
|
6
|
+
export * from './chevron-up.icon';
|
|
6
7
|
export * from './close.icon';
|
|
7
8
|
export * from './error-info.icon';
|
|
8
9
|
export * from './icon.types';
|
|
@@ -3,19 +3,6 @@ export declare function formatCentToDollarText(cent: number, showZeroDecimals?:
|
|
|
3
3
|
export declare function htmlStringToElement(htmlString: string): HTMLElement;
|
|
4
4
|
export declare function format24TimeTo12(time24h: string): string;
|
|
5
5
|
export declare function formatISODateToMMDDYYYY(isoDateString: string | null | undefined): string;
|
|
6
|
-
export declare function validateMinimumAge(birthDate: string | Date | null | undefined, minimumAge?: number, minimumYear?: number): {
|
|
7
|
-
isValid: boolean;
|
|
8
|
-
age: number | null;
|
|
9
|
-
error?: string;
|
|
10
|
-
};
|
|
11
|
-
export declare function buildFormattedAddressString(address: {
|
|
12
|
-
one: string;
|
|
13
|
-
two: string;
|
|
14
|
-
city: string;
|
|
15
|
-
state: string;
|
|
16
|
-
zip: string;
|
|
17
|
-
country?: string;
|
|
18
|
-
}): string;
|
|
19
6
|
export declare function capitalizeFirstLetter(text: string): string;
|
|
20
7
|
export declare function splitCategoryPath(catPath?: string): {
|
|
21
8
|
category: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { CartEventEnum, CheckoutEventEnum } from 'enums';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ICheckoutEvents } from 'interfaces/cloud';
|
|
3
|
+
import type { ICartEvent } from '@/interfaces/api/cart.interface';
|
|
3
4
|
export type ElementEventLevel = 'success' | 'warning' | 'error';
|
|
4
5
|
export interface IElementsCartEvent {
|
|
5
6
|
type: CartEventEnum;
|
package/docs/THEMING.md
CHANGED
|
@@ -37,6 +37,7 @@ interface IGlobalTheme {
|
|
|
37
37
|
accentColor: string;
|
|
38
38
|
defaultTextColor: string;
|
|
39
39
|
selectedTextColor: string;
|
|
40
|
+
linkTextColor: string;
|
|
40
41
|
errorColor: string;
|
|
41
42
|
warningColor: string;
|
|
42
43
|
successColor: string;
|
|
@@ -68,6 +69,7 @@ customTheme: {
|
|
|
68
69
|
accentColor: '#6c757d',
|
|
69
70
|
defaultTextColor: '#212529',
|
|
70
71
|
selectedTextColor: '#ffffff',
|
|
72
|
+
linkTextColor: '#1d4ed8',
|
|
71
73
|
errorColor: '#dc3545',
|
|
72
74
|
warningColor: '#ffc107',
|
|
73
75
|
successColor: '#28a745',
|
|
@@ -367,6 +369,7 @@ const client = await Elements('YOUR_API_KEY', {
|
|
|
367
369
|
accentColor: '#6c757d',
|
|
368
370
|
defaultTextColor: '#212529',
|
|
369
371
|
selectedTextColor: '#ffffff',
|
|
372
|
+
linkTextColor: '#1d4ed8',
|
|
370
373
|
errorColor: '#dc3545',
|
|
371
374
|
warningColor: '#ffc107',
|
|
372
375
|
successColor: '#28a745',
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "LiquidCommerce Elements SDK",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"author": "LiquidCommerce Team",
|
|
6
|
-
"version": "2.6.
|
|
6
|
+
"version": "2.6.2",
|
|
7
7
|
"homepage": "https://docs.liquidcommerce.co/elements-sdk",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -53,8 +53,7 @@
|
|
|
53
53
|
"check": "pnpm biome check --write .",
|
|
54
54
|
"fl": "pnpm check && pnpm build:dev",
|
|
55
55
|
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
56
|
-
"clean": "rm -rf dist umd",
|
|
57
|
-
"clean:hard": "rm -rf dist umd node_modules && pnpm install && pnpm build",
|
|
56
|
+
"clean": "rm -rf dist umd node_modules && pnpm install && pnpm build",
|
|
58
57
|
"prepublishOnly": "pnpm run build",
|
|
59
58
|
"deprecate:old": "npm deprecate @liquidcommerceteam/elements-sdk@\"*\" \"Package moved to @liquidcommerce/elements-sdk\"",
|
|
60
59
|
"prepare": "husky"
|
|
@@ -71,9 +70,9 @@
|
|
|
71
70
|
"embeddable commerce"
|
|
72
71
|
],
|
|
73
72
|
"devDependencies": {
|
|
74
|
-
"@biomejs/biome": "2.3.
|
|
75
|
-
"@commitlint/cli": "^20.
|
|
76
|
-
"@commitlint/config-conventional": "^20.
|
|
73
|
+
"@biomejs/biome": "2.3.8",
|
|
74
|
+
"@commitlint/cli": "^20.2.0",
|
|
75
|
+
"@commitlint/config-conventional": "^20.2.0",
|
|
77
76
|
"@rollup/plugin-alias": "^6.0.0",
|
|
78
77
|
"@rollup/plugin-commonjs": "^29.0.0",
|
|
79
78
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -87,7 +86,7 @@
|
|
|
87
86
|
"@semantic-release/npm": "^13.1.2",
|
|
88
87
|
"@semantic-release/release-notes-generator": "^14.1.0",
|
|
89
88
|
"@types/core-js": "^2.5.8",
|
|
90
|
-
"@types/node": "^24.10.
|
|
89
|
+
"@types/node": "^24.10.2",
|
|
91
90
|
"conventional-changelog-cli": "^5.0.0",
|
|
92
91
|
"husky": "^9.1.7",
|
|
93
92
|
"process": "^0.11.10",
|