Skip to content

WeDtSelectResourceFilter

A resource select filter component that extends WeDtSelectFilter by fetching items from an API endpoint. It supports single and multiple selection, search, infinite scroll, raw value emission, and integration with dynamic resources.

Selected items appear as chips in the activator area. Multiple selection is enabled by default. Items are loaded lazily or with pagination, and the component can wait for user interaction before fetching.

vue
<template>
  <WeDtSelectResourceFilter
    v-model="filters.user"
    resource="users"
    label="User"
  />
</template>

<script setup>
const filters = ref({
  user: null,
})
</script>

Modes

The component can work in two modes:

  1. Structured filter mode (default)

Emits an object like:

vue
{
  operator: '=',
  value: true
}
  1. Raw value mode

By enabling emitRawValue = true, the component emits only the toggled raw value without wrapping it in a filter object.

Props

PropTypeDefaultDescription
resourceStringRequiredName of the resource on the server
itemValueString'id'Property name to use as the value
itemTextString | Function'name'Property name or function to use as display text
paginateBoolean | ObjecttrueWhether to use pagination and pagination options
lazyBooleanfalseWhether to use lazy loading/caching for API requests
extraParamsObject{}Additional parameters for the API request
labelStringnullLabel shown in the activator and dropdown header
maxChipsNumber2Maximum number of chips shown before collapsing with +N
emitRawValueBooleanfalseWhen true, v-model returns only the raw toggled value instead of filter objects
widthString | Number400pxWidth of the dropdown menu
locationStringbottom endPosition of the dropdown menu
loadingBooleanfalseDisplays loading animation in the search field and at the bottom of the dropdown
onIntersectLastFunctionundefinedCallback for infinite scrolling when the last item is intersected

Slots

NamePropsDescription
item-title{ item }Custom renderer for the item label inside the dropdown