@liquidcommerce/elements-sdk 2.5.11 → 2.6.0-beta.10

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.
Files changed (75) hide show
  1. package/README.md +1 -0
  2. package/dist/index.esm.js +10852 -10205
  3. package/dist/types/constants/core.constant.d.ts +11 -0
  4. package/dist/types/core/{api-client.service.d.ts → api/api-client.service.d.ts} +13 -13
  5. package/dist/types/core/{auth.service.d.ts → api/auth-client.service.d.ts} +5 -16
  6. package/dist/types/core/api/http-client.service.d.ts +45 -0
  7. package/dist/types/core/client/client-action.service.d.ts +18 -11
  8. package/dist/types/core/client/client-config.service.d.ts +3 -0
  9. package/dist/types/core/command/base-command.service.d.ts +3 -3
  10. package/dist/types/core/command/common-command.service.d.ts +2 -1
  11. package/dist/types/core/debug-panel/debug-panel.styles.d.ts +1 -1
  12. package/dist/types/core/google-tag-manager.service.d.ts +12 -10
  13. package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -12
  14. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +26 -63
  15. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +11 -1
  16. package/dist/types/core/pubsub/interfaces/product.interface.d.ts +16 -81
  17. package/dist/types/core/store/interfaces/address.interface.d.ts +3 -12
  18. package/dist/types/core/store/interfaces/cart.interface.d.ts +16 -54
  19. package/dist/types/core/store/interfaces/checkout.interface.d.ts +4 -2
  20. package/dist/types/core/store/interfaces/core.interface.d.ts +5 -4
  21. package/dist/types/core/store/interfaces/product.interface.d.ts +12 -66
  22. package/dist/types/core/store/store.constant.d.ts +1 -1
  23. package/dist/types/core/telemetry/telemetry.interface.d.ts +0 -1
  24. package/dist/types/elements-base-client.d.ts +4 -4
  25. package/dist/types/enums/cloud.enum.d.ts +20 -0
  26. package/dist/types/enums/core.enum.d.ts +1 -0
  27. package/dist/types/interfaces/api/address.interface.d.ts +28 -0
  28. package/dist/types/interfaces/api/cart.interface.d.ts +91 -0
  29. package/dist/types/interfaces/api/product-list.interface.d.ts +30 -0
  30. package/dist/types/interfaces/api/product.interface.d.ts +106 -0
  31. package/dist/types/interfaces/cloud/checkout.interface.d.ts +14 -10
  32. package/dist/types/interfaces/cloud/index.d.ts +0 -4
  33. package/dist/types/interfaces/cloud/retailer.interface.d.ts +2 -2
  34. package/dist/types/interfaces/configs/configurations.interface.d.ts +5 -5
  35. package/dist/types/interfaces/configs/global.interface.d.ts +1 -0
  36. package/dist/types/interfaces/configs/product.interface.d.ts +1 -0
  37. package/dist/types/interfaces/core.interface.d.ts +1 -0
  38. package/dist/types/modules/address/address.command.d.ts +2 -3
  39. package/dist/types/modules/address/address.interface.d.ts +0 -7
  40. package/dist/types/modules/cart/cart.commands.d.ts +0 -1
  41. package/dist/types/modules/cart/components/cart-body.component.d.ts +2 -1
  42. package/dist/types/modules/cart/components/cart-footer.component.d.ts +0 -1
  43. package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +0 -2
  44. package/dist/types/modules/product/components/components.d.ts +2 -4
  45. package/dist/types/modules/product/product.commands.d.ts +2 -2
  46. package/dist/types/modules/product-list/components/index.d.ts +2 -0
  47. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +3 -2
  48. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +6 -0
  49. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +1 -0
  50. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts +7 -0
  51. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +16 -0
  52. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-price-filter.components.d.ts +22 -0
  53. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +16 -0
  54. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +18 -0
  55. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +27 -5
  56. package/dist/types/modules/product-list/product-list.commands.d.ts +3 -2
  57. package/dist/types/modules/product-list/product-list.component.d.ts +13 -5
  58. package/dist/types/modules/product-list/product-list.interface.d.ts +77 -0
  59. package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
  60. package/dist/types/static/icon/chevron-up.icon.d.ts +2 -0
  61. package/dist/types/static/icon/filter.icon.d.ts +2 -0
  62. package/dist/types/static/icon/index.d.ts +1 -0
  63. package/dist/types/utils/helper.d.ts +2 -1
  64. package/docs/THEMING.md +3 -0
  65. package/package.json +5 -6
  66. package/umd/elements.js +1 -1
  67. package/dist/types/core/utils.d.ts +0 -23
  68. package/dist/types/interfaces/cloud/address.interface.d.ts +0 -36
  69. package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
  70. package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -43
  71. package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
  72. package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
  73. package/dist/types/modules/product/utils/helpers.d.ts +0 -3
  74. package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
  75. package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
