@datagouv/components-next 1.0.2-dev.151 → 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.
- package/dist/{Datafair.client-MNAP27A-.js → Datafair.client-BRgmha-O.js} +1 -1
- package/dist/{JsonPreview.client-C3dG7a_r.js → JsonPreview.client-Cs87KC-b.js} +2 -2
- package/dist/{MapContainer.client-B5YiX3NO.js → MapContainer.client-DLJuagQI.js} +2 -2
- package/dist/{PdfPreview.client-CERt2f57.js → PdfPreview.client-BI90pK6j.js} +2 -2
- package/dist/{Pmtiles.client-D8ug3toD.js → Pmtiles.client-bJzz1c3r.js} +1 -1
- package/dist/{PreviewWrapper.vue_vue_type_script_setup_true_lang--KItAayB.js → PreviewWrapper.vue_vue_type_script_setup_true_lang-DS_Tvpti.js} +1 -1
- package/dist/{XmlPreview.client-1IAoOczZ.js → XmlPreview.client-L8ZyxNdY.js} +3 -3
- package/dist/components-next.js +1 -1
- package/dist/{index-D86-g3i7.js → index-sr5KjUOp.js} +1 -1
- package/dist/{leaflet-src-BjtNBpa8.js → leaflet-src-D34jQJmR.js} +1 -1
- package/dist/{main-BdrYl6mr.js → main-CWzZZ7OE.js} +8814 -8829
- package/dist/{vue3-xml-viewer.common-BE7Fgsqp.js → vue3-xml-viewer.common-9Hozz8ne.js} +1 -1
- package/package.json +1 -1
- package/src/components/TabularExplorer/TabularExplorer.vue +3 -36
- package/src/components/TabularExplorer/types.ts +2 -2
package/package.json
CHANGED
|
@@ -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
|
|
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
|
|
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
|
-
|
|
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
|
|
71
|
-
max?: number
|
|
70
|
+
min?: number
|
|
71
|
+
max?: number
|
|
72
72
|
contains?: string
|
|
73
73
|
null?: 'only' | 'exclude'
|
|
74
74
|
}
|