@datagouv/components-next 1.0.2-dev.87 → 1.0.2-dev.88

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.
@@ -1,4 +1,4 @@
1
- import { c as Ke } from "./main-BNyfhPgX.js";
1
+ import { c as Ke } from "./main-DWYesZBr.js";
2
2
  import We from "vue";
3
3
  function Fe(I, K) {
4
4
  for (var V = 0; V < K.length; V++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datagouv/components-next",
3
- "version": "1.0.2-dev.87",
3
+ "version": "1.0.2-dev.88",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -475,6 +475,11 @@ const showSidebar = computed(() => props.config.length > 1 || activeFilters.valu
475
475
  // URL query params
476
476
  const q = useRouteQuery<string>('q', '')
477
477
  const { debounced: qDebounced, flush: flushQ } = useDebouncedRef(q, componentsConfig.searchDebounce ?? 300)
478
+ // When the search input is hidden, the parent owns the input and is expected
479
+ // to debounce user typing itself (otherwise typing would land in the URL
480
+ // instantly via v-model and stack two debounces). Bypass the internal debounce
481
+ // so URL-driven q changes hit the fetch params immediately.
482
+ const qForParams = computed(() => props.hideSearchInput ? q.value : qDebounced.value)
478
483
  const page = useRouteQuery('page', 1, { transform: Number })
479
484
  const sort = useRouteQuery<string | undefined>('sort')
480
485
 
@@ -550,7 +555,7 @@ watch(currentType, () => {
550
555
  const stableParamsOptions = {
551
556
  allFilters,
552
557
  customFilterRegistry,
553
- q: qDebounced,
558
+ q: qForParams,
554
559
  sort,
555
560
  page,
556
561
  pageSize,
@@ -643,7 +648,7 @@ for (const c of props.config) {
643
648
  // intentionally excluded here to avoid resetting the page when a filter
644
649
  // registers with its URL-derived value.
645
650
  const filtersForReset = computed(() => ({
646
- q: qDebounced.value,
651
+ q: qForParams.value,
647
652
  organization: organizationId.value,
648
653
  organization_badge: organizationType.value,
649
654
  tag: tag.value,
@@ -726,7 +731,7 @@ const rssUrl = computed(() => {
726
731
  }
727
732
 
728
733
  // Add active filters
729
- if (qDebounced.value) params.set('q', qDebounced.value)
734
+ if (qForParams.value) params.set('q', qForParams.value)
730
735
  if (organizationId.value) params.set('organization', organizationId.value)
731
736
  if (organizationType.value) params.set('organization_badge', organizationType.value)
732
737
  if (tag.value) params.set('tag', tag.value)