@datagouv/components-next 0.0.13 → 0.0.15
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/{JsonPreview.client-B02h-wXN.js → JsonPreview.client-Dy6I-Q0V.js} +2 -2
- package/dist/{MapContainer.client-DPN0WBuA.js → MapContainer.client-Fe935Rz9.js} +1 -1
- package/dist/{PdfPreview.client-E2yon-e5.js → PdfPreview.client-B6yD3zry.js} +2 -2
- package/dist/{Pmtiles.client-D3ar7TqV.js → Pmtiles.client-1VNs-T1Y.js} +1 -1
- package/dist/Swagger.client-CSHRKwJw.js +4 -0
- package/dist/{XmlPreview.client-GLR3L2Ub.js → XmlPreview.client-Yk4MmKoF.js} +2 -2
- package/dist/components-next.css +3 -3
- package/dist/components-next.js +1 -1
- package/dist/{main-BpD9swJ2.js → main-DB9MQNqN.js} +30280 -30881
- package/dist/{pdf-vue3-BxkITVfK.js → pdf-vue3-BsBTO2sJ.js} +1 -1
- package/dist/{text-clamp.esm-Cj58jMQJ.js → text-clamp.esm-Cg3iit66.js} +1 -1
- package/dist/{vue3-json-viewer-CjJTUwus.js → vue3-json-viewer-BJTHWGQ8.js} +1 -1
- package/dist/{vue3-xml-viewer.common-yvwmMyER.js → vue3-xml-viewer.common-CE8AIWjK.js} +805 -799
- package/package.json +1 -2
- package/src/components/ResourceAccordion/Swagger.client.vue +3 -2
- package/src/functions/schemas.ts +0 -2
- package/src/functions/tabularApi.ts +5 -5
- package/dist/Swagger.client-FFfBn3xr.js +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datagouv/components-next",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.15",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/main.ts",
|
|
@@ -63,7 +63,6 @@
|
|
|
63
63
|
"@tsconfig/node22": "^22.0.0",
|
|
64
64
|
"@types/geojson": "^7946.0.16",
|
|
65
65
|
"@types/node": "^22.13.1",
|
|
66
|
-
"@types/swagger-ui": "^3.52.4",
|
|
67
66
|
"@vitejs/plugin-vue": "^5.2.1",
|
|
68
67
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
69
68
|
"@vue/eslint-config-typescript": "^14.3.0",
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
<script setup lang="ts">
|
|
6
6
|
import { onMounted } from 'vue'
|
|
7
|
-
import
|
|
8
|
-
import 'swagger-ui
|
|
7
|
+
import SwaggerUiDist from 'swagger-ui-dist'
|
|
8
|
+
import 'swagger-ui-dist/swagger-ui.css'
|
|
9
9
|
import '../../../assets/swagger-themes/newspaper.css'
|
|
10
10
|
|
|
11
|
+
const { SwaggerUIBundle } = SwaggerUiDist
|
|
11
12
|
const props = defineProps<{
|
|
12
13
|
url: string
|
|
13
14
|
}>()
|
package/src/functions/schemas.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { AxiosResponse } from 'axios'
|
|
2
1
|
import { ofetch } from 'ofetch'
|
|
3
2
|
import type { Resource } from '../types/resources'
|
|
4
3
|
import { useComponentsConfig } from '../config'
|
|
@@ -43,7 +42,6 @@ export interface ValidataError {
|
|
|
43
42
|
tags: Array<string>
|
|
44
43
|
}
|
|
45
44
|
export type SchemaResponseData = Array<RegisteredSchema>
|
|
46
|
-
export type SchemaResponse = AxiosResponse<SchemaResponseData>
|
|
47
45
|
|
|
48
46
|
type SchemaPath = { schema_name: string } | { schema_url: string }
|
|
49
47
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ofetch } from 'ofetch'
|
|
2
2
|
import { useComponentsConfig, type PluginConfig } from '../config'
|
|
3
3
|
|
|
4
4
|
export type SortConfig = {
|
|
@@ -9,19 +9,19 @@ export type SortConfig = {
|
|
|
9
9
|
/**
|
|
10
10
|
* Call Tabular-api to get table content
|
|
11
11
|
*/
|
|
12
|
-
export function getData(config: PluginConfig, id: string, page: number, sortConfig?: SortConfig) {
|
|
12
|
+
export async function getData(config: PluginConfig, id: string, page: number, sortConfig?: SortConfig) {
|
|
13
13
|
let url = `${config.tabularApiUrl}/api/resources/${id}/data/?page=${page}&page_size=${config.tabularApiPageSize || 15}`
|
|
14
14
|
if (sortConfig) {
|
|
15
15
|
url = url + `&${sortConfig.column}__sort=${sortConfig.type}`
|
|
16
16
|
}
|
|
17
|
-
return
|
|
17
|
+
return await ofetch(url)
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* Call Tabular-api to get table profile
|
|
22
22
|
*/
|
|
23
|
-
export function getProfile(id: string) {
|
|
23
|
+
export async function getProfile(id: string) {
|
|
24
24
|
const config = useComponentsConfig()
|
|
25
25
|
|
|
26
|
-
return
|
|
26
|
+
return await ofetch(`${config.tabularApiUrl}/api/resources/${id}/profile/`)
|
|
27
27
|
}
|