@datagouv/components-next 1.0.2-dev.89 → 1.0.2-dev.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Datafair.client-o29pT5IO.js → Datafair.client-CyZRNADr.js} +1 -1
- package/dist/{JsonPreview.client-zTm_P1pn.js → JsonPreview.client-C9iaPSmQ.js} +2 -2
- package/dist/{MapContainer.client-Cre2ITH4.js → MapContainer.client-BuoZ69XO.js} +2 -2
- package/dist/{PdfPreview.client-CrCTrCMW.js → PdfPreview.client-MI0bDghc.js} +2 -2
- package/dist/{Pmtiles.client-Bk3YXxir.js → Pmtiles.client-CaKEYQBc.js} +1 -1
- package/dist/{PreviewWrapper.vue_vue_type_script_setup_true_lang-i2mxfv14.js → PreviewWrapper.vue_vue_type_script_setup_true_lang-BKqb6TMw.js} +1 -1
- package/dist/{XmlPreview.client-DvVfyOrX.js → XmlPreview.client-BVAeNK4n.js} +3 -3
- package/dist/components-next.js +1 -1
- package/dist/{index-Bz10NPKw.js → index-BBdS8QKx.js} +1 -1
- package/dist/{main-DWYesZBr.js → main-Dk_66g-3.js} +8782 -8776
- package/dist/{vue3-xml-viewer.common-CgoYvikm.js → vue3-xml-viewer.common-B8dNNkOU.js} +1 -1
- package/package.json +1 -1
- package/src/components/Search/GlobalSearch.vue +11 -0
- package/src/components/Search/SearchInput.vue +2 -1
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
<SearchInput
|
|
14
14
|
v-model="q"
|
|
15
15
|
:placeholder="resolvedPlaceholder"
|
|
16
|
+
:auto-focus
|
|
16
17
|
/>
|
|
17
18
|
</div>
|
|
18
19
|
<div class="grid grid-cols-12 mt-2 md:mt-5">
|
|
@@ -401,11 +402,17 @@ const props = withDefaults(defineProps<{
|
|
|
401
402
|
config?: GlobalSearchConfig
|
|
402
403
|
placeholder?: string | null
|
|
403
404
|
hideSearchInput?: boolean
|
|
405
|
+
autoFocus?: boolean
|
|
404
406
|
}>(), {
|
|
405
407
|
config: getDefaultGlobalSearchConfig,
|
|
406
408
|
hideSearchInput: false,
|
|
409
|
+
autoFocus: true,
|
|
407
410
|
})
|
|
408
411
|
|
|
412
|
+
const emit = defineEmits<{
|
|
413
|
+
resultsCount: [total: number]
|
|
414
|
+
}>()
|
|
415
|
+
|
|
409
416
|
// defineModel's default is static and can't depend on props, so we cast and initialize manually
|
|
410
417
|
const currentType = defineModel<string>('type') as Ref<string>
|
|
411
418
|
if (!currentType.value) currentType.value = configKey(props.config[0] ?? { class: 'datasets' })
|
|
@@ -717,6 +724,10 @@ function resetFilters() {
|
|
|
717
724
|
const searchResults = computed(() => resultsMap[currentType.value]?.data.value)
|
|
718
725
|
const searchResultsStatus = computed(() => resultsMap[currentType.value]?.status.value)
|
|
719
726
|
|
|
727
|
+
watch(searchResults, (results) => {
|
|
728
|
+
if (results) emit('resultsCount', results.total)
|
|
729
|
+
}, { immediate: true })
|
|
730
|
+
|
|
720
731
|
// RSS feed URL for datasets
|
|
721
732
|
const rssUrl = computed(() => {
|
|
722
733
|
if (currentTypeConfig.value?.class !== 'datasets') return null
|
|
@@ -37,7 +37,7 @@ import BrandedButton from '../BrandedButton.vue'
|
|
|
37
37
|
|
|
38
38
|
const q = defineModel<string>({ required: true })
|
|
39
39
|
|
|
40
|
-
withDefaults(defineProps<{
|
|
40
|
+
const props = withDefaults(defineProps<{
|
|
41
41
|
placeholder?: string | null
|
|
42
42
|
autoFocus?: boolean
|
|
43
43
|
}>(), {
|
|
@@ -57,6 +57,7 @@ const focus = () => {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
onMounted(async () => {
|
|
60
|
+
if (!props.autoFocus) return
|
|
60
61
|
await nextTick()
|
|
61
62
|
focus()
|
|
62
63
|
})
|