@piveau/piveau-hub-ui-modules 4.8.4 → 4.9.0
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/PvDataInfoBox/PvDataInfoBox.vue.mjs +25 -31
- package/dist/PvDataInfoBox/PvDataInfoBox.vue.mjs.map +1 -1
- package/dist/citation/plugins/dcat-state-to-csl.mjs +26 -23
- package/dist/citation/plugins/dcat-state-to-csl.mjs.map +1 -1
- package/dist/citation/template/deu.mjs +1 -1
- package/dist/citation/template/deu.mjs.map +1 -1
- package/dist/piveau-hub-ui-modules.css +1 -1
- package/dist/services/datasetService.mjs +1 -1
- package/dist/services/datasetService.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { resolveComponent as n, openBlock as r, createBlock as
|
|
3
|
-
import
|
|
4
|
-
const
|
|
1
|
+
import b from "./PvDataInfoBox.vue2.mjs";
|
|
2
|
+
import { resolveComponent as n, openBlock as r, createBlock as l, normalizeClass as i, withCtx as D, renderSlot as a, createElementVNode as e, toDisplayString as p, createCommentVNode as s, createTextVNode as d, createElementBlock as c, createVNode as f } from "vue";
|
|
3
|
+
import k from "../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
+
const $ = {
|
|
5
5
|
class: "dataset-info-box-header",
|
|
6
6
|
"data-cy": "dataset-title"
|
|
7
|
-
},
|
|
7
|
+
}, y = { class: "card-title m0" }, h = { class: "dataset-info-box-body" }, B = { class: "row" }, M = {
|
|
8
8
|
key: 0,
|
|
9
9
|
class: "col-12 col-md-2"
|
|
10
10
|
}, C = ["src"], I = {
|
|
@@ -15,17 +15,17 @@ const D = {
|
|
|
15
15
|
class: "dataset-info-box-footer"
|
|
16
16
|
};
|
|
17
17
|
function V(t, o, T, w, E, L) {
|
|
18
|
-
const g = n("pv-data-info-box-description"), u = n("PvDataInfoBoxFormats"), m = n("PvDataInfoBoxFooter"),
|
|
19
|
-
return r(),
|
|
18
|
+
const g = n("pv-data-info-box-description"), u = n("PvDataInfoBoxFormats"), m = n("PvDataInfoBoxFooter"), v = n("router-link");
|
|
19
|
+
return r(), l(v, {
|
|
20
20
|
to: t.to,
|
|
21
|
-
class:
|
|
21
|
+
class: i(["dataset-info-box text-dark text-decoration-none", { "dataset-info-box--catalog": t.catalogMode }])
|
|
22
22
|
}, {
|
|
23
|
-
default:
|
|
24
|
-
t.compact ? s("", !0) : a(t.$slots, "header", {
|
|
25
|
-
e("div",
|
|
26
|
-
e("h2",
|
|
23
|
+
default: D(() => [
|
|
24
|
+
t.compact ? s("", !0) : a(t.$slots, "header", {}, () => [
|
|
25
|
+
e("div", $, [
|
|
26
|
+
e("h2", y, p(t.datasetOrCatalogTitle), 1)
|
|
27
27
|
])
|
|
28
|
-
]),
|
|
28
|
+
], void 0, 0),
|
|
29
29
|
o[5] || (o[5] = d()),
|
|
30
30
|
a(t.$slots, "body", { dataset: t.dataset }, () => [
|
|
31
31
|
e("div", h, [
|
|
@@ -34,21 +34,21 @@ function V(t, o, T, w, E, L) {
|
|
|
34
34
|
e("img", {
|
|
35
35
|
src: t.src,
|
|
36
36
|
alt: "img",
|
|
37
|
-
class:
|
|
37
|
+
class: i(["catalog-img border border-dark", { "catalog-img--big": !t.compact }])
|
|
38
38
|
}, null, 10, C)
|
|
39
39
|
])) : s("", !0),
|
|
40
40
|
o[2] || (o[2] = d()),
|
|
41
41
|
e("div", I, [
|
|
42
|
-
t.compact ? a(t.$slots, "header", {
|
|
42
|
+
t.compact ? a(t.$slots, "header", {}, () => [
|
|
43
43
|
e("div", P, [
|
|
44
44
|
e("h2", F, p(t.datasetOrCatalogTitle), 1)
|
|
45
45
|
])
|
|
46
|
-
]) : s("", !0),
|
|
46
|
+
], void 0, 0) : s("", !0),
|
|
47
47
|
o[0] || (o[0] = d()),
|
|
48
48
|
a(t.$slots, "description", {}, () => [
|
|
49
|
-
!t.catalogMode || !t.compact ? (r(),
|
|
49
|
+
!t.catalogMode || !t.compact ? (r(), l(g, {
|
|
50
50
|
key: 0,
|
|
51
|
-
class:
|
|
51
|
+
class: i("mb-3"),
|
|
52
52
|
description: t.dataset.description,
|
|
53
53
|
"description-max-length": t.descriptionMaxLength,
|
|
54
54
|
truncate: t.descriptionMaxLength
|
|
@@ -60,7 +60,7 @@ function V(t, o, T, w, E, L) {
|
|
|
60
60
|
o[3] || (o[3] = d()),
|
|
61
61
|
t.dataset.formats && t.dataset.formats.length > 0 ? (r(), c("div", {
|
|
62
62
|
key: 1,
|
|
63
|
-
class:
|
|
63
|
+
class: i(["dataset-info-box-badge-container col-12 mb-3", { "col-md-3": !t.compact }])
|
|
64
64
|
}, [
|
|
65
65
|
a(t.$slots, "right", {
|
|
66
66
|
formats: t.dataset.formats
|
|
@@ -71,10 +71,7 @@ function V(t, o, T, w, E, L) {
|
|
|
71
71
|
])
|
|
72
72
|
], 2)) : s("", !0),
|
|
73
73
|
o[4] || (o[4] = d()),
|
|
74
|
-
t.compact ? a(t.$slots, "footer", {
|
|
75
|
-
key: 2,
|
|
76
|
-
dataset: t.dataset
|
|
77
|
-
}, () => [
|
|
74
|
+
t.compact ? a(t.$slots, "footer", { dataset: t.dataset }, () => [
|
|
78
75
|
f(m, {
|
|
79
76
|
class: "col-12",
|
|
80
77
|
src: t.src,
|
|
@@ -82,16 +79,13 @@ function V(t, o, T, w, E, L) {
|
|
|
82
79
|
updatedDate: null,
|
|
83
80
|
catalog: t.catalogMode ? t.dataset.description : t.dataset.catalog
|
|
84
81
|
}, null, 8, ["src", "catalog"])
|
|
85
|
-
]) : s("", !0)
|
|
82
|
+
], void 0, 2) : s("", !0)
|
|
86
83
|
])
|
|
87
84
|
])
|
|
88
85
|
]),
|
|
89
86
|
o[6] || (o[6] = d()),
|
|
90
|
-
t.compact ? s("", !0) : a(t.$slots, "footer", {
|
|
91
|
-
|
|
92
|
-
dataset: t.dataset
|
|
93
|
-
}, () => [
|
|
94
|
-
t.catalogMode ? (r(), c("div", N)) : (r(), i(m, {
|
|
87
|
+
t.compact ? s("", !0) : a(t.$slots, "footer", { dataset: t.dataset }, () => [
|
|
88
|
+
t.catalogMode ? (r(), c("div", N)) : (r(), l(m, {
|
|
95
89
|
key: 0,
|
|
96
90
|
class: "dataset-info-box-footer",
|
|
97
91
|
src: t.src,
|
|
@@ -99,12 +93,12 @@ function V(t, o, T, w, E, L) {
|
|
|
99
93
|
updatedDate: t.dataset.updatedDate,
|
|
100
94
|
catalog: t.dataset.catalog
|
|
101
95
|
}, null, 8, ["src", "createdDate", "updatedDate", "catalog"]))
|
|
102
|
-
])
|
|
96
|
+
], void 0, 1)
|
|
103
97
|
]),
|
|
104
98
|
_: 3
|
|
105
99
|
}, 8, ["to", "class"]);
|
|
106
100
|
}
|
|
107
|
-
const j = /* @__PURE__ */
|
|
101
|
+
const j = /* @__PURE__ */ k(b, [["render", V]]);
|
|
108
102
|
export {
|
|
109
103
|
j as default
|
|
110
104
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PvDataInfoBox.vue.mjs","sources":["../../lib/PvDataInfoBox/PvDataInfoBox.vue"],"sourcesContent":["<template>\n <router-link\n :to=\"to\"\n class=\"dataset-info-box text-dark text-decoration-none\"\n :class=\"{'dataset-info-box--catalog': catalogMode}\"\n >\n <slot name=\"header\" v-if=\"!compact\">\n <div class=\"dataset-info-box-header\" data-cy=\"dataset-title\">\n <h2 class=\"card-title m0\">{{ datasetOrCatalogTitle }}</h2>\n </div>\n </slot>\n\n <!-- Body slot -->\n <slot name=\"body\" :dataset=\"dataset\">\n <div class=\"dataset-info-box-body\">\n <div class=\"row\">\n <div v-if=\"catalogMode && !compact\" class=\"col-12 col-md-2\">\n <img\n :src=\"src\"\n alt=\"img\"\n class=\"catalog-img border border-dark\"\n :class=\"{'catalog-img--big': !compact}\"\n />\n </div>\n \n <div\n class=\"dataset-info-box-description-container col-12 col-md\"\n data-cy=\"dataset-description\"\n >\n <slot name=\"header\" v-if=\"compact\">\n <div data-cy=\"dataset-title\">\n <h2 class=\"card-title\">{{ datasetOrCatalogTitle }}</h2>\n </div>\n </slot>\n\n <slot name=\"description\">\n <pv-data-info-box-description\n v-if=\"!catalogMode || !compact\"\n :class=\"'mb-3'\"\n :description=\"dataset.description\"\n :description-max-length=\"descriptionMaxLength\"\n :truncate=\"descriptionMaxLength\"\n />\n </slot>\n \n <slot name=\"after-description\" />\n </div>\n <div\n v-if=\"dataset.formats && dataset.formats.length > 0\"\n class=\"dataset-info-box-badge-container col-12 mb-3\"\n :class=\"{ 'col-md-3': !compact }\"\n >\n <slot name=\"right\" :formats=\"dataset.formats\">\n <PvDataInfoBoxFormats :formats=\"dataset.formats\"></PvDataInfoBoxFormats>\n </slot>\n </div>\n <slot name=\"footer\" :dataset=\"dataset\" v-if=\"compact\">\n <PvDataInfoBoxFooter\n class=\"col-12\"\n :src=\"src\"\n :createdDate=\"null\"\n :updatedDate=\"null\"\n :catalog=\"catalogMode ? dataset.description : dataset.catalog\"\n />\n <!-- <div v-else class=\"dataset-info-box-footer\" /> -->\n </slot>\n </div>\n </div>\n </slot>\n\n <!-- Footer slot -->\n <slot name=\"footer\" :dataset=\"dataset\" v-if=\"!compact\">\n <PvDataInfoBoxFooter\n class=\"dataset-info-box-footer\"\n v-if=\"!catalogMode\"\n :src=\"src\"\n :createdDate=\"dataset.createdDate\"\n :updatedDate=\"dataset.updatedDate\"\n :catalog=\"dataset.catalog\"\n />\n <div v-else class=\"dataset-info-box-footer\" />\n </slot>\n </router-link>\n</template>\n\n<script lang=\"ts\">\nimport { Dataset } from \"../types/global\";\nimport {defineComponent, PropType} from \"vue\";\nimport type RouteLocationRaw from \"vue-router\";\n\nimport PvBadge from \"../PvBadge/PvBadge.vue\";\nimport PvDataInfoBoxFooter from \"./PvDataInfoBoxFooter.vue\";\nimport PvDataInfoBoxDescription from \"./PvDataInfoBoxDescription.vue\";\nimport PvDataInfoBoxFormats from \"./PvDataInfoBoxFormats.vue\"\n\nexport default defineComponent({\n name: \"PvDataInfoBox\",\n components: {\n PvBadge,\n PvDataInfoBoxFooter,\n PvDataInfoBoxDescription,\n PvDataInfoBoxFormats,\n },\n props: {\n /**\n * The dataset to display.\n */\n dataset: {\n type: Object as PropType<Dataset>,\n default: () =>\n ({\n title: \"\",\n description: \"\",\n catalog: \"\",\n createdDate: \"12.12.2023\",\n updatedDate: \"13.12.2023\",\n formats: [],\n } as Dataset),\n },\n\n /**\n * The route to navigate to when clicking on the dataset.\n */\n to: {\n type: [Object, String] as PropType<RouteLocationRaw | string>,\n required: true,\n },\n\n /**\n * Specified the maximum length of the description before it is cut off.\n */\n descriptionMaxLength: {\n type: Number,\n default: 200,\n },\n\n /**\n * Image source for the catalog logo/flag.\n */\n src: {\n type: String,\n default: \"\",\n },\n\n /**\n * If true, swaps to catalog display mode\n */\n catalogMode: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If true switches from two column to one column layout\n * and decreases vertical distancing between elements.\n */\n compact: {\n type: Boolean,\n default: false,\n },\n },\n\n computed: {\n datasetOrCatalogTitle(): string {\n const { dataset, catalogMode } = this;\n return catalogMode\n ? dataset.title || dataset.catalog || \"\"\n : dataset.title || \"\";\n },\n },\n});\n</script>\n"],"names":["_hoisted_1","_hoisted_2","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_10","_resolveComponent","_openBlock","_createBlock","_component_router_link","_ctx","_normalizeClass","_withCtx","_createCommentVNode","_renderSlot","_createElementVNode","_cache","_createTextVNode","catalogMode","compact","_hoisted_4","_createElementBlock","_hoisted_8","_component_pv_data_info_box_description","descriptionMaxLength","dataset","_createVNode","_component_PvDataInfoBoxFormats","src","_component_PvDataInfoBoxFooter"],"mappings":";;;MAO2CA,IAAQ;AAAA,EAAA,OAAA;AAAA;GAQtCC,IAAA,EAAA,OAAM,iFAC2BC,IAAM;AAAA,EAAA,KAAA;AAAA;GAUxCC,IAAM,CAAA,KAAA,GACNC,IAAQ;AAAA,EAAA,OAAA;AAAA;oEAqDFC,IAAM;AAAA,EAAA,KAAA;AAAA;;;gHA/EtBC,EAiFc,aAAA;SA/EPC,EAAC,GAAAC,EAAAC,GAAA;AAAA,IAAA,IAAAC,EAAA;AAAA,IAOC,OAAAC,EAAA,CAAA,mDAAA,EAAA,6BAAAD,EAAA,YAAA,CAAA,CAAA;AAAA,EAAA,GAAA;AAAA,aAJPE,EAIO,MAAA;AAAA,MAHLF,EAAA,UAMFG,EAuDO,IAAA,EAAA,IA7DLC,EACEJ,EAA0D,QAAA,UAA1D,
|
|
1
|
+
{"version":3,"file":"PvDataInfoBox.vue.mjs","sources":["../../lib/PvDataInfoBox/PvDataInfoBox.vue"],"sourcesContent":["<template>\n <router-link\n :to=\"to\"\n class=\"dataset-info-box text-dark text-decoration-none\"\n :class=\"{'dataset-info-box--catalog': catalogMode}\"\n >\n <slot name=\"header\" v-if=\"!compact\">\n <div class=\"dataset-info-box-header\" data-cy=\"dataset-title\">\n <h2 class=\"card-title m0\">{{ datasetOrCatalogTitle }}</h2>\n </div>\n </slot>\n\n <!-- Body slot -->\n <slot name=\"body\" :dataset=\"dataset\">\n <div class=\"dataset-info-box-body\">\n <div class=\"row\">\n <div v-if=\"catalogMode && !compact\" class=\"col-12 col-md-2\">\n <img\n :src=\"src\"\n alt=\"img\"\n class=\"catalog-img border border-dark\"\n :class=\"{'catalog-img--big': !compact}\"\n />\n </div>\n \n <div\n class=\"dataset-info-box-description-container col-12 col-md\"\n data-cy=\"dataset-description\"\n >\n <slot name=\"header\" v-if=\"compact\">\n <div data-cy=\"dataset-title\">\n <h2 class=\"card-title\">{{ datasetOrCatalogTitle }}</h2>\n </div>\n </slot>\n\n <slot name=\"description\">\n <pv-data-info-box-description\n v-if=\"!catalogMode || !compact\"\n :class=\"'mb-3'\"\n :description=\"dataset.description\"\n :description-max-length=\"descriptionMaxLength\"\n :truncate=\"descriptionMaxLength\"\n />\n </slot>\n \n <slot name=\"after-description\" />\n </div>\n <div\n v-if=\"dataset.formats && dataset.formats.length > 0\"\n class=\"dataset-info-box-badge-container col-12 mb-3\"\n :class=\"{ 'col-md-3': !compact }\"\n >\n <slot name=\"right\" :formats=\"dataset.formats\">\n <PvDataInfoBoxFormats :formats=\"dataset.formats\"></PvDataInfoBoxFormats>\n </slot>\n </div>\n <slot name=\"footer\" :dataset=\"dataset\" v-if=\"compact\">\n <PvDataInfoBoxFooter\n class=\"col-12\"\n :src=\"src\"\n :createdDate=\"null\"\n :updatedDate=\"null\"\n :catalog=\"catalogMode ? dataset.description : dataset.catalog\"\n />\n <!-- <div v-else class=\"dataset-info-box-footer\" /> -->\n </slot>\n </div>\n </div>\n </slot>\n\n <!-- Footer slot -->\n <slot name=\"footer\" :dataset=\"dataset\" v-if=\"!compact\">\n <PvDataInfoBoxFooter\n class=\"dataset-info-box-footer\"\n v-if=\"!catalogMode\"\n :src=\"src\"\n :createdDate=\"dataset.createdDate\"\n :updatedDate=\"dataset.updatedDate\"\n :catalog=\"dataset.catalog\"\n />\n <div v-else class=\"dataset-info-box-footer\" />\n </slot>\n </router-link>\n</template>\n\n<script lang=\"ts\">\nimport { Dataset } from \"../types/global\";\nimport {defineComponent, PropType} from \"vue\";\nimport type RouteLocationRaw from \"vue-router\";\n\nimport PvBadge from \"../PvBadge/PvBadge.vue\";\nimport PvDataInfoBoxFooter from \"./PvDataInfoBoxFooter.vue\";\nimport PvDataInfoBoxDescription from \"./PvDataInfoBoxDescription.vue\";\nimport PvDataInfoBoxFormats from \"./PvDataInfoBoxFormats.vue\"\n\nexport default defineComponent({\n name: \"PvDataInfoBox\",\n components: {\n PvBadge,\n PvDataInfoBoxFooter,\n PvDataInfoBoxDescription,\n PvDataInfoBoxFormats,\n },\n props: {\n /**\n * The dataset to display.\n */\n dataset: {\n type: Object as PropType<Dataset>,\n default: () =>\n ({\n title: \"\",\n description: \"\",\n catalog: \"\",\n createdDate: \"12.12.2023\",\n updatedDate: \"13.12.2023\",\n formats: [],\n } as Dataset),\n },\n\n /**\n * The route to navigate to when clicking on the dataset.\n */\n to: {\n type: [Object, String] as PropType<RouteLocationRaw | string>,\n required: true,\n },\n\n /**\n * Specified the maximum length of the description before it is cut off.\n */\n descriptionMaxLength: {\n type: Number,\n default: 200,\n },\n\n /**\n * Image source for the catalog logo/flag.\n */\n src: {\n type: String,\n default: \"\",\n },\n\n /**\n * If true, swaps to catalog display mode\n */\n catalogMode: {\n type: Boolean,\n default: false,\n },\n\n /**\n * If true switches from two column to one column layout\n * and decreases vertical distancing between elements.\n */\n compact: {\n type: Boolean,\n default: false,\n },\n },\n\n computed: {\n datasetOrCatalogTitle(): string {\n const { dataset, catalogMode } = this;\n return catalogMode\n ? dataset.title || dataset.catalog || \"\"\n : dataset.title || \"\";\n },\n },\n});\n</script>\n"],"names":["_hoisted_1","_hoisted_2","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_10","_resolveComponent","_openBlock","_createBlock","_component_router_link","_ctx","_normalizeClass","_withCtx","_createCommentVNode","_renderSlot","_createElementVNode","_cache","_createTextVNode","catalogMode","compact","_hoisted_4","_createElementBlock","_hoisted_8","_component_pv_data_info_box_description","descriptionMaxLength","dataset","_createVNode","_component_PvDataInfoBoxFormats","src","_component_PvDataInfoBoxFooter"],"mappings":";;;MAO2CA,IAAQ;AAAA,EAAA,OAAA;AAAA;GAQtCC,IAAA,EAAA,OAAM,iFAC2BC,IAAM;AAAA,EAAA,KAAA;AAAA;GAUxCC,IAAM,CAAA,KAAA,GACNC,IAAQ;AAAA,EAAA,OAAA;AAAA;oEAqDFC,IAAM;AAAA,EAAA,KAAA;AAAA;;;gHA/EtBC,EAiFc,aAAA;SA/EPC,EAAC,GAAAC,EAAAC,GAAA;AAAA,IAAA,IAAAC,EAAA;AAAA,IAOC,OAAAC,EAAA,CAAA,mDAAA,EAAA,6BAAAD,EAAA,YAAA,CAAA,CAAA;AAAA,EAAA,GAAA;AAAA,aAJPE,EAIO,MAAA;AAAA,MAHLF,EAAA,UAMFG,EAuDO,IAAA,EAAA,IA7DLC,EACEJ,EAA0D,QAAA,UAA1D,CAAA,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1,3}\/?$/i);
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
function p(e = "") {
|
|
9
|
+
return e.replace(/^European Commission,\s+/, "European Commission: ");
|
|
10
|
+
}
|
|
11
|
+
function E(e) {
|
|
12
|
+
var u, c;
|
|
13
|
+
const r = e.__meta;
|
|
14
|
+
let o;
|
|
12
15
|
if (e.admsIdentifiers) {
|
|
13
|
-
const i = e.admsIdentifiers.find(({ identifier:
|
|
14
|
-
if (
|
|
15
|
-
return
|
|
16
|
+
const i = e.admsIdentifiers.find(({ identifier: b }) => m(b));
|
|
17
|
+
if (o = i && i.identifier, !r.skipDoiNegotiation && o)
|
|
18
|
+
return o;
|
|
16
19
|
}
|
|
17
|
-
const
|
|
20
|
+
const t = r && (r.lang || "en"), h = e.identifiers.find(f) || r && (r.url || ""), d = e.publisher && e.publisher.name && e.publisher.name.trim().toLowerCase() || "", g = d === "eurostat" ? e.identifiers.find(
|
|
18
21
|
(i) => !m(i) && !f(i)
|
|
19
|
-
) : null, l = ((
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
const a = e.modificationDate || e.releaseDate ? new Date(e.modificationDate || e.releaseDate) : null, s = e.modificationDate && e.releaseDate ? new Date(e.releaseDate) : null,
|
|
22
|
+
) : null, l = ((u = e.creator) == null ? void 0 : u.name) && [{ literal: p((c = e.creator) == null ? void 0 : c.name) }], D = "European Commission";
|
|
23
|
+
let n = C.map((i) => i.toLowerCase()).includes(d) ? `${D}: ${e.publisher.name}` : e.publisher.name;
|
|
24
|
+
n = p(n || ""), n = n === l ? null : n;
|
|
25
|
+
const a = e.modificationDate || e.releaseDate ? new Date(e.modificationDate || e.releaseDate) : null, s = e.modificationDate && e.releaseDate ? new Date(e.releaseDate) : null, I = {
|
|
23
26
|
...a && {
|
|
24
27
|
issued: {
|
|
25
28
|
"date-parts": [[
|
|
@@ -43,25 +46,25 @@ function v(e) {
|
|
|
43
46
|
{
|
|
44
47
|
type: "dataset",
|
|
45
48
|
id: e.admsIdentifiers && e.admsIdentifiers.length > 0 ? `https://doi.org/${e.admsIdentifiers[0].identifier}` : e.identifiers[0],
|
|
46
|
-
categories: e.categories.map(({ label: i }) => i[
|
|
47
|
-
language:
|
|
49
|
+
categories: e.categories.map(({ label: i }) => i[t]) || [],
|
|
50
|
+
language: t,
|
|
48
51
|
author: l,
|
|
49
52
|
// contains 'issued' and 'original-date'
|
|
50
|
-
...
|
|
53
|
+
...I,
|
|
51
54
|
// 'original-date': originalDate,
|
|
52
|
-
abstract: e.description[
|
|
53
|
-
DOI: e.admsIdentifiers && e.admsIdentifiers.length > 0 ?
|
|
54
|
-
publisher:
|
|
55
|
-
title: e.title[
|
|
56
|
-
"title-short":
|
|
57
|
-
URL:
|
|
55
|
+
abstract: e.description[t],
|
|
56
|
+
DOI: e.admsIdentifiers && e.admsIdentifiers.length > 0 ? o || e.admsIdentifiers : void 0,
|
|
57
|
+
publisher: n,
|
|
58
|
+
title: e.title[t],
|
|
59
|
+
"title-short": g || void 0,
|
|
60
|
+
URL: h,
|
|
58
61
|
version: e.versionInfo
|
|
59
62
|
}
|
|
60
63
|
];
|
|
61
64
|
}
|
|
62
65
|
function _(e) {
|
|
63
66
|
e.input.add("@piveau/dcat-state", {
|
|
64
|
-
parse:
|
|
67
|
+
parse: E
|
|
65
68
|
});
|
|
66
69
|
}
|
|
67
70
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dcat-state-to-csl.mjs","sources":["../../../lib/citation/plugins/dcat-state-to-csl.ts"],"sourcesContent":["// @ts-nocheck\nimport dgs from './dg';\n\n/**\n * Regex check for DOI\n * @param {String} doi the given string to check\n * @returns true, if doi is a DOI\n */\nfunction checkDoi(doi = '') {\n return doi.match(/^10\\.\\d{4,9}\\/[-._;()/:A-Z0-9]+$/i);\n}\n\n/**\n * Regex check for pURI (EU Persistent URI)\n * @param {String} puri the given string to check\n * @returns true, if puri is a pURI\n */\nfunction checkpUri(puri = '') {\n return puri.match(/^http:\\/\\/data\\.europa\\.eu(\\/[^/]+){1,3}\\/?$/i);\n}\n\nfunction dcatStateToCsl(state) {\n // eslint-disable-next-line no-underscore-dangle\n const meta = state.__meta;\n let doi;\n\n // If there is a DOI, return it directly for DOI content negotiation\n if (state.admsIdentifiers) {\n // check if there is a DOI\n const admsIdentifier = state.admsIdentifiers.find(({ identifier }) => checkDoi(identifier));\n doi = admsIdentifier && admsIdentifier.identifier;\n\n // return doi to let citation-js do their work\n if (!meta.skipDoiNegotiation && doi) return doi;\n }\n\n // If there is no DOI, create CSL object\n\n // Selected language and URL\n const lang = meta && (meta.lang || 'en');\n const URL = state.identifiers.find(checkpUri)\n || (meta && (meta.url || ''));\n\n // EUROSTAT identifier\n // Match all strings that are not pURI or DOI\n const hasPublisher = state.publisher && state.publisher.name;\n const publisherTrimmed = (hasPublisher && state.publisher.name.trim().toLowerCase()) || '';\n const isEurostat = publisherTrimmed === 'eurostat';\n const eurostatId = isEurostat\n ? state.identifiers.find(\n identifier => !checkDoi(identifier) && !checkpUri(identifier),\n )\n : null;\n\n // Creator\n const author = state.creator?.name && [{ literal: state.creator?.name }];\n\n // Provider\n // If publisher is in DG, prepend 'European Commission
|
|
1
|
+
{"version":3,"file":"dcat-state-to-csl.mjs","sources":["../../../lib/citation/plugins/dcat-state-to-csl.ts"],"sourcesContent":["// @ts-nocheck\nimport dgs from './dg';\n\n/**\n * Regex check for DOI\n * @param {String} doi the given string to check\n * @returns true, if doi is a DOI\n */\nfunction checkDoi(doi = '') {\n return doi.match(/^10\\.\\d{4,9}\\/[-._;()/:A-Z0-9]+$/i);\n}\n\n/**\n * Regex check for pURI (EU Persistent URI)\n * @param {String} puri the given string to check\n * @returns true, if puri is a pURI\n */\nfunction checkpUri(puri = '') {\n return puri.match(/^http:\\/\\/data\\.europa\\.eu(\\/[^/]+){1,3}\\/?$/i);\n}\n\n/**\n * Use a colon between main and subordinate corporate body for EU institutions.\n */\nfunction formatEuCorporateBodyName(name = '') {\n return name.replace(/^European Commission,\\s+/, 'European Commission: ');\n}\n\nfunction dcatStateToCsl(state) {\n // eslint-disable-next-line no-underscore-dangle\n const meta = state.__meta;\n let doi;\n\n // If there is a DOI, return it directly for DOI content negotiation\n if (state.admsIdentifiers) {\n // check if there is a DOI\n const admsIdentifier = state.admsIdentifiers.find(({ identifier }) => checkDoi(identifier));\n doi = admsIdentifier && admsIdentifier.identifier;\n\n // return doi to let citation-js do their work\n if (!meta.skipDoiNegotiation && doi) return doi;\n }\n\n // If there is no DOI, create CSL object\n\n // Selected language and URL\n const lang = meta && (meta.lang || 'en');\n const URL = state.identifiers.find(checkpUri)\n || (meta && (meta.url || ''));\n\n // EUROSTAT identifier\n // Match all strings that are not pURI or DOI\n const hasPublisher = state.publisher && state.publisher.name;\n const publisherTrimmed = (hasPublisher && state.publisher.name.trim().toLowerCase()) || '';\n const isEurostat = publisherTrimmed === 'eurostat';\n const eurostatId = isEurostat\n ? state.identifiers.find(\n identifier => !checkDoi(identifier) && !checkpUri(identifier),\n )\n : null;\n\n // Creator\n const author = state.creator?.name && [{ literal: formatEuCorporateBodyName(state.creator?.name) }];\n\n // Provider\n // If publisher is in DG, prepend 'European Commission: ' before it\n const EUROPEAN_COMISSION = 'European Commission';\n const isDg = dgs.map(dg => dg.toLowerCase()).includes(publisherTrimmed);\n let publisher = isDg\n ? `${EUROPEAN_COMISSION}: ${state.publisher.name}`\n : state.publisher.name;\n publisher = formatEuCorporateBodyName(publisher || '');\n // If author and publisher are identical, remove publisher;\n publisher = publisher === author ? null : publisher;\n\n // Date\n // If there are both release date and modification date available, prefer\n // modification date as the issued date.\n const issuedDate = state.modificationDate || state.releaseDate\n ? new Date(state.modificationDate || state.releaseDate)\n : null;\n\n // take release date as original date only if there's both release and\n // modification date available\n const originalDate = state.modificationDate && state.releaseDate\n ? new Date(state.releaseDate)\n : null;\n\n const date = {\n ...(issuedDate && {\n issued: {\n 'date-parts': [[\n issuedDate.getFullYear(),\n issuedDate.getMonth() + 1,\n issuedDate.getDate(),\n ]],\n },\n }),\n ...(originalDate && {\n 'original-date': {\n 'date-parts': [[\n originalDate.getFullYear(),\n originalDate.getMonth() + 1,\n originalDate.getDate(),\n ]],\n },\n }),\n };\n\n const csl = [\n {\n type: 'dataset',\n id:\n state.admsIdentifiers && state.admsIdentifiers.length > 0\n ? `https://doi.org/${state.admsIdentifiers[0].identifier}`\n : state.identifiers[0],\n categories: state.categories.map(({ label }) => label[lang]) || [],\n language: lang,\n author,\n // contains 'issued' and 'original-date'\n ...date,\n // 'original-date': originalDate,\n abstract: state.description[lang],\n DOI: state.admsIdentifiers && state.admsIdentifiers.length > 0\n ? doi || state.admsIdentifiers\n : undefined,\n publisher,\n title: state.title[lang],\n 'title-short': eurostatId || undefined,\n URL,\n version: state.versionInfo,\n },\n ];\n return csl;\n}\n\nexport default function install(plugins: typeof import('@citation-js/core').plugins) {\n // Add custom Vuex DatasetDetails state parser to citation-js\n plugins.input.add('@piveau/dcat-state', {\n parse: dcatStateToCsl,\n });\n}\n"],"names":["checkDoi","doi","checkpUri","puri","formatEuCorporateBodyName","name","dcatStateToCsl","state","meta","admsIdentifier","identifier","lang","URL","publisherTrimmed","eurostatId","author","_a","_b","EUROPEAN_COMISSION","publisher","dgs","dg","issuedDate","originalDate","date","label","install","plugins"],"mappings":";AAQA,SAASA,EAASC,IAAM,IAAI;AACnB,SAAAA,EAAI,MAAM,mCAAmC;AACtD;AAOA,SAASC,EAAUC,IAAO,IAAI;AACrB,SAAAA,EAAK,MAAM,+CAA+C;AACnE;AAKA,SAASC,EAA0BC,IAAO,IAAI;AACrC,SAAAA,EAAK,QAAQ,4BAA4B,uBAAuB;AACzE;AAEA,SAASC,EAAeC,GAAO;;AAE7B,QAAMC,IAAOD,EAAM;AACf,MAAAN;AAGJ,MAAIM,EAAM,iBAAiB;AAEnB,UAAAE,IAAiBF,EAAM,gBAAgB,KAAK,CAAC,EAAE,YAAAG,QAAiBV,EAASU,CAAU,CAAC;A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