Skip to main content

Interface: UseSparePartsOptions

Defined in: composables/vue/useSpareParts.ts:47

Properties​

companyId?​

optional companyId?: Ref<number | undefined, number | undefined>

Defined in: composables/vue/useSpareParts.ts:85

Active company — scopes the assortment.


configuration?​

optional configuration?: object

Defined in: composables/vue/useSpareParts.ts:108

Image filter config, mirroring useProductSearch's configuration.

anonymousUserId?​

optional anonymousUserId?: number

The channel's anonymous user — logged-out listings are scoped to it.

imageSearchFiltersGrid?​

optional imageSearchFiltersGrid?: unknown

imageVariantFiltersMedium?​

optional imageVariantFiltersMedium?: unknown


graphqlClient?​

optional graphqlClient?: GraphQLClient

Defined in: composables/vue/useSpareParts.ts:49

SDK client. Without it the composable stays idle (controlled mode needs no client).


language​

language: Ref<string>

Defined in: composables/vue/useSpareParts.ts:61

Language for the spare parts themselves (the storefront language).


machineLanguage?​

optional machineLanguage?: Ref<string | undefined, string | undefined>

Defined in: composables/vue/useSpareParts.ts:70

Language the MACHINE TREE is authored in. Defaults to language.

machine(slug:, language:) is language-scoped and hard-errors with "No machine found for slug and language" when the machine has no name/slug in that language. Machine trees are commonly maintained in one language (typically EN) while their spare parts are localized.


machineLanguages?​

optional machineLanguages?: Ref<string[] | undefined, string[] | undefined>

Defined in: composables/vue/useSpareParts.ts:79

Extra languages to try when the slug does not resolve in machineLanguage.

A slug resolves only in the language it was authored in, so a tree that is only half-translated has machines reachable by an NL slug but not an EN one. machineLanguage and language are always tried first; list the shop's other locales here to cover the rest. Order is the try order.


onFiltersChange?​

optional onFiltersChange?: (filters) => void

Defined in: composables/vue/useSpareParts.ts:115

Fired with the facet list after each fetch.

Parameters​

filters​

AttributeFilter[]

Returns​

void


onItemsFoundChange?​

optional onItemsFoundChange?: (count) => void

Defined in: composables/vue/useSpareParts.ts:119

Fired with the total item count after each fetch.

Parameters​

count​

number

Returns​

void


onMachineChange?​

optional onMachineChange?: (machine) => void

Defined in: composables/vue/useSpareParts.ts:123

Fired with the machine itself after each fetch (name, child machines, …).

Parameters​

machine​

SparePartsMachine

Returns​

void


onPartsResponse?​

optional onPartsResponse?: (response) => void

Defined in: composables/vue/useSpareParts.ts:121

Fired with the raw parts response after each fetch.

Parameters​

response​

SparePartsResponse

Returns​

void


onPriceBoundsChange?​

optional onPriceBoundsChange?: (min, max) => void

Defined in: composables/vue/useSpareParts.ts:117

Fired with the price-slider bounds after each fetch.

Parameters​

min​

number

max​

number

Returns​

void


page?​

optional page?: Ref<number, number>

Defined in: composables/vue/useSpareParts.ts:106

Controlled page. When provided the composable renders (and fetches) this page and goToPage becomes advisory — the host owns the number, typically from the URL. Every other listing input was already an option, so its absence read as "paging is internal" and it was not (PWP-995b). Omit it to keep the previous uncontrolled behaviour.


pageSize?​

optional pageSize?: Ref<number, number>

Defined in: composables/vue/useSpareParts.ts:97

Items per page. Defaults to 12.


parts?​

optional parts?: Ref<SparePart[] | undefined, SparePart[] | undefined>

Defined in: composables/vue/useSpareParts.ts:55

Controlled mode: pre-fetched parts (e.g. SSR-seeded). When the ref's VALUE is DEFINED the composable performs no fetching and echoes these back. Pass [] (not undefined) to show an empty state while the host controls loading.


priceFilterMax?​

optional priceFilterMax?: Ref<number | undefined, number | undefined>

Defined in: composables/vue/useSpareParts.ts:91

Price-range filter upper bound.


priceFilterMin?​

optional priceFilterMin?: Ref<number | undefined, number | undefined>

Defined in: composables/vue/useSpareParts.ts:89

Price-range filter lower bound.


slug?​

optional slug?: Ref<string | undefined, string | undefined>

Defined in: composables/vue/useSpareParts.ts:57

Slug of the machine whose parts to list.


sortField?​

optional sortField?: Ref<string | undefined, string | undefined>

Defined in: composables/vue/useSpareParts.ts:93

Sort field.


sortOrder?​

optional sortOrder?: Ref<string | undefined, string | undefined>

Defined in: composables/vue/useSpareParts.ts:95

Sort direction.


taxZone?​

optional taxZone?: string

Defined in: composables/vue/useSpareParts.ts:81

Tax zone for price calculation.


term?​

optional term?: Ref<string | undefined, string | undefined>

Defined in: composables/vue/useSpareParts.ts:59

Free-text search, scoped server-side to this machine's parts.


textFilters?​

optional textFilters?: Ref<ProductTextFilterInput[] | undefined, ProductTextFilterInput[] | undefined>

Defined in: composables/vue/useSpareParts.ts:87

Attribute (facet) filters.


user?​

optional user?: Ref<Contact | Customer | null, Contact | Customer | null>

Defined in: composables/vue/useSpareParts.ts:83

Active user — drives userId scoping and contact/customer pricing.