@liquidcommerce/elements-sdk 2.6.0-beta.2 → 2.6.0-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/README.md +7 -7
  2. package/dist/index.esm.js +11602 -11122
  3. package/dist/types/constants/core.constant.d.ts +11 -0
  4. package/dist/types/core/api/api-client.service.d.ts +15 -15
  5. package/dist/types/core/api/auth-client.service.d.ts +34 -23
  6. package/dist/types/core/api/http-client.service.d.ts +0 -1
  7. package/dist/types/core/client/client-action.service.d.ts +18 -12
  8. package/dist/types/core/client/client-config.service.d.ts +3 -0
  9. package/dist/types/core/command/base-command.service.d.ts +2 -2
  10. package/dist/types/core/command/common-command.service.d.ts +2 -1
  11. package/dist/types/core/google-tag-manager.service.d.ts +14 -11
  12. package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -12
  13. package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +27 -64
  14. package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +44 -50
  15. package/dist/types/core/pubsub/interfaces/core.interface.d.ts +5 -4
  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 -55
  19. package/dist/types/core/store/interfaces/checkout.interface.d.ts +16 -107
  20. package/dist/types/core/store/interfaces/core.interface.d.ts +7 -5
  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 +1 -1
  25. package/dist/types/enums/cloud.enum.d.ts +19 -76
  26. package/dist/types/enums/core.enum.d.ts +25 -0
  27. package/dist/types/interfaces/api/address.interface.d.ts +28 -0
  28. package/dist/types/interfaces/api/cart.interface.d.ts +95 -0
  29. package/dist/types/interfaces/api/checkout.interface.d.ts +213 -0
  30. package/dist/types/interfaces/api/product-list.interface.d.ts +30 -0
  31. package/dist/types/interfaces/api/product.interface.d.ts +106 -0
  32. package/dist/types/interfaces/configs/configurations.interface.d.ts +5 -5
  33. package/dist/types/interfaces/configs/product.interface.d.ts +1 -0
  34. package/dist/types/interfaces/core.interface.d.ts +7 -1
  35. package/dist/types/modules/address/address.command.d.ts +3 -3
  36. package/dist/types/modules/address/address.interface.d.ts +0 -7
  37. package/dist/types/modules/cart/cart.commands.d.ts +4 -5
  38. package/dist/types/modules/cart/components/cart-body.component.d.ts +2 -1
  39. package/dist/types/modules/cart/components/cart-footer.component.d.ts +0 -1
  40. package/dist/types/modules/cart/components/cart-fulfillment.component.d.ts +0 -2
  41. package/dist/types/modules/checkout/checkout.commands.d.ts +18 -9
  42. package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +2 -2
  43. package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
  44. package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +14 -1
  45. package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
  46. package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +2 -2
  47. package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
  48. package/dist/types/modules/checkout/constant.d.ts +3 -0
  49. package/dist/types/modules/product/components/components.d.ts +2 -4
  50. package/dist/types/modules/product/product.commands.d.ts +3 -2
  51. package/dist/types/modules/product-list/components/index.d.ts +2 -0
  52. package/dist/types/modules/product-list/components/product-list-card.component.d.ts +3 -2
  53. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +6 -0
  54. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +1 -0
  55. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts +7 -0
  56. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +16 -0
  57. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-price-filter.components.d.ts +22 -0
  58. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +16 -0
  59. package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +18 -0
  60. package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +27 -5
  61. package/dist/types/modules/product-list/product-list.commands.d.ts +4 -2
  62. package/dist/types/modules/product-list/product-list.component.d.ts +13 -5
  63. package/dist/types/modules/product-list/product-list.interface.d.ts +77 -0
  64. package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +1 -0
  65. package/dist/types/modules/ui-components/purchase-min-alert/index.d.ts +0 -1
  66. package/dist/types/static/icon/chevron-up.icon.d.ts +2 -0
  67. package/dist/types/static/icon/filter.icon.d.ts +2 -0
  68. package/dist/types/static/icon/index.d.ts +1 -0
  69. package/dist/types/utils/format.d.ts +0 -13
  70. package/docs/ACTIONS.md +13 -13
  71. package/docs/EVENTS.md +7 -7
  72. package/package.json +8 -9
  73. package/umd/elements.js +1 -1
  74. package/dist/types/interfaces/cloud/address.interface.d.ts +0 -36
  75. package/dist/types/interfaces/cloud/cart.interface.d.ts +0 -132
  76. package/dist/types/interfaces/cloud/catalog.interface.d.ts +0 -43
  77. package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -214
  78. package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
  79. package/dist/types/interfaces/cloud/index.d.ts +0 -7
  80. package/dist/types/interfaces/cloud/product.interface.d.ts +0 -158
  81. package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
  82. package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
  83. package/dist/types/modules/cart/cart.commands.helper.d.ts +0 -9
  84. package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
  85. package/dist/types/modules/product/utils/helpers.d.ts +0 -3
  86. package/dist/types/modules/product/utils/retailer-hours.d.ts +0 -9
  87. package/dist/types/modules/ui-components/purchase-min-alert/helpers.d.ts +0 -7
  88. package/dist/types/utils/helper.d.ts +0 -27
