@@ -17,6 +17,8 @@ const SSR_COUNT = 20
1717const props = defineProps <{
1818 /** List of search results to display */
1919 results: NpmSearchResult []
20+ /** Filters to apply to the results */
21+ filters? : StructuredFilters
2022 /** Heading level for package names */
2123 headingLevel? : ' h2' | ' h3'
2224 /** Whether to show publisher username on cards */
@@ -39,6 +41,8 @@ const props = defineProps<{
3941 paginationMode? : PaginationMode
4042 /** Current page (1-indexed) for paginated mode */
4143 currentPage? : number
44+ /** When true, shows search-specific UI (relevance sort, no filters) */
45+ searchContext? : boolean
4246}>()
4347
4448const emit = defineEmits <{
@@ -60,7 +64,11 @@ const sortOption = defineModel<SortOption>('sortOption')
6064
6165// View mode and columns
6266const viewMode = computed (() => props .viewMode ?? ' cards' )
63- const columns = computed (() => props .columns ?? DEFAULT_COLUMNS )
67+ const columns = computed (() => {
68+ const targetColumns = props .columns ?? DEFAULT_COLUMNS
69+ if (props .searchContext ) return targetColumns .map (column => ({ ... column , sortable: false }))
70+ return targetColumns
71+ })
6472// Table view forces pagination mode (no virtualization for tables)
6573const paginationMode = computed (() =>
6674 viewMode .value === ' table' ? ' paginated' : (props .paginationMode ?? ' infinite' ),
@@ -147,6 +155,7 @@ defineExpose({
147155 <template v-if =" viewMode === ' table' " >
148156 <PackageTable
149157 :results =" displayedResults"
158+ :filters =" filters"
150159 :columns =" columns"
151160 v-model:sort-option =" sortOption"
152161 :is-loading =" isLoading"
@@ -176,7 +185,9 @@ defineExpose({
176185 :index =" index"
177186 :search-query =" searchQuery"
178187 class =" motion-safe:animate-fade-in motion-safe:animate-fill-both"
188+ :filters =" filters"
179189 :style =" { animationDelay: `${Math.min(index * 0.02, 0.3)}s` }"
190+ @click-keyword =" emit('clickKeyword', $event)"
180191 />
181192 </div >
182193 </template >
@@ -193,6 +204,8 @@ defineExpose({
193204 :show-publisher =" showPublisher"
194205 :index =" index"
195206 :search-query =" searchQuery"
207+ :filters =" filters"
208+ @click-keyword =" emit('clickKeyword', $event)"
196209 />
197210 </div >
198211 </li >
@@ -225,6 +238,8 @@ defineExpose({
225238 :search-query =" searchQuery"
226239 class =" motion-safe:animate-fade-in motion-safe:animate-fill-both"
227240 :style =" { animationDelay: `${Math.min(index * 0.02, 0.3)}s` }"
241+ :filters =" filters"
242+ @click-keyword =" emit('clickKeyword', $event)"
228243 />
229244 </li >
230245 </ol >
0 commit comments