@@ -0,0 +1,106 @@
1
+ import type { FulfillmentType } from '@/enums';
2
+ import type { IAddressAddress, IAddressCoordinates, ILocation } from '@/interfaces/api/address.interface';
3
+ export interface IProductAvailabilityParams {
4
+ identifiers: string[];
5
+ location?: ILocation;
6
+ }
7
+ export interface IProductAvailabilityResponse {
8
+ products: IProduct[];
9
+ retailers: Record<string, IRetailer>;
10
+ }
11
+ export interface IProductVariant {
12
+ retailerId: string;
13
+ shippingFulfillmentId: string;
14
+ onDemandFulfillmentId: string;
15
+ isEngravable: boolean;
16
+ partNumber: string;
17
+ price: number;
18
+ stock: number;
19
+ }
20
+ export interface IProductSize {
21
+ id: string;
22
+ upc: string;
23
+ size: string;
24
+ pack: boolean;
25
+ packDesc: string;
26
+ container: string;
27
+ containerType: string;
28
+ image: string;
29
+ uom: string;
30
+ volume: string;
31
+ maxQuantityPerOrder: number;
32
+ attributes: IProductSizeAttributes;
33
+ shippingVariants: Record<string, IProductVariant>;
34
+ onDemandVariants: Record<string, IProductVariant>;
35
+ }
36
+ export interface IProductFulfillmentHourStatus {
37
+ text: string;
38
+ isOpen: boolean;
39
+ openTime: string;
40
+ isClosed: boolean;
41
+ closeTime: string;
42
+ }
43
+ export interface IProduct {
44
+ id: string;
45
+ name: string;
46
+ description: string;
47
+ htmlDescription: string;
48
+ images: string[];
49
+ brand: string;
50
+ region: string;
51
+ country: string;
52
+ material: string;
53
+ abv: string;
54
+ proof: string;
55
+ age: string;
56
+ color: string;
57
+ flavor: string;
58
+ variety: string;
59
+ appellation: string;
60
+ vintage: string;
61
+ tastingNotes: string;
62
+ catPath: string;
63
+ category: string;
64
+ classification: string;
65
+ type: string;
66
+ subType: string;
67
+ salsifyGrouping: string;
68
+ noAvailabilityPrice: number;
69
+ sizes: Record<string, IProductSize>;
70
+ }
71
+ export interface IFulfillment {
72
+ id: string;
73
+ type: FulfillmentType;
74
+ doesAllowGiftCards: boolean;
75
+ doesAllowPromos: boolean;
76
+ expectationText: string;
77
+ engravingExpectationText: string;
78
+ fee: number;
79
+ timezone: string;
80
+ hourStatus: IProductFulfillmentHourStatus;
81
+ }
82
+ export type IRetailerAddress = IAddressAddress & IAddressCoordinates;
83
+ export interface IRetailer {
84
+ id: string;
85
+ name: string;
86
+ address: IRetailerAddress;
87
+ addressFormatted: string;
88
+ shippingFulfillment: IFulfillment | null;
89
+ onDemandFulfillment: IFulfillment | null;
90
+ }
91
+ export interface IProductSizeEngraving {
92
+ maxLines: number;
93
+ maxCharsPerLine: number;
94
+ fee: number;
95
+ location: string;
96
+ }
97
+ export interface IProductSizeAttributes {
98
+ presale: IProductPresale;
99
+ engraving: IProductSizeEngraving;
100
+ }
101
+ export interface IProductPresale {
102
+ canPurchaseOn: null | string;
103
+ estimatedShipBy: null | string;
104
+ isActive: boolean;
105
+ language: string;
106
+ }
@@ -1,7 +1,7 @@
1
1
  import type { CheckoutEventEnum } from '@/enums';
