@datagouv/components-next 1.4.1-dev.1380.g71efeb91 → 1.4.1-dev.1382.g7bc1bc5a

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datagouv/components-next",
3
- "version": "1.4.1-dev.1380.g71efeb91",
3
+ "version": "1.4.1-dev.1382.g7bc1bc5a",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "engines": {
@@ -46,6 +46,7 @@
46
46
  <script setup lang="ts">
47
47
  import { useTranslation } from '../../composables/useTranslation'
48
48
  import { useComponentsConfig } from '../../config'
49
+ import type { RouteLocationRaw } from 'vue-router'
49
50
  import type { DatasetV2WithFullObject } from '../../types/datasets'
50
51
  import DescriptionList from '../DescriptionList.vue'
51
52
  import DescriptionListTerm from '../DescriptionListTerm.vue'
@@ -57,13 +58,13 @@ import Tag from '../Tag.vue'
57
58
 
58
59
  const props = defineProps<{
59
60
  dataset: DatasetV2WithFullObject
60
- tagUrl?: (tag: string) => string
61
+ tagUrl?: (tag: string) => string | RouteLocationRaw
61
62
  }>()
62
63
 
63
64
  const { t } = useTranslation()
64
65
  const config = useComponentsConfig()
65
66
 
66
- function getTagUrl(tag: string): string {
67
+ function getTagUrl(tag: string): string | RouteLocationRaw {
67
68
  if (props.tagUrl) {
68
69
  return props.tagUrl(tag)
69
70
  }
@@ -130,7 +130,7 @@ const props = withDefaults(defineProps<{
130
130
  exitTo?: RouteLocationRaw
131
131
  // Inline mode only: link builder for the "Explorer" button in the viewer header
132
132
  // that opens the fullscreen explorer on the current resource.
133
- exploreTo?: (resource: Resource) => string
133
+ exploreTo?: (resource: Resource) => string | RouteLocationRaw
134
134
  // Overrides the "Copier le lien" target.
135
135
  resourceExternalUrl?: (resource: Resource) => string
136
136
  canEdit?: boolean
@@ -231,7 +231,7 @@ const props = withDefaults(defineProps<{
231
231
  resourceTo: (resource: Resource) => RouteLocationRaw
232
232
  // When provided (inline mode), shows an "Explorer" button next to the download
233
233
  // action that opens the fullscreen explorer on the current resource.
234
- exploreTo?: (resource: Resource) => string
234
+ exploreTo?: (resource: Resource) => string | RouteLocationRaw
235
235
  // Overrides the "Copier le lien" target.
236
236
  resourceExternalUrl?: (resource: Resource) => string
237
237
  replace?: boolean
@@ -107,7 +107,7 @@ const props = defineProps<{
107
107
  resource: Resource
108
108
  resources?: Resource[]
109
109
  resourceTo?: (resource: Resource) => RouteLocationRaw
110
- exploreTo?: (resource: Resource) => string
110
+ exploreTo?: (resource: Resource) => string | RouteLocationRaw
111
111
  // Overrides the "Copier le lien" target.
112
112
  resourceExternalUrl?: (resource: Resource) => string
113
113
  replace?: boolean
@@ -80,7 +80,7 @@ const props = defineProps<{
80
80
  dataset: Dataset | DatasetV2
81
81
  resources?: Resource[]
82
82
  resourceTo?: (resource: Resource) => RouteLocationRaw
83
- exploreTo?: (resource: Resource) => string
83
+ exploreTo?: (resource: Resource) => string | RouteLocationRaw
84
84
  resourceExternalUrl?: (resource: Resource) => string
85
85
  replace?: boolean
86
86
  fullscreen?: boolean