Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 7 additions & 2 deletions datagouv-components/src/components/RadioInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@
>
<component
:is="icon"
v-if="icon"
v-if="icon && typeof icon !== 'string'"
class="w-4 h-4"
/>
<span
v-else-if="icon"
:class="icon"
aria-hidden="true"
/>
<span class="text-sm flex-1 min-w-0">
<slot />
</span>
Expand All @@ -40,7 +45,7 @@ type Props = {
value: string
count?: number
loading?: boolean
icon?: Component
icon?: Component | string
highlighted?: boolean
}

Expand Down
2 changes: 1 addition & 1 deletion datagouv-components/src/components/Search/GlobalSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
:value="configKey(typeConfig)"
:count="resultsMap[configKey(typeConfig)]?.data.value?.total"
:loading="resultsMap[configKey(typeConfig)]?.status.value === 'pending' || resultsMap[configKey(typeConfig)]?.status.value === 'idle'"
:icon="strategies[typeConfig.class].icon"
:icon="typeConfig.icon ?? strategies[typeConfig.class].icon"
>
{{ typeConfig.name || strategies[typeConfig.class].name }}
</RadioInput>
Expand Down
6 changes: 6 additions & 0 deletions datagouv-components/src/types/search.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { Component } from 'vue'
import type { PaginatedArray } from './api'
import type { AccessType } from './access_types'
import type { Dataset } from './datasets'
Expand Down Expand Up @@ -298,6 +299,7 @@ export type DatasetSearchConfig = {
class: 'datasets'
key?: string
name?: string
icon?: Component | string
placeholder?: string | null
hiddenFilters?: HiddenFilter<DatasetSearchFilters>[]
basicFilters?: (keyof DatasetSearchFilters)[]
Expand All @@ -309,6 +311,7 @@ export type DataserviceSearchConfig = {
class: 'dataservices'
key?: string
name?: string
icon?: Component | string
placeholder?: string | null
hiddenFilters?: HiddenFilter<DataserviceSearchFilters>[]
basicFilters?: (keyof DataserviceSearchFilters)[]
Expand All @@ -320,6 +323,7 @@ export type ReuseSearchConfig = {
class: 'reuses'
key?: string
name?: string
icon?: Component | string
placeholder?: string | null
hiddenFilters?: HiddenFilter<ReuseSearchFilters>[]
basicFilters?: (keyof ReuseSearchFilters)[]
Expand All @@ -331,6 +335,7 @@ export type OrganizationSearchConfig = {
class: 'organizations'
key?: string
name?: string
icon?: Component | string
placeholder?: string | null
hiddenFilters?: HiddenFilter<OrganizationSearchFilters>[]
basicFilters?: (keyof OrganizationSearchFilters)[]
Expand All @@ -342,6 +347,7 @@ export type TopicSearchConfig = {
class: 'topics'
key?: string
name?: string
icon?: Component | string
placeholder?: string | null
hiddenFilters?: HiddenFilter<TopicSearchFilters>[]
basicFilters?: (keyof TopicSearchFilters)[]
Expand Down
Loading