2
+ import type { IAddressAddress } from '@/interfaces/api/address.interface';
3
+ import type { ICartItemAttributes } from '@/interfaces/api/cart.interface';
2
4
  import type { ICoreParams } from '@/interfaces/cloud/core.interface';
3
- import type { IAddress } from './address.interface';
4
- import type { ICartAttributesPromoCode, ICartItemAttributes } from './cart.interface';
5
5
  import type { IRetailerExpectation } from './retailer.interface';
6
6
  export interface ICheckoutRecipient {
7
7
  firstName?: string;
@@ -130,7 +130,7 @@ export interface ICheckoutFulfillment extends ICheckoutTotalAmounts {
130
130
  export interface ICheckoutRetailer extends ICheckoutTotalAmounts {
131
131
  id: string;
132
132
  name: string;
133
- address?: IAddress;
133
+ address?: IAddressAddress;
134
134
  fulfillments: ICheckoutFulfillment[];
135
135
  }
136
136
  export interface ICheckoutItem {
@@ -175,6 +175,13 @@ export interface ICheckoutEvents {
175
175
  type: CheckoutEventEnum;
176
176
  message: string;
177
177
  }
178
+ export interface ICheckoutAttributesPromoCode {
179
+ value: string;
180
+ discount: number;
181
+ freeDelivery: boolean;
182
+ freeServiceFee: boolean;
183
+ freeShipping: boolean;
184
+ }
178
185
  export interface ICheckoutPrepareResponse {
179
186
  token: string;
180
187
  cartId: string;
@@ -188,7 +195,7 @@ export interface ICheckoutPrepareResponse {
188
195
  acceptedAccountCreation?: boolean;
189
196
  giftOptions: ICheckoutGiftOptions;
190
197
  marketingPreferences: ICheckoutMarketingPreferences;
191
- shippingAddress: IAddress;
198
+ shippingAddress: IAddressAddress;
192
199
  billingAddress: ICheckoutBillingAddress;
193
200
  amounts: ICheckoutTotalAmounts;
194
201
  items: ICheckoutItem[];
@@ -196,7 +203,7 @@ export interface ICheckoutPrepareResponse {
196
203
  payment?: string;
197
204
  giftCards: ICheckoutGiftCard[];
198
205
  events: ICheckoutEvents[];
199
- promoCode: ICartAttributesPromoCode;
206
+ promoCode: ICheckoutAttributesPromoCode;
200
207
  isPresaleLocked: boolean;
201
208
  presaleExpiresAt: string | null;
202
209
  }
@@ -205,10 +212,7 @@ export interface ICheckoutCompleteParams extends ICoreParams {
205
212
  payment: string;
206
213
  }
207
214
  export interface ICheckoutCompleteResponse {
208
- order: {
209
- number: string;
210
- legacyOrderNumber: string;
211
- referenceId: string;
212
- };
215
+ legacyOrderNumber: string;
216
+ referenceId: string;
213
217
  }
214
218
  export {};
@@ -1,7 +1,3 @@
1
- export * from './address.interface';
2
- export * from './cart.interface';
3
- export * from './catalog.interface';
4
1
  export * from './checkout.interface';
5
2
  export * from './core.interface';
6
- export * from './product.interface';
7
3
  export * from './retailer.interface';
@@ -1,6 +1,6 @@
1
1
  import type { FulfillmentType } from '@/enums';
2
2
  import type { DAYS_OF_WEEK } from '@/enums/cloud.enum';
3
- import type { IAddress, ICoords } from './address.interface';
3
+ import type { IAddressAddress, IAddressCoordinates } from '@/interfaces/api/address.interface';
4
4
  export interface IRetailerTimes {
5
5
  startsAt: string;
6
6
  endsAt: string;
@@ -62,6 +62,6 @@ export interface IRetailer {
62
62
  engravingFee?: number;
63
63
  subtotal?: number;
64
64
  total?: number;
65
- address?: IAddress & ICoords;
65
+ address?: IAddressAddress & IAddressCoordinates;
66
66
  fulfillments: IRetailerFulfillments[];
67
67
  }
@@ -1,11 +1,11 @@
1
1
  export interface IElementsConfigurations {
2
- googleTagManagerId: string;
3
- enablePartnerGaTracking: boolean;
4
- liquidCommerceGoogleTagManagerId: string;
5
- enableLiquidCommerceGaTracking: boolean;
2
+ isElementsEnabled: boolean;
3
+ enablePartnerGTM: boolean;
4
+ partnerGTMId: string;
5
+ enableLiquidCommerceGTM: boolean;
6
+ liquidCommerceGTMId: string;
6
7
  partnerCode: string;
7
8
  supportEmail: string;
8
9
  builderBackgroundColor: string;
9
10
  partnerName: string;
10
- isElementsEnabled: boolean;
11
11
  }
@@ -17,6 +17,7 @@ export interface IGlobalTheme {
17
17
  accentColor: string;
18
18
  defaultTextColor: string;
19
19
  selectedTextColor: string;
20
+ linkTextColor: string;
20
21
  errorColor: string;
21
22
  warningColor: string;
22
23
  successColor: string;
@@ -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;
@@ -14,6 +14,7 @@ export interface IElementsProxyConfig {
14
14
  export interface ILiquidCommerceElementsDevelopmentConfig {
15
15
  customApiUrl?: string;
16
16
  paymentMethodId?: string;
17
+ openShadowDom?: boolean;
17
18
  }
18
19
  export interface IClientCustomThemeConfig {
19
20
  global?: UpdateComponentGlobalConfigs;
@@ -1,6 +1,5 @@
1
1
  import { BaseCommand } from '@/core/command/base-command.service';
2
- import type { IAddress, IAddressAutocompleteResult, IAddressDetailsResult, ICoords } from '@/interfaces/cloud';
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,7 @@ 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: Omit<IAddress, 'id'>, coordinates: ICoords): Promise<void>;
11
+ setAddressManually(address: IAddressAddress, coordinates: IAddressCoordinates): Promise<void>;
13
12
  clearSelectedAddress(): Promise<void>;
14
13
  getDetails(): IAddressData | null;
15
14
  }
@@ -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
- export declare class CartBodyComponent extends BaseComponent<null, null> {
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/cloud';
4
- import type { RetailerStatus } from '@/modules/product/utils/retailer-hours';
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 { IProductData } from '@/interfaces/cloud';
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?: IProductData | null): Promise<void>;
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 { IProduct, IRetailerFulfillments } from '@/interfaces/cloud';
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
- fulfillments: IRetailerFulfillments[];
8
+ shippingFulfillment: IFulfillment | null;
9
+ onDemandFulfillment: IFulfillment | null;
9
10
  productUrl?: string;
10
11
  }
11
12
  export interface IProductAvailabilityData {
@@ -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
- currentFilters?: {
10
- personalized: boolean;
11
- preOrder: boolean;
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 { ICatalog, ICatalogParams, IProduct } from '@/interfaces/cloud';
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: ICatalogParams): Promise<ICatalog>;
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;