@@ -1,11 +1,18 @@
1
1
  import { BaseCommand } from '@/core/command/base-command.service';
2
- import type { ICheckoutBillingStore, ICheckoutCustomerStore, ICheckoutGiftRecipientStore, ICheckoutPaymentMethodStore } from '@/core/store/interfaces/checkout.interface';
2
+ import type { ICheckoutDetailsEventData } from '@/core/pubsub/interfaces/checkout.interface';
3
+ import type { ICheckoutPaymentMethodStore } from '@/core/store/interfaces/checkout.interface';
4
+ import type { ICheckoutBilling, ICheckoutCustomer, ICheckoutGiftRecipient } from '@/interfaces/api/checkout.interface';
5
+ import type { AddItemParams } from '@/modules/cart/cart.commands';
6
+ import type { PresaleExpiredReason } from '@/modules/checkout/components';
3
7
  export declare class CheckoutCommands extends BaseCommand {
4
8
  private readonly uiCommands;
5
- private readonly commonCommands;
6
9
  constructor();
7
10
  static getInstance(): CheckoutCommands;
8
- loadCheckout(cartIdParam?: string): Promise<void>;
11
+ addPresaleItem(params: AddItemParams): Promise<void>;
12
+ loadCheckout(params: {
13
+ customCartId?: string;
14
+ isForPresale?: boolean;
15
+ }): Promise<void>;
9
16
  toggleIsGift(active?: boolean): Promise<void>;
10
17
  toggleBillingSameAsShipping(active?: boolean): Promise<void>;
11
18
  toggleMarketingPreferences(fieldName: 'canEmail' | 'canSms', active?: boolean): Promise<void>;
@@ -17,7 +24,7 @@ export declare class CheckoutCommands extends BaseCommand {
17
24
  applyGiftCard(code: string): Promise<void>;
18
25
  removeGiftCard(code: string): Promise<void>;
19
26
  clearGiftCardError(): Promise<void>;
20
- openPresaleExpiredDrawer(): void;
27
+ openPresaleExpiredDrawer(reason?: PresaleExpiredReason): void;
21
28
  rerenderCheckout(): void;
22
29
  updateCheckoutItemQuantity(itemId: string, delta: number): Promise<void>;
23
30
  removeItemEngraving(productItemId: string): Promise<void>;
@@ -28,18 +35,18 @@ export declare class CheckoutCommands extends BaseCommand {
28
35
  clearCheckoutError(): Promise<void>;
29
36
  editCustomerForm(): Promise<void>;
30
37
  saveCustomerForm({ shippingAddressTwo, deliveryInstructions, customerData, }: {
31
- customerData: ICheckoutCustomerStore;
38
+ customerData: ICheckoutCustomer;
32
39
  shippingAddressTwo: string;
33
40
  deliveryInstructions: string;
34
41
  }): Promise<void>;
35
42
  editGiftRecipientForm(): Promise<void>;
36
- saveGiftRecipientForm({ shippingAddressTwo, deliveryInstructions, ...giftRecipientData }: ICheckoutGiftRecipientStore & {
43
+ saveGiftRecipientForm({ shippingAddressTwo, deliveryInstructions, ...giftRecipientData }: ICheckoutGiftRecipient & {
37
44
  shippingAddressTwo: string;
38
45
  deliveryInstructions: string;
39
46
  }): Promise<void>;
40
47
  editPaymentForm(): Promise<void>;
41
48
  savePaymentForm({ billingFormData, paymentSession, }: {
42
- billingFormData?: ICheckoutBillingStore;
49
+ billingFormData?: ICheckoutBilling;
43
50
  paymentSession?: {
44
51
  confirmationTokenId: string;
45
52
  setupIntentId: string;
@@ -47,7 +54,9 @@ export declare class CheckoutCommands extends BaseCommand {
47
54
  }): Promise<void>;
48
55
  checkoutComplete(): Promise<void>;
49
56
  private updateStoreFromCheckoutResponse;
50
- private partialLoadCheckout;
57
+ private syncFromItemUpdate;
58
+ private syncCheckoutState;
59
+ private refreshCheckout;
51
60
  private dataForCheckoutPrepare;
52
- private buildCheckoutItemStore;
61
+ getDetails(): ICheckoutDetailsEventData;
53
62
  }
@@ -1,8 +1,8 @@
1
1
  import { BaseComponent } from '@/core/base-component.service';
2
- import type { ICheckoutBillingStore } from '@/core/store/interfaces/checkout.interface';
2
+ import type { ICheckoutBilling } from '@/interfaces/api/checkout.interface';
3
3
  import type { ICheckoutComponent } from '@/interfaces/configs';
4
4
  export interface ICheckoutBillingComponentParams {
5
- isFormValid: (isValid: boolean, data: ICheckoutBillingStore) => void;
5
+ isFormValid: (isValid: boolean, data: ICheckoutBilling) => void;
6
6
  }
7
7
  export declare class CheckoutBillingComponent extends BaseComponent<ICheckoutBillingComponentParams, ICheckoutComponent> {
8
8
  private billingData;
@@ -1,14 +1,15 @@
1
1
  import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
2
  import type { ICheckoutComponent } from '@/interfaces/configs';
3
3
  export declare class CheckoutItemsComponent extends BaseComponent<null, ICheckoutComponent> {
4
+ private togglerElement;
5
+ private togglerButton;
6
+ private togglerLabel;
7
+ private itemsList;
4
8
  get hostClasses(): string[];
5
9
  constructor();
6
10
  private createItemElement;
7
- private getItemsListContainer;
8
- private getTogglerLabel;
9
11
  private getCurrentItemsMap;
10
12
  private syncItemsWithStore;
11
- private updateItemCount;
12
13
  onStoreChanged(changes: IOnStoreChanged[]): boolean | undefined;
13
14
  private handleToggle;
14
15
  private setupToggler;
@@ -1,8 +1,11 @@
1
1
  import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
2
2
  export declare class CheckoutPresaleCountdownComponent extends BaseComponent<null> {
3
+ private static readonly DEFAULT_PRESALE_DURATION_SECONDS;
4
+ private static readonly ONE_MINUTE_THRESHOLD_SECONDS;
5
+ private static readonly COUNTDOWN_UPDATE_INTERVAL_MS;
3
6
  private countdownInterval;
4
7
  private expiresAt;
5
- private totalDuration;
8
+ private initialDurationSeconds;
6
9
  private rootElement;
7
10
  private scrollHandler;
8
11
  private scrollContainer;
@@ -11,16 +14,26 @@ export declare class CheckoutPresaleCountdownComponent extends BaseComponent<nul
11
14
  get hostClasses(): string[];
12
15
  constructor();
13
16
  onStoreChanged(changes: IOnStoreChanged[]): boolean;
17
+ private resetCountdownState;
14
18
  protected afterRender(): void;
15
19
  protected disconnected(): void;
16
20
  private setupDrawerScrollDetection;
21
+ private findScrollContainer;
22
+ private setScrolledState;
17
23
  private isScrollable;
18
24
  private cleanupScrollListener;
19
25
  private updateExpiresAt;
20
26
  private startCountdown;
21
27
  private stopCountdown;
22
28
  private updateCountdown;
29
+ private updateWarningState;
30
+ private updateTimerDisplay;
31
+ private updateProgressBar;
23
32
  private formatTime;
24
33
  private handleExpire;
25
34
  protected template(): HTMLElement;
35
+ private createTextContainer;
36
+ private createHeader;
37
+ private createSubtitle;
38
+ private createProgressBar;
26
39
  }
@@ -1,11 +1,17 @@
1
1
  import { BaseComponent } from '@/core/base-component.service';
2
2
  import type { ICheckoutComponent } from '@/interfaces/configs';
3
- export declare class CheckoutPresaleExpiredComponent extends BaseComponent<null, ICheckoutComponent> {
3
+ export type PresaleExpiredReason = 'time_expired' | 'items_unavailable';
4
+ export interface ICheckoutPresaleExpiredComponentParams {
5
+ reason: PresaleExpiredReason;
6
+ }
7
+ export declare class CheckoutPresaleExpiredComponent extends BaseComponent<ICheckoutPresaleExpiredComponentParams, ICheckoutComponent> {
4
8
  private autoCloseInterval;
5
9
  private autoCloseSeconds;
6
10
  private autoCloseElement;
7
11
  get hostClasses(): string[];
8
12
  get hostAttributes(): Record<string, string>;
13
+ private isItemsUnavailable;
14
+ private isTimeExpired;
9
15
  protected afterRender(): void;
10
16
  protected disconnected(): void;
11
17
  private handleExit;
@@ -6,8 +6,8 @@ export declare class CheckoutTipsComponent extends BaseComponent<null, ICheckout
6
6
  constructor();
7
7
  protected afterRender(): void;
8
8
  private getTipSelection;
9
- private getOnDemandFulfillmentTipInfo;
10
- private getFulfillmentTipInfoArray;
9
+ private getOnDemandFulfillments;
10
+ private getRetailerNameForFulfillment;
11
11
  private handlePercentageSelect;
12
12
  private handleFulfillmentTipInput;
13
13
  private removeTipFromFulfillment;
@@ -7,8 +7,6 @@ export declare class CheckoutPcGcComponent extends BaseComponent<null, ICheckout
7
7
  onStoreWatch(changes: IOnStoreChanged[]): void;
8
8
  private updateAppliedGiftCards;
9
9
  private createAppliedGiftCardElement;
10
- private pcInputContainer;
11
- private gcInputContainer;
12
10
  private inputContainer;
13
11
  private createErrorElement;
14
12
  protected template(): HTMLElement[];
@@ -8,6 +8,7 @@ export declare const customerFormFields: {
8
8
  readonly addressTwo: "addressTwo";
9
9
  readonly company: "company";
10
10
  };
11
+ export type CustomerFieldName = (typeof customerFormFields)[keyof typeof customerFormFields];
11
12
  export declare const giftFormFields: {
12
13
  readonly firstName: "firstName";
13
14
  readonly lastName: "lastName";
@@ -16,6 +17,7 @@ export declare const giftFormFields: {
16
17
  readonly addressTwo: "addressTwo";
17
18
  readonly message: "message";
18
19
  };
20
+ export type GiftFieldName = (typeof giftFormFields)[keyof typeof giftFormFields];
19
21
  export declare const billingFormFields: {
20
22
  readonly firstName: "firstName";
21
23
  readonly lastName: "lastName";
@@ -28,3 +30,4 @@ export declare const billingFormFields: {
28
30
  readonly state: "state";
29
31
  readonly zipCode: "zipCode";
30
32
  };
33
+ export type BillingFieldName = (typeof billingFormFields)[keyof typeof billingFormFields];
@@ -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,16 +2,17 @@ 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;
9
9
  private readonly cartCommands;
10
+ private readonly checkoutCommands;
10
11
  constructor();
11
12
  static getInstance(): ProductCommands;
12
13
  createProductInstance(productId: string, firstTime?: boolean): Promise<void>;
13
14
  loadMultipleProducts(productIds: string[]): Promise<void>;
14
- loadProduct(productId: string, customProductData?: IProductData | null): Promise<void>;
15
+ loadProduct(productId: string, customProductData?: IProductAvailabilityResponse | null): Promise<void>;
15
16
  selectSize(productId: string, sizeId: string): Promise<void>;
16
17
  selectFulfillment(productId: string, selectedFulfillmentId: string): Promise<void>;
17
18
  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,14 @@
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;
8
+ private readonly checkoutCommands;
7
9
  constructor();
8
10
  static getInstance(): ProductListCommands;
9
- getProductList(params: ICatalogParams): Promise<ICatalog>;
11
+ getProductList(params: IProductSearchParams): Promise<IProductSearchResponse>;
10
12
  addToCart(params: AddItemParams): Promise<void>;
11
13
  addPresaleToCart(params: AddItemParams): Promise<void>;
12
14
  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
+ }
@@ -15,6 +15,7 @@ export declare class EngravingFormComponent extends BaseComponent<IEngravingForm
15
15
  private addToCartButton;
16
16
  private fulfillmentId;
17
17
  private partNumber;
18
+ private isPresale;
18
19
  beforeConnected(): void;
19
20
  private calculateTotalPrice;
20
21
  private productInformationSection;
@@ -1,2 +1 @@
1
- export * from './helpers';
2
1
  export * from './purchase-min-alert.component';
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './icon.types';
2
+ export declare const ChevronUpIcon: ({ width, height, className, color }: IconProps) => string;
@@ -0,0 +1,2 @@
1
+ import type { IconProps } from './icon.types';
2
+ export declare const FilterIcon: ({ width, height, className, color }: IconProps) => string;
@@ -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;