Skip to main content

Interface: UseSparePartsOptions

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

Properties

companyId?

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

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

Active company — scopes the assortment.


configuration?

optional configuration?: object

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

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:45

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


language

language: Ref<string>

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

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


machineLanguage?

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

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

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.


onFiltersChange?

optional onFiltersChange?: (filters) => void

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

Fired with the facet list after each fetch.

Parameters

filters

AttributeFilter[]

Returns

void


onItemsFoundChange?

optional onItemsFoundChange?: (count) => void

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

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:101

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:99

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:95

Fired with the price-slider bounds after each fetch.

Parameters

min

number

max

number

Returns

void


pageSize?

optional pageSize?: Ref<number, number>

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

Items per page. Defaults to 12.


parts?

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

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

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:78

Price-range filter upper bound.


priceFilterMin?

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

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

Price-range filter lower bound.


slug?

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

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

Slug of the machine whose parts to list.


sortField?

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

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

Sort field.


sortOrder?

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

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

Sort direction.


taxZone?

optional taxZone?: string

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

Tax zone for price calculation.


term?

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

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

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:74

Attribute (facet) filters.


user?

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

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

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