@liquidcommerce/elements-sdk 2.6.0-beta.11 → 2.6.0-beta.110
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 +99 -2518
- package/dist/index.checkout.esm.js +18210 -0
- package/dist/index.esm.js +26253 -20673
- package/dist/ssr-stub.checkout.esm.js +17 -0
- package/dist/ssr-stub.esm.js +269 -0
- package/dist/types/auto-initialize/checkout.d.ts +2 -0
- package/dist/types/auto-initialize/shared-utils.d.ts +50 -0
- package/dist/types/{elements-base-client.d.ts → clients/base.d.ts} +15 -2
- package/dist/types/clients/builder.d.ts +3 -0
- package/dist/types/clients/checkout.d.ts +6 -0
- package/dist/types/{elements-client-helper.d.ts → clients/helpers.d.ts} +2 -1
- package/dist/types/clients/main.d.ts +3 -0
- package/dist/types/constants/core.constant.d.ts +13 -18
- package/dist/types/core/a11y/announcer.service.d.ts +16 -0
- package/dist/types/core/a11y/focus-manager.service.d.ts +21 -0
- package/dist/types/core/a11y/focusable.d.ts +5 -0
- package/dist/types/core/a11y/glyph-button.d.ts +8 -0
- package/dist/types/core/a11y/index.d.ts +6 -0
- package/dist/types/core/a11y/required.d.ts +1 -0
- package/dist/types/core/a11y/single-select.d.ts +20 -0
- package/dist/types/core/api/api-client.service.d.ts +19 -18
- package/dist/types/core/api/api-result.d.ts +19 -0
- package/dist/types/core/api/auth-client.service.d.ts +37 -13
- package/dist/types/core/api/http-client.service.d.ts +0 -8
- package/dist/types/core/base-component.service.d.ts +4 -1
- package/dist/types/core/client/actions/base-action.service.d.ts +22 -0
- package/dist/types/core/client/actions/client-address-action.service.d.ts +18 -0
- package/dist/types/core/client/actions/client-cart-action.service.d.ts +38 -0
- package/dist/types/core/client/actions/client-checkout-action.service.d.ts +69 -0
- package/dist/types/core/client/actions/client-product-action.service.d.ts +15 -0
- package/dist/types/core/client/client-action.service.d.ts +6 -74
- package/dist/types/core/client/client-config.service.d.ts +8 -5
- package/dist/types/core/debug-panel/debug-panel.styles.d.ts +1 -1
- package/dist/types/core/google-tag-manager.service.d.ts +3 -1
- package/dist/types/core/logger/logger.service.d.ts +1 -1
- package/dist/types/core/pubsub/interfaces/address.interface.d.ts +3 -0
- package/dist/types/core/pubsub/interfaces/cart.interface.d.ts +1 -1
- package/dist/types/core/pubsub/interfaces/checkout.interface.d.ts +36 -51
- package/dist/types/core/pubsub/interfaces/core.interface.d.ts +11 -6
- package/dist/types/core/pubsub/pubsub.service.d.ts +1 -2
- package/dist/types/core/singleton-manager.service.d.ts +12 -8
- package/dist/types/core/store/interfaces/cart.interface.d.ts +2 -3
- package/dist/types/core/store/interfaces/checkout.interface.d.ts +19 -108
- package/dist/types/core/store/interfaces/core.interface.d.ts +12 -2
- package/dist/types/core/store/interfaces/metadata.interface.d.ts +11 -0
- package/dist/types/core/store/interfaces/product-list.interface.d.ts +30 -0
- package/dist/types/core/store/interfaces/product.interface.d.ts +1 -0
- package/dist/types/core/store/store.constant.d.ts +5 -0
- package/dist/types/core/store/store.service.d.ts +1 -0
- package/dist/types/core/telemetry/telemetry.service.d.ts +1 -0
- package/dist/types/enums/core.enum.d.ts +39 -2
- package/dist/types/enums/index.d.ts +0 -1
- package/dist/types/index.checkout.d.ts +8 -0
- package/dist/types/index.checkout.umd.d.ts +4 -0
- package/dist/types/index.d.ts +8 -3
- package/dist/types/interfaces/api/cart.interface.d.ts +12 -7
- package/dist/types/interfaces/api/checkout.interface.d.ts +239 -0
- package/dist/types/interfaces/api/index.d.ts +5 -0
- package/dist/types/interfaces/api/product-list.interface.d.ts +15 -6
- package/dist/types/interfaces/api/product.interface.d.ts +10 -4
- package/dist/types/interfaces/client.interface.d.ts +72 -0
- package/dist/types/interfaces/component.interface.d.ts +7 -0
- package/dist/types/interfaces/config.interface.d.ts +40 -0
- package/dist/types/interfaces/configs/address.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/cart.interface.d.ts +1 -1
- package/dist/types/interfaces/configs/checkout.interface.d.ts +2 -1
- package/dist/types/interfaces/configs/global.interface.d.ts +9 -3
- package/dist/types/interfaces/configs/index.d.ts +1 -0
- package/dist/types/interfaces/configs/product-list.interface.d.ts +49 -0
- package/dist/types/interfaces/configs/product.interface.d.ts +5 -1
- package/dist/types/interfaces/injection.interface.d.ts +50 -0
- package/dist/types/modules/address/address-display.component.d.ts +3 -1
- package/dist/types/modules/address/address-input.component.d.ts +10 -1
- package/dist/types/modules/address/address.command.d.ts +2 -1
- package/dist/types/modules/address/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/cart/cart.commands.d.ts +4 -4
- package/dist/types/modules/cart/components/cart-body.component.d.ts +1 -0
- package/dist/types/modules/cart/components/cart-item-quantity-price.component.d.ts +5 -0
- package/dist/types/modules/cart/components/cart-item.component.d.ts +6 -0
- package/dist/types/modules/cart/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/checkout/checkout.commands.d.ts +34 -11
- package/dist/types/modules/checkout/checkout.component.d.ts +6 -1
- package/dist/types/modules/checkout/components/checkout-billing.component.d.ts +5 -2
- package/dist/types/modules/checkout/components/checkout-completed.component.d.ts +5 -0
- package/dist/types/modules/checkout/components/checkout-header.component.d.ts +1 -0
- package/dist/types/modules/checkout/components/checkout-item-quantity.component.d.ts +4 -0
- package/dist/types/modules/checkout/components/checkout-items.component.d.ts +4 -3
- package/dist/types/modules/checkout/components/checkout-order-summary.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-payment.component.d.ts +2 -1
- package/dist/types/modules/checkout/components/checkout-place-order-button.component.d.ts +2 -0
- package/dist/types/modules/checkout/components/checkout-presale-countdown.component.d.ts +15 -1
- package/dist/types/modules/checkout/components/checkout-presale-expired.component.d.ts +7 -1
- package/dist/types/modules/checkout/components/checkout-send-as-gift.component.d.ts +3 -0
- package/dist/types/modules/checkout/components/checkout-stripe-form.component.d.ts +4 -2
- package/dist/types/modules/checkout/components/checkout-tips.component.d.ts +4 -2
- package/dist/types/modules/checkout/components/promo-pc-gc.component.d.ts +0 -2
- package/dist/types/modules/checkout/components/required-fields-legend.d.ts +1 -0
- package/dist/types/modules/checkout/constant.d.ts +3 -0
- package/dist/types/modules/checkout/payment-session-error.d.ts +4 -0
- package/dist/types/modules/checkout/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product/components/components.d.ts +26 -2
- package/dist/types/modules/product/components/product-add-to-cart-section.component.d.ts +7 -1
- package/dist/types/modules/product/components/product-description.component.d.ts +1 -0
- package/dist/types/modules/product/components/product-drawer.component.d.ts +6 -0
- package/dist/types/modules/product/components/product-image-carousel.component.d.ts +5 -0
- package/dist/types/modules/product/components/product-options.component.d.ts +2 -1
- package/dist/types/modules/product/components/product-retailers-carousel.component.d.ts +6 -0
- package/dist/types/modules/product/components/product-retailers-popup-list.component.d.ts +12 -2
- package/dist/types/modules/product/product.commands.d.ts +5 -5
- package/dist/types/modules/product/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/product-list/components/card-components/index.d.ts +5 -0
- package/dist/types/modules/product-list/components/card-components/product-badge.d.ts +9 -0
- package/dist/types/modules/product-list/components/card-components/product-button.d.ts +11 -0
- package/dist/types/modules/product-list/components/card-components/product-price-and-personalization.d.ts +14 -0
- package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts +11 -0
- package/dist/types/modules/product-list/components/card-components/product-sizes-list.d.ts +14 -0
- package/dist/types/modules/product-list/components/filter-components/index.d.ts +7 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-apply-filter-button.d.ts +1 -0
- package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-checkbox-filter.components.d.ts → filter-components/product-list-checkbox-filter.d.ts} +1 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-chip.d.ts +5 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts +13 -0
- package/dist/types/modules/product-list/components/filter-components/product-list-fulfillment-filter.d.ts +15 -0
- package/dist/types/modules/product-list/components/{product-list-filters-subcomponents/product-list-price-filter.components.d.ts → filter-components/product-list-price-filter.d.ts} +2 -1
- package/dist/types/modules/product-list/components/filter-components/product-list-toggle-filters.d.ts +7 -0
- package/dist/types/modules/product-list/components/index.d.ts +6 -2
- package/dist/types/modules/product-list/components/product-list-card-loading.component.d.ts +3 -1
- package/dist/types/modules/product-list/components/product-list-card.component.d.ts +37 -31
- package/dist/types/modules/product-list/components/product-list-engraving.component.d.ts +12 -0
- package/dist/types/modules/product-list/components/product-list-filters.component.d.ts +58 -36
- package/dist/types/modules/product-list/components/product-list-product-engraving-lines.component.d.ts +22 -0
- package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts +53 -0
- package/dist/types/modules/product-list/components/product-list-search.component.d.ts +25 -0
- package/dist/types/modules/product-list/product-list-filter.registry.d.ts +42 -0
- package/dist/types/modules/product-list/product-list-filter.utils.d.ts +7 -0
- package/dist/types/modules/product-list/product-list-order.utils.d.ts +3 -0
- package/dist/types/modules/product-list/product-list-query-params.utils.d.ts +3 -0
- package/dist/types/modules/product-list/product-list.commands.d.ts +22 -7
- package/dist/types/modules/product-list/product-list.component.d.ts +23 -47
- package/dist/types/modules/product-list/product-list.constants.d.ts +38 -0
- package/dist/types/modules/product-list/product-list.interface.d.ts +17 -28
- package/dist/types/modules/product-list/styles/product-list-card.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/product-list-filters.style.d.ts +1 -0
- package/dist/types/modules/product-list/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/component-groupings.d.ts +1 -0
- package/dist/types/modules/theme-provider/constants/css-variable-mappings.d.ts +1 -1
- package/dist/types/modules/theme-provider/services/style-registry.service.d.ts +16 -0
- package/dist/types/modules/theme-provider/services/stylesheet-generator.service.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/register-styles.d.ts +1 -0
- package/dist/types/modules/theme-provider/theme-provider.service.d.ts +2 -2
- package/dist/types/modules/ui-components/alert/alert.component.d.ts +1 -1
- package/dist/types/modules/ui-components/buttons/buttons-open-cart.component.d.ts +5 -0
- package/dist/types/modules/ui-components/drawer/drawer.component.d.ts +15 -0
- package/dist/types/modules/ui-components/engraving/engraving-form.component.d.ts +8 -1
- package/dist/types/modules/ui-components/engraving/engraving-view.component.d.ts +7 -1
- package/dist/types/modules/ui-components/input/index.d.ts +0 -1
- package/dist/types/modules/ui-components/input/input.component.d.ts +14 -1
- package/dist/types/modules/ui-components/lce-element/lce-element.component.d.ts +2 -1
- package/dist/types/modules/ui-components/promo-code-ticker/promo-code-ticker.component.d.ts +1 -1
- package/dist/types/modules/ui-components/ui.commands.d.ts +7 -1
- package/dist/types/ssr/stub.checkout.d.ts +6 -0
- package/dist/types/ssr/stub.d.ts +10 -0
- package/dist/types/static/icon/arrow-right.icon.d.ts +1 -1
- package/dist/types/static/icon/bag.icon.d.ts +1 -1
- package/dist/types/static/icon/check.icon.d.ts +2 -0
- package/dist/types/static/icon/checkbox.icon.d.ts +1 -1
- package/dist/types/static/icon/chevron-down.icon.d.ts +1 -1
- package/dist/types/static/icon/chevron-left.icon.d.ts +1 -1
- package/dist/types/static/icon/chevron-up.icon.d.ts +1 -1
- package/dist/types/static/icon/close.icon.d.ts +1 -1
- package/dist/types/static/icon/error-info.icon.d.ts +1 -1
- package/dist/types/static/icon/filter.icon.d.ts +1 -1
- package/dist/types/static/icon/icon.a11y.d.ts +1 -0
- package/dist/types/static/icon/icon.types.d.ts +1 -0
- package/dist/types/static/icon/index.d.ts +2 -0
- package/dist/types/static/icon/info.icon.d.ts +1 -1
- package/dist/types/static/icon/loading-spinner.icon.d.ts +1 -1
- package/dist/types/static/icon/search.icon.d.ts +1 -1
- package/dist/types/static/icon/success.icon.d.ts +1 -1
- package/dist/types/static/icon/trash.icon.d.ts +1 -1
- package/dist/types/static/icon/warning.icon.d.ts +1 -1
- package/dist/types/utils/dom-compat.d.ts +2 -0
- package/dist/types/utils/format.d.ts +5 -14
- package/dist/types/utils/image-bg-removal.d.ts +3 -0
- package/dist/types/utils/product-selection.d.ts +16 -0
- package/dist/types/utils/product.d.ts +18 -0
- package/dist/types/utils/timezone.d.ts +6 -0
- package/docs/v1/README.md +213 -0
- package/docs/v1/api/actions/address-actions.md +286 -0
- package/docs/v1/api/actions/cart-actions.md +364 -0
- package/docs/v1/api/actions/checkout-actions.md +527 -0
- package/docs/v1/api/actions/product-actions.md +204 -0
- package/docs/v1/api/client.md +596 -0
- package/docs/v1/api/configuration.md +557 -0
- package/docs/v1/api/injection-methods.md +331 -0
- package/docs/v1/api/typescript-types.md +424 -0
- package/docs/v1/api/ui-helpers.md +200 -0
- package/docs/v1/examples/advanced-patterns.md +199 -0
- package/docs/v1/examples/checkout-flow.md +90 -0
- package/docs/v1/examples/custom-theming.md +63 -0
- package/docs/v1/examples/multi-product-page.md +90 -0
- package/docs/v1/examples/simple-product-page.md +89 -0
- package/docs/v1/getting-started/concepts.md +521 -0
- package/docs/v1/getting-started/installation.md +349 -0
- package/docs/v1/getting-started/quick-start.md +410 -0
- package/docs/v1/guides/accessibility.md +214 -0
- package/docs/v1/guides/address-component.md +435 -0
- package/docs/v1/guides/best-practices.md +365 -0
- package/docs/v1/guides/cart-component.md +757 -0
- package/docs/v1/guides/checkout-component.md +670 -0
- package/docs/v1/guides/events.md +939 -0
- package/docs/v1/guides/product-component.md +736 -0
- package/docs/v1/guides/product-list-component.md +730 -0
- package/docs/v1/guides/theming.md +229 -0
- package/docs/v1/integration/angular.md +39 -0
- package/docs/v1/integration/laravel.md +41 -0
- package/docs/v1/integration/nextjs.md +69 -0
- package/docs/v1/integration/proxy-setup.md +106 -0
- package/docs/v1/integration/react.md +64 -0
- package/docs/v1/integration/vanilla-js.md +84 -0
- package/docs/v1/integration/vue.md +58 -0
- package/docs/v1/reference/analytics.md +107 -0
- package/docs/v1/reference/browser-support.md +47 -0
- package/docs/v1/reference/error-handling.md +83 -0
- package/docs/v1/reference/performance.md +52 -0
- package/docs/v1/reference/telemetry.md +85 -0
- package/docs/v1/reference/troubleshooting.md +135 -0
- package/package.json +75 -45
- package/dist/types/elements-builder-client.d.ts +0 -2
- package/dist/types/elements-client.d.ts +0 -2
- package/dist/types/enums/cloud.enum.d.ts +0 -97
- package/dist/types/interfaces/cloud/checkout.interface.d.ts +0 -218
- package/dist/types/interfaces/cloud/core.interface.d.ts +0 -22
- package/dist/types/interfaces/cloud/index.d.ts +0 -3
- package/dist/types/interfaces/cloud/retailer.interface.d.ts +0 -67
- package/dist/types/interfaces/cloud/user.interface.d.ts +0 -100
- package/dist/types/interfaces/core.interface.d.ts +0 -111
- package/dist/types/modules/checkout/components/checkout.type.d.ts +0 -4
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/index.d.ts +0 -6
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-apply-filter-button.component.d.ts +0 -1
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-delivery-options-filter.components.d.ts +0 -16
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-search.component.d.ts +0 -16
- package/dist/types/modules/product-list/components/product-list-filters-subcomponents/product-list-toggle-filters.components.d.ts +0 -18
- package/dist/types/modules/theme-provider/styles/address/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/cart/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/checkout/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/product/index.d.ts +0 -3
- package/dist/types/modules/theme-provider/styles/product-list/index.d.ts +0 -1
- package/dist/types/modules/theme-provider/styles/ui/index.d.ts +0 -3
- package/dist/types/modules/ui-components/input/birthdate-input.component.d.ts +0 -53
- package/dist/types/utils/helper.d.ts +0 -28
- package/docs/ACTIONS.md +0 -1300
- package/docs/BROWSER_SUPPORT.md +0 -279
- package/docs/CONFIGURATION.md +0 -853
- package/docs/DOCUMENTATION_INDEX.md +0 -311
- package/docs/EVENTS.md +0 -798
- package/docs/PROXY.md +0 -228
- package/docs/THEMING.md +0 -592
- package/docs/TROUBLESHOOTING.md +0 -793
- package/umd/elements.js +0 -1
- /package/dist/types/{auto-initialize.d.ts → auto-initialize/main.d.ts} +0 -0
- /package/dist/types/modules/{theme-provider/styles/address → address/styles}/address.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/cart → cart/styles}/cart.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/checkout → checkout/styles}/checkout.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/image-carousel.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/product.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product → product/styles}/retailers.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/product-list → product-list/styles}/product-list.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/drawer.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/loading.style.d.ts +0 -0
- /package/dist/types/modules/{theme-provider/styles/ui → ui-components/styles}/promo-code-ticker.style.d.ts +0 -0
|
@@ -8,19 +8,25 @@ export declare class ProductRetailersCarouselComponent extends BaseComponent<IPr
|
|
|
8
8
|
private listViewport;
|
|
9
9
|
private listContainer;
|
|
10
10
|
private retailerCards;
|
|
11
|
+
private pendingTabFocus;
|
|
11
12
|
private isDragging;
|
|
12
13
|
private hasMoved;
|
|
13
14
|
private startX;
|
|
14
15
|
private currentTranslateX;
|
|
15
16
|
private translateX;
|
|
17
|
+
private boundDragMove;
|
|
18
|
+
private boundDragEnd;
|
|
16
19
|
constructor();
|
|
17
20
|
afterRender(): void;
|
|
18
21
|
private cacheElements;
|
|
19
22
|
private getProductId;
|
|
23
|
+
private get instanceIdPrefix();
|
|
24
|
+
private selectedSizeAttributes;
|
|
20
25
|
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
21
26
|
private updateSelectedCard;
|
|
22
27
|
private scrollToIndex;
|
|
23
28
|
private setupDrag;
|
|
29
|
+
protected disconnected(): void;
|
|
24
30
|
private handleDragStart;
|
|
25
31
|
private handleDragMove;
|
|
26
32
|
private handleDragEnd;
|
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import { type NavigationSourceType } from '@/enums';
|
|
2
3
|
import type { IProductComponent } from '@/interfaces/configs';
|
|
3
4
|
export interface IProductRetailersPopupListComponentParams {
|
|
4
5
|
productId: string;
|
|
6
|
+
navigationSource: NavigationSourceType;
|
|
7
|
+
slug?: string;
|
|
5
8
|
}
|
|
6
9
|
export declare class ProductRetailersPopupListComponent extends BaseComponent<IProductRetailersPopupListComponentParams, IProductComponent> {
|
|
7
10
|
get hostClasses(): string[];
|
|
8
|
-
|
|
9
|
-
private
|
|
11
|
+
private get isProductContext();
|
|
12
|
+
private get instanceIdPrefix();
|
|
13
|
+
private productPath;
|
|
14
|
+
beforeSetupStoreWatchers(): void;
|
|
15
|
+
private pendingTabFocus;
|
|
16
|
+
protected afterRender(): void;
|
|
10
17
|
private onFulfillmentTabClick;
|
|
18
|
+
private selectedSizeAttributes;
|
|
19
|
+
private announceSelectedFulfillment;
|
|
20
|
+
private announceFulfillmentTypeChange;
|
|
11
21
|
private onRetailerCardClick;
|
|
12
22
|
protected template(): HTMLElement[];
|
|
13
23
|
}
|
|
@@ -7,22 +7,22 @@ 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
15
|
loadProduct(productId: string, customProductData?: IProductAvailabilityResponse | null): Promise<void>;
|
|
16
|
+
cacheProductFromApiData(identifier: string, apiData: IProductAvailabilityResponse): void;
|
|
15
17
|
selectSize(productId: string, sizeId: string): Promise<void>;
|
|
16
18
|
selectFulfillment(productId: string, selectedFulfillmentId: string): Promise<void>;
|
|
17
19
|
updateQuantity(productId: string, delta: number): Promise<void>;
|
|
18
|
-
changeFulfillmentType(productId: string,
|
|
20
|
+
changeFulfillmentType(productId: string, newFulfillmentType: FulfillmentType): Promise<void>;
|
|
19
21
|
removeProduct(productId: string): Promise<void>;
|
|
20
|
-
openProductDrawer(productId: string, contentType: IProductDrawerContentConfig['type'], data?: Record<string, any
|
|
22
|
+
openProductDrawer(productId: string, contentType: IProductDrawerContentConfig['type'], data?: Record<string, any>, trigger?: HTMLElement | null): Promise<void>;
|
|
21
23
|
closeProductDrawer(productId: string): Promise<void>;
|
|
22
24
|
rerenderAllProducts(): Promise<void>;
|
|
23
|
-
addToCart(productId: string, params: AddItemParams): Promise<void>;
|
|
25
|
+
addToCart(productId: string, params: AddItemParams, trigger?: HTMLElement | null): Promise<void>;
|
|
24
26
|
addPresaleToCart(productId: string, params: AddItemParams): Promise<void>;
|
|
25
27
|
productDataForEventFromStore(identifier: string): IBaseProductEventData;
|
|
26
|
-
private findFirstAvailableSize;
|
|
27
|
-
private loadProductStoreUpdate;
|
|
28
28
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface IBadgesParams {
|
|
2
|
+
badges: Array<{
|
|
3
|
+
text: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
}>;
|
|
6
|
+
separatorText?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const createProductBadge: (name: string, className?: string) => HTMLElement;
|
|
9
|
+
export declare const createProductBadges: ({ badges, separatorText }: IBadgesParams) => HTMLElement;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface IAddToCartButtonState {
|
|
2
|
+
isPresale: boolean;
|
|
3
|
+
hasAvailability: boolean;
|
|
4
|
+
hasAddress: boolean;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface IAddToCartButtonParams extends IAddToCartButtonState {
|
|
8
|
+
onClick?: (e: MouseEvent) => void | Promise<void>;
|
|
9
|
+
}
|
|
10
|
+
export declare const applyAddToCartButtonState: (button: HTMLButtonElement, state: IAddToCartButtonState) => void;
|
|
11
|
+
export declare const createAddToCartButton: ({ isPresale, hasAvailability, disabled, hasAddress, onClick, }: IAddToCartButtonParams) => HTMLButtonElement;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface IPricePersonalizationSectionParams {
|
|
2
|
+
price: number;
|
|
3
|
+
showPrice: boolean;
|
|
4
|
+
hasPersonalization: boolean;
|
|
5
|
+
showPersonalization: boolean;
|
|
6
|
+
hasAddress: boolean;
|
|
7
|
+
wrapperClassName?: string;
|
|
8
|
+
priceClassName?: string;
|
|
9
|
+
personalizeClassName?: string;
|
|
10
|
+
personalizeText?: string;
|
|
11
|
+
productName?: string;
|
|
12
|
+
onPersonalizeClick?: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const createPricePersonalizationSection: ({ price, showPrice, hasPersonalization, showPersonalization, hasAddress, wrapperClassName, priceClassName, personalizeClassName, personalizeText, productName, onPersonalizeClick, }: IPricePersonalizationSectionParams) => HTMLElement | null;
|
package/dist/types/modules/product-list/components/card-components/product-quantity-selector.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PLCCardStyle } from '@/interfaces/configs/product-list.interface';
|
|
2
|
+
export interface IQuantitySelectorParams {
|
|
3
|
+
initialQuantity: number;
|
|
4
|
+
minQuantity: number;
|
|
5
|
+
maxQuantity: number;
|
|
6
|
+
cardStyle: PLCCardStyle;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
productName?: string;
|
|
9
|
+
onChange: (quantity: number) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const createQuantitySelector: ({ initialQuantity, minQuantity, maxQuantity, cardStyle, disabled, productName, onChange, }: IQuantitySelectorParams) => HTMLElement;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { IProductSizeStore } from '@/core/store/interfaces/product.interface';
|
|
3
|
+
export interface IProductListSizeSelectorParams {
|
|
4
|
+
sizes: Record<string, IProductSizeStore>;
|
|
5
|
+
selectedSizeId: string | null;
|
|
6
|
+
onSelect?: (size: IProductSizeStore) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare class ProductListSizeSelectorComponent extends BaseComponent<IProductListSizeSelectorParams> {
|
|
9
|
+
private onOutsideClick;
|
|
10
|
+
private readonly uid;
|
|
11
|
+
get hostClasses(): string[];
|
|
12
|
+
protected disconnected?(): void;
|
|
13
|
+
protected template(): HTMLElement[];
|
|
14
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './product-list-apply-filter-button';
|
|
2
|
+
export * from './product-list-checkbox-filter';
|
|
3
|
+
export * from './product-list-chip';
|
|
4
|
+
export * from './product-list-filters-chips';
|
|
5
|
+
export * from './product-list-fulfillment-filter';
|
|
6
|
+
export * from './product-list-price-filter';
|
|
7
|
+
export * from './product-list-toggle-filters';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function createApplyFiltersButton(onApplyFilters: VoidFunction): HTMLElement;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ICheckboxLabelStates, ICreateCheckboxFilterHeaderParams, ICreateCheckboxFilterSearchContainerParams, ICreateCheckboxItemParams, IHandleCheckboxFilterSearchParams, IRenderCheckboxItemsParams } from '../../product-list.interface';
|
|
2
2
|
export declare function createCheckboxItem(params: ICreateCheckboxItemParams): HTMLElement;
|
|
3
3
|
export declare function handleCheckboxFilterSearch(params: IHandleCheckboxFilterSearchParams): void;
|
|
4
|
+
export declare function checkboxFilterContentId(filterType: string): string;
|
|
4
5
|
export declare function createCheckboxFilterHeader(params: ICreateCheckboxFilterHeaderParams): HTMLElement;
|
|
5
6
|
export declare function createCheckboxFilterSearchContainer(params: ICreateCheckboxFilterSearchContainerParams): HTMLElement;
|
|
6
7
|
export declare function renderCheckboxItems(params: IRenderCheckboxItemsParams): void;
|
package/dist/types/modules/product-list/components/filter-components/product-list-filters-chips.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IExtendedFilterSchema, IProductListFilters } from '@/modules/product-list/product-list.interface';
|
|
2
|
+
export interface ICreateChipsContainerParams {
|
|
3
|
+
currentFilters?: IProductListFilters;
|
|
4
|
+
sanitizedFilters?: IExtendedFilterSchema[];
|
|
5
|
+
onRemoveFilter: (key: string, value: string) => void;
|
|
6
|
+
onClearAllFilters: VoidFunction;
|
|
7
|
+
}
|
|
8
|
+
export interface IActiveFilter {
|
|
9
|
+
key: string;
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function createChipsContainer(params: ICreateChipsContainerParams): HTMLElement;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FULFILLMENT_OPTIONS } from '@/modules/product-list/product-list.constants';
|
|
2
|
+
import type { IProductListFilters } from '@/modules/product-list/product-list.interface';
|
|
3
|
+
export interface ICreateFulfillmentFilterParams {
|
|
4
|
+
currentFilters?: IProductListFilters;
|
|
5
|
+
deliveryCollapsed: boolean;
|
|
6
|
+
isSameDayDeliveryDisabled: boolean;
|
|
7
|
+
onFulfillmentOptionsChange?: (value: typeof FULFILLMENT_OPTIONS.ALL | typeof FULFILLMENT_OPTIONS.SHIPPING | typeof FULFILLMENT_OPTIONS.ON_DEMAND) => void;
|
|
8
|
+
onToggleCollapse: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function createFulfillmentFilter(params: ICreateFulfillmentFilterParams): {
|
|
11
|
+
elements: HTMLElement[];
|
|
12
|
+
chevronContainer: HTMLElement;
|
|
13
|
+
fulfillmentList: HTMLElement;
|
|
14
|
+
headerButton: HTMLButtonElement;
|
|
15
|
+
};
|
|
@@ -11,7 +11,7 @@ export interface ICreatePriceFilterParams {
|
|
|
11
11
|
};
|
|
12
12
|
priceCollapsed: boolean;
|
|
13
13
|
onPriceChange?: (min: string, max: string) => void;
|
|
14
|
-
onToggleCollapse:
|
|
14
|
+
onToggleCollapse: VoidFunction;
|
|
15
15
|
DEFAULT_MIN: string;
|
|
16
16
|
DEFAULT_MAX: string;
|
|
17
17
|
}
|
|
@@ -19,4 +19,5 @@ export declare function createPriceFilter(params: ICreatePriceFilterParams): {
|
|
|
19
19
|
elements: HTMLElement[];
|
|
20
20
|
chevronContainer: HTMLElement;
|
|
21
21
|
sliderContainer: HTMLElement;
|
|
22
|
+
headerButton: HTMLButtonElement;
|
|
22
23
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IProductListFilters } from '@/modules/product-list/product-list.interface';
|
|
2
|
+
export interface ICreateEngravingFilterParams {
|
|
3
|
+
currentFilters?: IProductListFilters;
|
|
4
|
+
isPersonalizationDisabled: boolean;
|
|
5
|
+
onEngravingChange?: (enabled: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function createEngravingFilter(params: ICreateEngravingFilterParams): HTMLElement[];
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
export * from './filter-components';
|
|
2
|
+
export * from './filter-components/product-list-apply-filter-button';
|
|
1
3
|
export * from './product-list-card.component';
|
|
2
4
|
export * from './product-list-card-loading.component';
|
|
5
|
+
export * from './product-list-engraving.component';
|
|
3
6
|
export * from './product-list-filters.component';
|
|
4
|
-
export * from './product-list-
|
|
5
|
-
export * from './product-list-
|
|
7
|
+
export * from './product-list-product-engraving-lines.component';
|
|
8
|
+
export * from './product-list-product-pre-cart.component';
|
|
9
|
+
export * from './product-list-search.component';
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { IProductListComponent } from '@/interfaces/configs';
|
|
2
3
|
import type { IProductListComponentParams } from '@/modules/product-list/product-list.component';
|
|
3
|
-
export declare class ProductListCardLoadingComponent extends BaseComponent<IProductListComponentParams> {
|
|
4
|
+
export declare class ProductListCardLoadingComponent extends BaseComponent<IProductListComponentParams, IProductListComponent> {
|
|
4
5
|
get hostClasses(): string[];
|
|
6
|
+
protected get hostAttributes(): Record<string, string>;
|
|
5
7
|
private createSkeletonCard;
|
|
6
8
|
protected template(): HTMLElement[];
|
|
7
9
|
}
|
|
@@ -1,37 +1,43 @@
|
|
|
1
|
-
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
1
|
+
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
2
|
+
import type { IProductListComponent } from '@/interfaces/configs';
|
|
3
|
+
import type { PLCProductUrl } from '@/interfaces/configs/product-list.interface';
|
|
4
4
|
export interface IProductListCardParams {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
shippingFulfillment: IFulfillment | null;
|
|
9
|
-
onDemandFulfillment: IFulfillment | null;
|
|
10
|
-
productUrl?: string;
|
|
5
|
+
slug: string;
|
|
6
|
+
productId: string;
|
|
7
|
+
productUrl?: PLCProductUrl;
|
|
11
8
|
}
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
name: string;
|
|
25
|
-
size: string | null;
|
|
26
|
-
price: number;
|
|
27
|
-
availability: IProductAvailabilityData;
|
|
28
|
-
}
|
|
29
|
-
export declare class ProductListCardComponent extends BaseComponent<IProductListCardParams> {
|
|
9
|
+
export declare class ProductListCardComponent extends BaseComponent<IProductListCardParams, IProductListComponent> {
|
|
10
|
+
private imageElement;
|
|
11
|
+
private priceElement;
|
|
12
|
+
private personalizeElement;
|
|
13
|
+
private fulfillmentTextElement;
|
|
14
|
+
private fulfillmentWrapperElement;
|
|
15
|
+
private addToCartButton;
|
|
16
|
+
private noAvailabilityElement;
|
|
17
|
+
private previousSelectedSizeId;
|
|
18
|
+
private previousSelectedFulfillmentId;
|
|
19
|
+
constructor();
|
|
20
|
+
private getListConfig;
|
|
30
21
|
get hostClasses(): string[];
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
protected beforeConnected(): void;
|
|
23
|
+
protected disconnected?(): void;
|
|
24
|
+
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
25
|
+
private getSelectedSize;
|
|
26
|
+
private getDisplayPrice;
|
|
34
27
|
protected template(): HTMLElement[];
|
|
28
|
+
protected afterRender(): void;
|
|
29
|
+
private updatePriceDisplay;
|
|
30
|
+
private updateFulfillmentText;
|
|
31
|
+
private updateImage;
|
|
32
|
+
private updatePersonalizeVisibility;
|
|
33
|
+
private updateAddToCartButton;
|
|
34
|
+
private syncFulfillmentWrapperContent;
|
|
35
35
|
private generateProductUrl;
|
|
36
|
-
private
|
|
36
|
+
private createImageSection;
|
|
37
|
+
private createContentSection;
|
|
38
|
+
private createNoAvailabilityMessage;
|
|
39
|
+
private createFulfillmentSectionWrapper;
|
|
40
|
+
private createDeliveryOptionsButton;
|
|
41
|
+
private createFulfillmentTextSection;
|
|
42
|
+
private createAddToCartSection;
|
|
37
43
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { IProductListComponent } from '@/interfaces/configs';
|
|
3
|
+
import type { IEngravingFormComponentParams } from '@/modules/ui-components/engraving';
|
|
4
|
+
interface IProductListEngravingParams extends IEngravingFormComponentParams {
|
|
5
|
+
slug: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class ProductListEngravingComponent extends BaseComponent<IProductListEngravingParams, IProductListComponent> {
|
|
8
|
+
private getListConfig;
|
|
9
|
+
protected template(): HTMLElement[];
|
|
10
|
+
private createHeader;
|
|
11
|
+
}
|
|
12
|
+
export {};
|
|
@@ -1,43 +1,65 @@
|
|
|
1
1
|
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ProductListFilterType } from '@/interfaces/injection.interface';
|
|
3
3
|
export interface IProductListFiltersParams {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
enableDeliveryOptions: boolean;
|
|
7
|
-
sanitizedFilters?: IExtendedFilterSchema[];
|
|
8
|
-
currentFilters?: ICurrentFilters;
|
|
9
|
-
priceConfig?: IPriceConfig;
|
|
10
|
-
isDrawerMode?: boolean;
|
|
11
|
-
onPersonalizedChange?: (enabled: boolean) => void;
|
|
12
|
-
onPreOrderChange?: (enabled: boolean) => void;
|
|
13
|
-
onDeliveryOptionsChange?: (value: 'all' | 'shipping' | 'onDemand') => void;
|
|
14
|
-
onPriceChange?: (min: string, max: string) => void;
|
|
15
|
-
onCheckboxFilterChange?: (category: string, selectedValues: string[]) => void;
|
|
16
|
-
onApplyFilters?: () => void;
|
|
4
|
+
slug: string;
|
|
5
|
+
filters: ProductListFilterType[];
|
|
17
6
|
}
|
|
18
7
|
export declare class ProductListFiltersComponent extends BaseComponent<IProductListFiltersParams> {
|
|
19
|
-
private
|
|
20
|
-
private
|
|
21
|
-
private
|
|
22
|
-
private
|
|
23
|
-
private
|
|
24
|
-
private
|
|
25
|
-
private
|
|
26
|
-
private
|
|
27
|
-
private
|
|
8
|
+
private readonly FILTER_DEBOUNCE_DELAY_MS;
|
|
9
|
+
private isRenderedInDrawerMode;
|
|
10
|
+
private permanentFilters;
|
|
11
|
+
private availableDynamicFilters;
|
|
12
|
+
private checkboxFilterStateMap;
|
|
13
|
+
private isPriceFilterCollapsed;
|
|
14
|
+
private isFulfillmentFilterCollapsed;
|
|
15
|
+
private appliedFiltersChipsContainer;
|
|
16
|
+
private filterSectionsContainer?;
|
|
17
|
+
private filterButtonContainer?;
|
|
18
|
+
private fulfillmentOptionsList?;
|
|
19
|
+
private priceFilterChevronIcon?;
|
|
20
|
+
private fulfillmentFilterChevronIcon?;
|
|
21
|
+
private priceSliderWrapper?;
|
|
22
|
+
private priceFilterHeaderButton;
|
|
23
|
+
private boundDrawerClosedHandler;
|
|
24
|
+
private priceFilterDebounceTimer;
|
|
25
|
+
constructor();
|
|
28
26
|
get hostClasses(): string[];
|
|
29
|
-
|
|
30
|
-
private
|
|
31
|
-
|
|
32
|
-
private
|
|
33
|
-
|
|
34
|
-
private
|
|
35
|
-
private
|
|
36
|
-
private
|
|
37
|
-
private
|
|
38
|
-
private
|
|
39
|
-
private
|
|
40
|
-
private
|
|
41
|
-
private
|
|
27
|
+
protected connected(): Promise<void>;
|
|
28
|
+
private setupDrawerCloseListener;
|
|
29
|
+
protected disconnected(): void;
|
|
30
|
+
private detectIfRenderedInDrawer;
|
|
31
|
+
onStoreWatch(): void;
|
|
32
|
+
private syncFiltersFromStore;
|
|
33
|
+
private createFilterSection;
|
|
34
|
+
private rebuildContainer;
|
|
35
|
+
private refreshUIStates;
|
|
36
|
+
private buildFilterSections;
|
|
37
|
+
private refreshFilterButtonVisibility;
|
|
38
|
+
private fetchFilters;
|
|
39
|
+
private applyFiltersAndCloseDrawer;
|
|
42
40
|
protected template(): HTMLElement[];
|
|
41
|
+
private buildFilterButton;
|
|
42
|
+
private openFilterDrawer;
|
|
43
|
+
private buildFilterHeader;
|
|
44
|
+
private clearAllActiveFilters;
|
|
45
|
+
private removeSingleFilter;
|
|
46
|
+
private removeFacetValue;
|
|
47
|
+
private getFilteredAndSanitizedFilters;
|
|
48
|
+
private isFilterConfigured;
|
|
49
|
+
private hasVisibleFilters;
|
|
50
|
+
private buildAppliedFiltersChipsContainer;
|
|
51
|
+
private handleFilterChange;
|
|
52
|
+
private isEngravingCurrentlyDisabled;
|
|
53
|
+
private buildEngravingFilterElements;
|
|
54
|
+
private isSameDayDeliveryCurrentlyDisabled;
|
|
55
|
+
private fulfillmentFilterHeaderButton;
|
|
56
|
+
private toggleFulfillmentFilterCollapse;
|
|
57
|
+
private buildFulfillmentFilterElements;
|
|
58
|
+
private togglePriceFilterCollapse;
|
|
59
|
+
private buildPriceFilterElements;
|
|
60
|
+
private buildDynamicFiltersElements;
|
|
61
|
+
private buildCheckboxFilterElements;
|
|
62
|
+
private toggleCheckboxFilterExpansion;
|
|
63
|
+
private renderCheckboxItemsForFilter;
|
|
64
|
+
private handleCheckboxSelectionChange;
|
|
43
65
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { IProductListComponent } from '@/interfaces/configs';
|
|
3
|
+
export interface IProductListProductEngravingLinesComponentParams {
|
|
4
|
+
slug: string;
|
|
5
|
+
identifier: string;
|
|
6
|
+
lines: string[];
|
|
7
|
+
maxLines: number;
|
|
8
|
+
maxCharsPerLine: number;
|
|
9
|
+
location?: string;
|
|
10
|
+
fee: number;
|
|
11
|
+
}
|
|
12
|
+
export declare class ProductListProductEngravingLinesComponent extends BaseComponent<IProductListProductEngravingLinesComponentParams, IProductListComponent> {
|
|
13
|
+
private engravingLines;
|
|
14
|
+
private addEngravingButton;
|
|
15
|
+
constructor();
|
|
16
|
+
protected disconnected?(): void;
|
|
17
|
+
template(): HTMLElement;
|
|
18
|
+
private engravingLinesSection;
|
|
19
|
+
private actionButtonsSection;
|
|
20
|
+
private calculateTotalPrice;
|
|
21
|
+
private addToCartButtonText;
|
|
22
|
+
}
|
package/dist/types/modules/product-list/components/product-list-product-pre-cart.component.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { BaseComponent, type IOnStoreChanged } from '@/core/base-component.service';
|
|
2
|
+
import type { IProductListComponent } from '@/interfaces/configs';
|
|
3
|
+
export interface IProductListProductPreCartComponentParams {
|
|
4
|
+
slug: string;
|
|
5
|
+
productId: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class ProductListProductPreCartComponent extends BaseComponent<IProductListProductPreCartComponentParams, IProductListComponent> {
|
|
8
|
+
get hostClasses(): string[];
|
|
9
|
+
private showRetailersContent;
|
|
10
|
+
private showEngravingForm;
|
|
11
|
+
private isInitialRender;
|
|
12
|
+
private priceElement;
|
|
13
|
+
private imageElement;
|
|
14
|
+
private fulfillmentTextElement;
|
|
15
|
+
private addToCartButton;
|
|
16
|
+
private personalizeElement;
|
|
17
|
+
private previousSelectedSizeId;
|
|
18
|
+
private previousSelectedFulfillmentId;
|
|
19
|
+
constructor();
|
|
20
|
+
private getListConfig;
|
|
21
|
+
protected connected?(): void;
|
|
22
|
+
private pendingViewFocus;
|
|
23
|
+
private handleRetailersBack;
|
|
24
|
+
private handleEngravingBack;
|
|
25
|
+
private handleEngravingEdit;
|
|
26
|
+
protected afterRender(): void;
|
|
27
|
+
protected disconnected?(): void;
|
|
28
|
+
private getSelectedSize;
|
|
29
|
+
onStoreWatch(changes: IOnStoreChanged[]): void;
|
|
30
|
+
private updatePriceDisplay;
|
|
31
|
+
private updateFulfillmentText;
|
|
32
|
+
private updateImage;
|
|
33
|
+
private updatePersonalizeVisibility;
|
|
34
|
+
private updateAddToCartButton;
|
|
35
|
+
private getEngravingFee;
|
|
36
|
+
protected beforeConnected(): void;
|
|
37
|
+
protected template(): HTMLElement[];
|
|
38
|
+
private createAnimatedContentElement;
|
|
39
|
+
private buildLayout;
|
|
40
|
+
private createEngravingFormContent;
|
|
41
|
+
private renderPreCartContent;
|
|
42
|
+
private createDeliversToSectionWrapper;
|
|
43
|
+
private createShippingFromSectionWrapper;
|
|
44
|
+
private createDescriptionSection;
|
|
45
|
+
private createCartHeader;
|
|
46
|
+
private createImageSection;
|
|
47
|
+
private createPricePersonalizationSection;
|
|
48
|
+
private createDeliversToSection;
|
|
49
|
+
private createFulfillmentSectionWrapper;
|
|
50
|
+
private createFulfillmentTextSection;
|
|
51
|
+
private createAddToCartSection;
|
|
52
|
+
private handleAddToCart;
|
|
53
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BaseComponent } from '@/core/base-component.service';
|
|
2
|
+
import type { ProductListFilterType } from '@/interfaces/injection.interface';
|
|
3
|
+
export interface IProductListSearchParams {
|
|
4
|
+
slug: string;
|
|
5
|
+
filters?: ProductListFilterType[];
|
|
6
|
+
}
|
|
7
|
+
export declare class ProductListSearchComponent extends BaseComponent<IProductListSearchParams> {
|
|
8
|
+
private searchInput?;
|
|
9
|
+
private clearButton?;
|
|
10
|
+
private debounceTimer;
|
|
11
|
+
private currentSearchTerm;
|
|
12
|
+
private readonly ALLOWED_CHARACTERS;
|
|
13
|
+
private readonly MAX_LENGTH;
|
|
14
|
+
private readonly DEFAULT_DEBOUNCE_MS;
|
|
15
|
+
get hostClasses(): string[];
|
|
16
|
+
disconnectedCallback(): void;
|
|
17
|
+
private fetchProducts;
|
|
18
|
+
protected template(): HTMLElement[];
|
|
19
|
+
private handleDebouncedSearch;
|
|
20
|
+
private handleClearSearch;
|
|
21
|
+
private cleanInput;
|
|
22
|
+
private normalizeForSearch;
|
|
23
|
+
private updateClearButtonVisibility;
|
|
24
|
+
private cleanupDebounceTimer;
|
|
25
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { IFilterParamsValue } from '@/interfaces/api/product-list.interface';
|
|
2
|
+
import type { ProductListFilterType } from '@/interfaces/injection.interface';
|
|
3
|
+
import type { IProductListFilters } from './product-list.interface';
|
|
4
|
+
export declare const FILTER_KIND: {
|
|
5
|
+
readonly FACET: "facet";
|
|
6
|
+
readonly TOGGLE: "toggle";
|
|
7
|
+
readonly CHOICE: "choice";
|
|
8
|
+
readonly RANGE: "range";
|
|
9
|
+
};
|
|
10
|
+
export type FilterKind = (typeof FILTER_KIND)[keyof typeof FILTER_KIND];
|
|
11
|
+
interface IFilterDefinitionBase {
|
|
12
|
+
key: string;
|
|
13
|
+
type: ProductListFilterType;
|
|
14
|
+
}
|
|
15
|
+
export interface IFacetFilterDefinition extends IFilterDefinitionBase {
|
|
16
|
+
kind: typeof FILTER_KIND.FACET;
|
|
17
|
+
}
|
|
18
|
+
export interface IToggleFilterDefinition extends IFilterDefinitionBase {
|
|
19
|
+
kind: typeof FILTER_KIND.TOGGLE;
|
|
20
|
+
apiOn: string;
|
|
21
|
+
}
|
|
22
|
+
export interface IChoiceFilterDefinition extends IFilterDefinitionBase {
|
|
23
|
+
kind: typeof FILTER_KIND.CHOICE;
|
|
24
|
+
anyValue: string;
|
|
25
|
+
anyExpandsTo: string[];
|
|
26
|
+
values: string[];
|
|
27
|
+
}
|
|
28
|
+
export interface IRangeFilterDefinition extends IFilterDefinitionBase {
|
|
29
|
+
kind: typeof FILTER_KIND.RANGE;
|
|
30
|
+
defaultMin: string;
|
|
31
|
+
defaultMax: string;
|
|
32
|
+
}
|
|
33
|
+
export type IFilterDefinition = IFacetFilterDefinition | IToggleFilterDefinition | IChoiceFilterDefinition | IRangeFilterDefinition;
|
|
34
|
+
export declare const FILTER_DEFINITIONS: IFilterDefinition[];
|
|
35
|
+
export declare function getFilterDefinition(key: string): IFilterDefinition | undefined;
|
|
36
|
+
export declare function getConfiguredFilterDefinitions(configuredFilters: ProductListFilterType[] | undefined): IFilterDefinition[];
|
|
37
|
+
export declare function getDefaultFilterValue(definition: IFilterDefinition): IProductListFilters[string];
|
|
38
|
+
export declare function createDefaultFilterValues(): IProductListFilters;
|
|
39
|
+
export declare function isFilterValueApplied(definition: IFilterDefinition, value: IProductListFilters[string]): boolean;
|
|
40
|
+
export declare function decodeStoredFilterValue(definition: IFilterDefinition, stored: unknown): IProductListFilters[string];
|
|
41
|
+
export declare function encodeFilterValueForApi(definition: IFilterDefinition, value: IProductListFilters[string]): IFilterParamsValue;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { IFilterSchema, IProductSearchParams } from '@/interfaces/api/product-list.interface';
|
|
2
|
+
import type { ProductListFilterType } from '@/interfaces/injection.interface';
|
|
3
|
+
import type { IExtendedFilterSchema, IProductListFilters } from './product-list.interface';
|
|
4
|
+
export declare function getSanitizedFilters(filters: IFilterSchema[], configuredFilters: ProductListFilterType[]): IExtendedFilterSchema[];
|
|
5
|
+
export declare function syncFiltersToAppliedFormat(filters: IProductListFilters): Record<string, string[]>;
|
|
6
|
+
export declare function buildCurrentFiltersFromState(stateFilters: Record<string, string[]>): IProductListFilters;
|
|
7
|
+
export declare function buildSearchParams(slug: string, page: number, perPage: number, searchTerm: string, currentFilters: IProductListFilters, configuredFilters: ProductListFilterType[]): IProductSearchParams;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { IPLProductStore } from '@/core/store/interfaces/product-list.interface';
|
|
2
|
+
export declare function buildProductOrderIndex(productOrder: string[]): Map<string, number>;
|
|
3
|
+
export declare function sortProductsByOrder(products: IPLProductStore[], orderIndex: Map<string, number>): IPLProductStore[];
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ProductListFilterType } from '@/interfaces/injection.interface';
|
|
2
|
+
import type { IProductListFilters } from './product-list.interface';
|
|
3
|
+
export declare function parseQueryParamsToFilters(configuredFilters: ProductListFilterType[], search?: string): IProductListFilters | null;
|