Skip to content
Merged
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
189d190
update FiltersDefinition prop and types to accept grouped filters
d-flood Jul 21, 2025
4a9d1b4
feat: grouped and collapsible filters
d-flood Jul 22, 2025
bb782eb
make collapsible title bar a slot
d-flood Jul 22, 2025
d696abb
use/remove unused
d-flood Jul 22, 2025
b580da8
hide group header when group has no valid inner filters
d-flood Jul 24, 2025
9133079
add magnifying glass icon and placeholder to search input and make it…
d-flood Jul 24, 2025
96d34ce
fix clipped dropdown height when at bottom of filter group
d-flood Jul 24, 2025
6332e0a
bump version
d-flood Jul 24, 2025
3fd2d6d
add test coverage for filter group logic
d-flood Jul 24, 2025
9de336a
update layout of filter title and tab
d-flood Jul 24, 2025
0a5032d
remove default border from keyword section
d-flood Jul 24, 2025
8ac6f85
add active filters display to search results
d-flood Jul 25, 2025
9c3c1c4
refactor layout of filters header and clear button
d-flood Jul 25, 2025
765de38
add class to checkbox group for style scoping
d-flood Jul 25, 2025
31aaa08
add class to checkbox group for style scoping
d-flood Jul 25, 2025
5384304
remove left padding from filter groupings
d-flood Jul 25, 2025
1250303
add flushPromises to ensure async operations complete in PagefindSear…
d-flood Jul 28, 2025
d1b8149
make filter state load from query params and open groups if they cont…
d-flood Jul 29, 2025
f41b765
Merge branch '0.0.8' into DAR-1228-implement-filter-groups
d-flood Jul 29, 2025
03882d6
fix tests
d-flood Jul 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pagefind-vue",
"version": "0.0.7",
"version": "0.0.8",
"type": "module",
"main": "./dist/pagefind-vue.umd.js",
"module": "./dist/pagefind-vue.es.js",
Expand Down Expand Up @@ -59,4 +59,4 @@
"vue-router": "^4.5.0",
"vue-tsc": "^2.1.10"
}
}
}
57 changes: 41 additions & 16 deletions src/Index1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,26 @@
:resultSort="resultSort"
@update:searchQuery="onQueryChange"
>
<template #collapse-title="{ direction, label }">
<h2 style="padding: 0; margin: 0">
{{ label }}
<span class="collapse-icon">
<svg
class="chevron-icon"
xmlns="http://www.w3.org/2000/svg"
width="22"
height="22"
fill="currentColor"
viewBox="0 0 256 256"
:direction="direction"
>
<path
d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"
></path>
</svg>
</span>
</h2>
</template>
</Search>
</template>

Expand All @@ -23,7 +43,7 @@ import Search from './components/PagefindSearch.vue'
import type {
FilterSortFunction as FilterOptionsSortFunction,
CustomSortFunctions,
FiltersDefinition,
FilterGroup,
Filter,
SortOption,
} from './components/types'
Expand Down Expand Up @@ -52,23 +72,28 @@ onMounted(async () => {
})

// Define filters configuration
const filtersDefinition: FiltersDefinition = {
'Crystal system': {
type: 'checkboxes',
label: 'Crystal System',
const filtersDefinition: FilterGroup[] = [
{
label: 'Group 1',
collapsible: true,
initiallyOpen: false,
filters: {
'Crystal system': 'checkboxes',
Abundance: 'checkboxes',
Distribution: 'checkboxes',
},
},
Abundance: 'checkboxes',
Distribution: 'checkboxes',
'Status at Tsumeb': {
type: 'checkboxes',
label: 'Status at Tsumeb',
{
label: 'Group 2',
collapsible: false,
initiallyOpen: true,
filters: {
'Status at Tsumeb': 'checkboxes',
Occurence: 'dropdown',
'Precursor Mineral': 'dropdown',
},
},
Occurence: {
type: 'dropdown',
label: 'Paragenesis',
},
'Precursor Mineral': 'dropdown',
}
]

const abundanceSortList = ['Very rare', 'Extremely rare', 'Very common', 'Common']
const sortedTabList = ['Species', 'Specimen', 'Pseudomorph']
Expand Down
2 changes: 1 addition & 1 deletion src/components/CheckboxGroup.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<XIcon size="16" color="#000" />
</button>
</div>
<div class="checkbox-container">
<div class="checkbox-container checkbox-group">
<div v-for="value in filteredOptions" :key="value">
<Checkbox
:filter-group="name"
Expand Down
2 changes: 1 addition & 1 deletion src/components/FilterableDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ onMounted(() => {
width: 100%;
max-height: var(--pagefind-vue-options-max-height);
overflow-y: auto;
z-index: var(--pagefind-vue-options-z-index);
z-index: var(--pagefind-vue-options-z-index, 1000);
background: var(--pagefind-vue-options-bg);
border: var(--pagefind-vue-options-border);
border-top: none;
Expand Down
Loading