Fejlesztőknek
Kezdj bele
Témák/Theme SDK/Modules/listing/Types: AppliedFilter to SortOption

Types: AppliedFilter to SortOption

Ez az oldal még csak angolul érhető el.

The types of @poltura/theme-sdk/listing, AppliedFilter to SortOption.

Ezen az oldalon
import { … } from '@poltura/theme-sdk/listing';

AppliedFilter

One applied filter, as a removable chip.

groupIdrequiredstring

The group the filter belongs to.

optionIdrequiredstring

The selected option.

labelrequiredstring

The chip text in the page language.

removerequired() => void

Removes this filter.

FilterGroupKind

How a filter group is presented: a checklist, colour swatches, a price range or an on/off toggle.

type FilterGroupKind = 'list' | 'swatch' | 'price' | 'toggle'

FilterGroupView

One filter of a product list, such as brand, colour or price.

idrequiredstring

The group's id.

labelrequiredstring

The group's title in the page language.

kindrequiredFilterGroupKind

How the group is presented.

optionsrequiredreadonly FilterOptionView[]

The group's choices; empty for a price group.

openrequiredboolean

Whether the group starts expanded.

maxVisiblerequirednumber

How many choices show before "show more".

searchablerequiredboolean

Whether the group offers a search box over its choices.

rangerequired{ readonly min: number; readonly max: number; readonly currencyCode: CurrencyCode; } | null

The bounds of a price group, or null for other kinds.

activeRangerequiredPriceRangeSelection | null

The selected price range of a price group, or null.

priceDisplayrequiredFilterPriceDisplay

How a price group takes its range.

FilterOptionView

One choice inside a filter group.

idrequiredstring

The option's id inside its group.

labelrequiredstring

The option's text in the page language.

countrequirednumber | null

How many products match it, or null when counts are hidden.

selectedrequiredboolean

Whether it is selected.

swatchrequiredSwatch | null

Its swatch in a swatch group, otherwise null.

iconrequiredIconValue | null

The icon shown before the label in a list group, as `ContentIcon` draws it, or null.

childrenrequiredreadonly FilterOptionView[]

Nested choices, such as subcategories.

FilterPriceDisplay

How a price group takes its range: a slider, two amount fields, or both.

type FilterPriceDisplay = 'slider' | 'inputs' | 'both'

ListingFilterSelection

The filters a product list is narrowed by.

optionsrequiredReadonly<Record<string, readonly string[]>>

Selected option ids per group id.

pricerequiredPriceRangeSelection | null

The selected price range, or null.

ListingFiltersState

The filter panel's state and the actions that change the selection.

groupsrequiredreadonly FilterGroupView[]

The filter groups, in the merchant's order.

selectionrequiredListingFilterSelection

The current selection.

togglerequired(groupId: string, optionId: string) => void

Selects or clears one option.

setPriceRangerequired(range: PriceRangeSelection) => void

Narrows the list to a price range.

clearrequired(groupId?: string) => void

Clears one group, or every filter.

appliedrequiredreadonly AppliedFilter[]

The applied filters as removable chips.

selectedCountrequirednumber

How many options are selected.

isPendingrequiredboolean

Whether the list is reloading for the new selection.

ListingState

A collection, category or search results page with its products, sort and paging.

headerrequired{ readonly title: string; readonly description: RichTextValue | null; readonly countLabel: string | null; readonly searchQuery: string | null; }

The page's heading.

productsrequiredreadonly ProductCard[]

The products on the current page.

sortrequired{ readonly options: readonly SortOption[]; readonly selected: ProductSort; set(sort: ProductSort): void; }

The sort menu and the current order.

paginationrequiredPagination

Where the list is and how to reach its other pages.

goToPagerequired(page: number) => void

Opens another page of the list, keeping the filters and sort, and scrolls back to the top.

clearSearchrequired() => void

Drops the search terms of a results page, keeping the filters and sort.

layoutrequired{ readonly columns: { readonly desktop: number; readonly mobile: number; }; readonly imageAspectRatio: string; readonly show: ListingVisibility; }

The merchant's grid and visibility choices.

isEmptyrequiredboolean

Whether nothing matches.

isPendingrequiredboolean

Whether a new page, sort or filter is loading.

ListingVisibility

Which parts of a product list the merchant has switched on.

filtersrequiredboolean

The filter panel.

appliedFiltersrequiredboolean

The applied-filter chips.

sortrequiredboolean

The sort menu.

productCountrequiredboolean

The product count.

addToCartrequiredboolean

The add-to-cart button on cards.

cardPricerequiredboolean

The price on cards.

cardCompareAtrequiredboolean

The compare-at price on cards.

cardBadgerequiredboolean

The badge on cards.

Pagination

Where a paged list is and how to reach its other pages.

pagerequirednumber

The current page, from 1.

pageCountrequirednumber

How many pages there are.

totalrequirednumber

How many items match over every page.

hrefrequired(page: number) => string

The path of a page of the list.

PriceRangeSelection

A price range a shopper selected, in major units; a null bound leaves that side open.

minrequirednumber | null

The lowest price, or null for no lower bound.

maxrequirednumber | null

The highest price, or null for no upper bound.

SortOption

One choice of the sort menu.

valuerequiredProductSort

The sort order.

labelrequiredstring

Its name in the page language.

Utoljára frissítve