@datagouv/components-next 1.0.2-dev.152 → 1.0.2-dev.153

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 { g as Ke } from "./main-BdrYl6mr.js";
1
+ import { g as Ke } from "./main-CWzZZ7OE.js";
2
2
  import We from "vue";
3
3
  function Fe($, 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.152",
3
+ "version": "1.0.2-dev.153",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -63,7 +63,6 @@
63
63
  ExploreResourceView), so they line up with the resource title /
64
64
  download button above. Only the table itself goes edge-to-edge
65
65
  (via -mx-4 below). -->
66
- <slot name="toolbar-top" />
67
66
  <div>
68
67
  <div class="flex items-center py-3 gap-2">
69
68
  <!-- Mobile: filter & sort button -->
@@ -374,8 +373,7 @@
374
373
  <tr
375
374
  v-for="(row, i) in allRows"
376
375
  :key="row.__id ?? i"
377
- class="border-b border-gray-default even:bg-gray-lowest-2 hover:bg-gray-100 cursor-pointer"
378
- @click="emit('rowClick', row)"
376
+ class="border-b border-gray-default even:bg-gray-lowest-2 hover:bg-gray-100"
379
377
  >
380
378
  <td
381
379
  v-for="col in displayedColumns"
@@ -404,7 +402,6 @@
404
402
 
405
403
  <!-- Cell popover -->
406
404
  <TabularCellPopover
407
- v-if="!props.disablePopover"
408
405
  v-model:cell="activeCell"
409
406
  v-model:filters="filters"
410
407
  />
@@ -429,9 +426,8 @@
429
426
  <div
430
427
  v-for="(row, i) in allRows"
431
428
  :key="row.__id ?? i"
432
- class="border border-gray-default rounded-lg p-3 space-y-2 cursor-pointer"
429
+ class="border border-gray-default rounded-lg p-3 space-y-2"
433
430
  :class="i % 2 === 1 ? 'bg-gray-lowest-2' : 'bg-white'"
434
- @click="emit('rowClick', row)"
435
431
  >
436
432
  <div
437
433
  v-for="col in mobileVisibleFields(i)"
@@ -637,21 +633,6 @@ const props = defineProps<{
637
633
  // the host's padding. Used on the standalone explore page where the table
638
634
  // should span the whole screen while the toolbar stays inside the container.
639
635
  fullBleed?: boolean
640
- // When set, searches across multiple text columns using the Tabular API's
641
- // or(...) parameter. Each text/varchar column gets a __contains filter.
642
- // Note: combined via AND with any existing column-specific `contains` filters,
643
- // so it acts as an additional narrowing constraint, not a replacement.
644
- globalSearch?: string
645
- // When true, clicking a cell does not open the popover. Use when row-click
646
- // navigation is the primary interaction.
647
- disablePopover?: boolean
648
- // Initial filters applied on mount, e.g. { 'Administration': { contains: 'Ministère' } }.
649
- // Used when navigating from the detail page badge with query params.
650
- initialFilters?: Record<string, ColumnFilters>
651
- }>()
652
-
653
- const emit = defineEmits<{
654
- rowClick: [row: TabularRow]
655
636
  }>()
656
637
 
657
638
  const { t } = useTranslation()
@@ -677,10 +658,6 @@ const dataUrl = computed(() =>
677
658
  const sort = ref<SortConfig | null>(null)
678
659
  const filters = ref<Record<string, ColumnFilters>>({})
679
660
 
680
- if (props.initialFilters) {
681
- filters.value = { ...props.initialFilters }
682
- }
683
-
684
661
  const PAGE_SIZE = 50
685
662
 
686
663
  const dataQuery = computed(() => {
@@ -711,10 +688,6 @@ const dataQuery = computed(() => {
711
688
  q[`${col}__isnotnull`] = ''
712
689
  }
713
690
  }
714
- if (props.globalSearch && profileData.value?.profile) {
715
- const textCols = allColumns.value.filter(c => getColumnType(c) === 'text')
716
- q.or = '(' + textCols.map(c => c + '__contains.' + encodeURIComponent(props.globalSearch!)).join(',') + ')'
717
- }
718
691
  return q
719
692
  })
720
693
 
@@ -965,7 +938,6 @@ onUnmounted(() => {
965
938
  const activeCell = ref<CellInfo | null>(null)
966
939
 
967
940
  function onCellClick(col: string, value: unknown, event: MouseEvent) {
968
- if (props.disablePopover) return
969
941
  const el = (event.target as HTMLElement).closest('[data-cell]') as HTMLElement | null
970
942
  if (!el) return
971
943
  if (activeCell.value && activeCell.value.element === el) {
@@ -989,12 +961,7 @@ const activeFilters = computed<ActiveFilter[]>(() => {
989
961
  parts.push(`= ${filter.in.join(', ')}`)
990
962
  }
991
963
  if (filter.exact != null) {
992
- if (getColumnType(col) === 'boolean') {
993
- parts.push(`= ${filter.exact === 'true' ? t('Vrai') : t('Faux')}`)
994
- }
995
- else {
996
- parts.push(`= ${filter.exact}`)
997
- }
964
+ parts.push(`= ${filter.exact === 'true' ? t('Vrai') : t('Faux')}`)
998
965
  }
999
966
  if (filter.contains) {
1000
967
  parts.push(`${t('contient')} "${filter.contains}"`)
@@ -67,8 +67,8 @@ export type ColumnType = 'number' | 'categorical' | 'text' | 'date' | 'boolean'
67
67
  export type ColumnFilters = {
68
68
  in?: string[]
69
69
  exact?: string
70
- min?: number | string
71
- max?: number | string
70
+ min?: number
71
+ max?: number
72
72
  contains?: string
73
73
  null?: 'only' | 'exclude'
74
74
  }