@datagouv/components-next 0.0.28 → 0.0.30

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-DsdzSeFn.js";
1
+ import { g as Ke } from "./main-D5CXGAAc.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": "0.0.28",
3
+ "version": "0.0.30",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "./src/main.ts",
@@ -57,12 +57,16 @@
57
57
  >
58
58
  <AppLink
59
59
  :to="datasetUrl"
60
- class="text-gray-title text-base bg-none flex truncate"
60
+ class="text-gray-title text-base bg-none flex w-full truncate"
61
+ :target="datasetUrlInNewTab ? '_blank' : undefined"
61
62
  >
62
- <span class="block flex-initial truncate">{{ dataset.title }}</span>
63
+ <span
64
+ class="block truncate"
65
+ :class="dataset.acronym ? 'flex-initial' : 'flex-1'"
66
+ >{{ dataset.title }}</span>
63
67
  <small
64
68
  v-if="dataset.acronym"
65
- class="flex-none ml-2"
69
+ class="flex-1 ml-2"
66
70
  >{{ dataset.acronym }}</small>
67
71
  <span class="absolute inset-0" />
68
72
  </AppLink>
@@ -182,6 +186,7 @@ import AppLink from './AppLink.vue'
182
186
  * It is used as a separate prop to allow other sites using the package to define their own dataset pages.
183
187
  */
184
188
  datasetUrl: RouteLocationRaw
189
+ datasetUrlInNewTab?: boolean
185
190
 
186
191
  /**
187
192
  * The organizationUrl is an optional route location object to allow Vue Router to navigate to the details of the organization linked to tha dataset.
package/src/config.ts CHANGED
@@ -6,7 +6,6 @@ export type PluginConfig = {
6
6
  baseUrl: string
7
7
  apiBase: string
8
8
  devApiKey?: string | null
9
- staticUrl: string
10
9
  datasetQualityGuideUrl?: string
11
10
  schemaValidataUrl?: string
12
11
  schemaDocumentationUrl?: string
@@ -11,7 +11,7 @@ function constructUrl(baseUrl: string, path: string): string {
11
11
  export default function getDatasetOEmbedHtml(type: string, id: string): string {
12
12
  const config = useComponentsConfig()
13
13
 
14
- const staticUrl = constructUrl(config.staticUrl, 'oembed.js')
14
+ const staticUrl = constructUrl(config.baseUrl, 'oembed.js')
15
15
  return `<div data-udata-${type}="${id}"></div><script data-udata="${config.baseUrl}" src="${staticUrl}" async defer></script>`
16
16
  }
17
17
 
@@ -1,4 +0,0 @@
1
- import { _ as f } from "./main-DsdzSeFn.js";
2
- export {
3
- f as default
4
- };
@@ -1,12 +0,0 @@
1
- import { ref } from 'vue'
2
-
3
- export type ComponentsConfig = {
4
- staticUrl: string
5
- baseApiUrl: string
6
- }
7
-
8
- export const config = ref<ComponentsConfig | null>(null)
9
-
10
- export function setConfig(newConfig: ComponentsConfig) {
11
- config.value = newConfig
12
- }