@piveau/piveau-hub-ui-modules 4.7.11 → 4.7.13
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/data-provider-interface/composables/aucotomplete.mjs +36 -26
- package/dist/data-provider-interface/composables/aucotomplete.mjs.map +1 -1
- package/dist/data-provider-interface/config/dcatapde/input-definition.mjs +1 -1
- package/dist/data-provider-interface/config/dcatapde/input-definition.mjs.map +1 -1
- package/dist/data-provider-interface/config/dcatapde/vocab-prefixes.mjs +1 -0
- package/dist/data-provider-interface/config/dcatapde/vocab-prefixes.mjs.map +1 -1
- package/dist/datasetDetails/features/DatasetDetailsPages.vue.mjs +60 -60
- package/dist/datasetDetails/features/DatasetDetailsPages.vue.mjs.map +1 -1
- package/dist/piveau-hub-ui-modules.css +1 -1
- package/package.json +1 -1
|
@@ -1,52 +1,62 @@
|
|
|
1
|
-
import { computed as
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { computed as y, toValue as m, inject as d } from "vue";
|
|
2
|
+
import i from "axios";
|
|
3
|
+
const $ = Symbol(
|
|
4
4
|
"autocomplete"
|
|
5
5
|
);
|
|
6
|
-
function
|
|
7
|
-
const { envs:
|
|
6
|
+
function A(a) {
|
|
7
|
+
const { envs: s, dpiContext: l } = a, n = (t) => {
|
|
8
|
+
var e;
|
|
9
|
+
const o = (e = m(l)) == null ? void 0 : e.specification, c = (o == null ? void 0 : o.vocabPrefixes) ?? {};
|
|
10
|
+
return t === "licence" && c.licenses ? "licenses" : t === "licenses" && !c.licenses && c.licence ? "licence" : t;
|
|
11
|
+
};
|
|
8
12
|
return {
|
|
9
13
|
name: "default",
|
|
10
14
|
adapter: {
|
|
11
|
-
requestFirstEntrySuggestions: async (t,
|
|
12
|
-
|
|
13
|
-
`${
|
|
14
|
-
|
|
15
|
+
requestFirstEntrySuggestions: async (t, o) => {
|
|
16
|
+
const c = n(t);
|
|
17
|
+
return i.get(`${o}search?filter=vocabulary&vocabulary=${c}`);
|
|
18
|
+
},
|
|
19
|
+
requestAutocompleteSuggestions: async (t) => {
|
|
20
|
+
const o = n(t.voc);
|
|
21
|
+
return i.get(
|
|
22
|
+
`${t.base}search?filter=vocabulary&vocabulary=${o}&q=${t.text}&limit=14`
|
|
23
|
+
);
|
|
24
|
+
},
|
|
15
25
|
requestResourceName: async (t) => {
|
|
16
|
-
const { voc:
|
|
26
|
+
const { voc: o, uri: c } = t, e = n(o), b = y(
|
|
17
27
|
() => {
|
|
18
|
-
var
|
|
19
|
-
return (
|
|
28
|
+
var r;
|
|
29
|
+
return (r = m(l)) == null ? void 0 : r.specification;
|
|
20
30
|
}
|
|
21
31
|
);
|
|
22
32
|
if (e === void 0 || e === "application")
|
|
23
33
|
return;
|
|
24
|
-
let
|
|
34
|
+
let u = "";
|
|
25
35
|
if (e === "iana-media-types" || e === "spdx-checksum-algorithm" || e === "dataset-status")
|
|
26
|
-
|
|
36
|
+
u = `${s.api.baseUrl}vocabularies/${e}`;
|
|
27
37
|
else {
|
|
28
|
-
const o =
|
|
29
|
-
|
|
38
|
+
const r = b.value.vocabPrefixes ?? {}, v = r[e] ?? r[o], p = c.replace(
|
|
39
|
+
v,
|
|
30
40
|
""
|
|
31
|
-
),
|
|
32
|
-
|
|
41
|
+
), f = encodeURIComponent(p);
|
|
42
|
+
u = p !== f ? `${s.api.baseUrl}vocabularies/${e}/vocable?resource=${encodeURIComponent(c)}` : `${s.api.baseUrl}vocabularies/${e}/${f}`;
|
|
33
43
|
}
|
|
34
|
-
return
|
|
44
|
+
return i.get(u);
|
|
35
45
|
}
|
|
36
46
|
}
|
|
37
47
|
};
|
|
38
48
|
}
|
|
39
|
-
function
|
|
40
|
-
const
|
|
41
|
-
if (!
|
|
49
|
+
function h() {
|
|
50
|
+
const a = d($);
|
|
51
|
+
if (!a)
|
|
42
52
|
throw new Error(
|
|
43
53
|
"[useAutocomplete] Autocomplete not found. Did you forget to inject it?"
|
|
44
54
|
);
|
|
45
|
-
return
|
|
55
|
+
return a;
|
|
46
56
|
}
|
|
47
57
|
export {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
58
|
+
$ as autocompleteKey,
|
|
59
|
+
A as defaultAutocompleteAdapter,
|
|
60
|
+
h as useAutocomplete
|
|
51
61
|
};
|
|
52
62
|
//# sourceMappingURL=aucotomplete.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aucotomplete.mjs","sources":["../../../lib/data-provider-interface/composables/aucotomplete.ts"],"sourcesContent":["import { computed, inject, InjectionKey, toValue } from \"vue\";\nimport axios from \"axios\";\nimport { ComputedDpiContext, useDpiContext } from \"./useDpiContext\";\nimport { useRuntimeEnv } from \"../../composables/useRuntimeEnv\";\nimport { ResolvedConfig } from \"../../configurations/config-schema\";\n\nexport interface AutocompleteInstance {\n requestFirstEntrySuggestions(voc: string, base: string): Promise<any>;\n requestAutocompleteSuggestions(options: {\n voc: string;\n text: string;\n base: string;\n }): Promise<any>;\n requestResourceName(options: {\n voc: string;\n uri: string;\n envs: any;\n }): Promise<any>;\n}\n\nexport interface AutocompleteOptions {\n name: string;\n adapter: AutocompleteInstance;\n}\n\nexport const autocompleteKey = Symbol(\n \"autocomplete\"\n) as InjectionKey<AutocompleteInstance>;\n\nexport function defaultAutocompleteAdapter(options: {\n envs: ResolvedConfig;\n dpiContext: ComputedDpiContext;\n}): AutocompleteOptions {\n const { envs, dpiContext } = options;\n\n return {\n name: \"default\",\n adapter: {\n requestFirstEntrySuggestions: async (voc, base) => {\n return axios.get(`${base}search?filter=vocabulary&vocabulary=${
|
|
1
|
+
{"version":3,"file":"aucotomplete.mjs","sources":["../../../lib/data-provider-interface/composables/aucotomplete.ts"],"sourcesContent":["import { computed, inject, InjectionKey, toValue } from \"vue\";\nimport axios from \"axios\";\nimport { ComputedDpiContext, useDpiContext } from \"./useDpiContext\";\nimport { useRuntimeEnv } from \"../../composables/useRuntimeEnv\";\nimport { ResolvedConfig } from \"../../configurations/config-schema\";\n\nexport interface AutocompleteInstance {\n requestFirstEntrySuggestions(voc: string, base: string): Promise<any>;\n requestAutocompleteSuggestions(options: {\n voc: string;\n text: string;\n base: string;\n }): Promise<any>;\n requestResourceName(options: {\n voc: string;\n uri: string;\n envs: any;\n }): Promise<any>;\n}\n\nexport interface AutocompleteOptions {\n name: string;\n adapter: AutocompleteInstance;\n}\n\nexport const autocompleteKey = Symbol(\n \"autocomplete\"\n) as InjectionKey<AutocompleteInstance>;\n\nexport function defaultAutocompleteAdapter(options: {\n envs: ResolvedConfig;\n dpiContext: ComputedDpiContext;\n}): AutocompleteOptions {\n const { envs, dpiContext } = options;\n\n const getVocabularyKey = (voc: string) => {\n const specification = toValue(dpiContext)?.specification;\n const vocabPrefixes = (specification?.vocabPrefixes as Record<string, string>) ?? {};\n\n if (voc === \"licence\" && vocabPrefixes[\"licenses\"]) {\n return \"licenses\";\n }\n\n if (voc === \"licenses\" && !vocabPrefixes[\"licenses\"] && vocabPrefixes[\"licence\"]) {\n return \"licence\";\n }\n\n return voc;\n };\n\n return {\n name: \"default\",\n adapter: {\n requestFirstEntrySuggestions: async (voc, base) => {\n const vocabulary = getVocabularyKey(voc);\n\n return axios.get(`${base}search?filter=vocabulary&vocabulary=${vocabulary}`);\n },\n requestAutocompleteSuggestions: async (options) => {\n const vocabulary = getVocabularyKey(options.voc);\n\n return axios.get(\n `${options.base}search?filter=vocabulary&vocabulary=${vocabulary}&q=${options.text}&limit=14`\n );\n },\n requestResourceName: async (options) => {\n const { voc, uri } = options;\n const vocabulary = getVocabularyKey(voc);\n const specification = computed(\n () => toValue(dpiContext)?.specification\n );\n\n // console.log('Options:', voc, uri);\n\n // // Catching invalid URIs\n if (vocabulary === undefined) return;\n if (vocabulary === \"application\") return;\n\n let req = \"\";\n\n // vocabularies for spdx checksum and inana-media-types are structured differently in the backend then other vocabularies\n if (vocabulary === \"iana-media-types\" || vocabulary === \"spdx-checksum-algorithm\" || vocabulary ==='dataset-status') {\n req = `${envs.api.baseUrl}vocabularies/${vocabulary}`;\n } \n else {\n const vocabPrefixes = (specification.value.vocabPrefixes as Record<string, string>) ?? {};\n const prefix = vocabPrefixes[vocabulary] ?? vocabPrefixes[voc];\n const value = uri.replace(\n prefix,\n \"\"\n );\n const valueEncoded = encodeURIComponent(value);\n const requestByUri = value !== valueEncoded;\n req = !requestByUri\n ? `${envs.api.baseUrl}vocabularies/${vocabulary}/${valueEncoded}`\n : `${\n envs.api.baseUrl\n }vocabularies/${vocabulary}/vocable?resource=${encodeURIComponent(uri)}`;\n }\n\n let result = axios.get(req);\n\n // console.log(\"#### Req:\", req);\n\n return result;\n },\n },\n };\n}\n\nexport function useAutocomplete() {\n const autocomplete = inject(autocompleteKey);\n\n if (!autocomplete) {\n throw new Error(\n \"[useAutocomplete] Autocomplete not found. Did you forget to inject it?\"\n );\n }\n\n return autocomplete;\n}\n"],"names":["autocompleteKey","defaultAutocompleteAdapter","options","envs","dpiContext","getVocabularyKey","voc","specification","_a","toValue","vocabPrefixes","base","vocabulary","axios","uri","computed","req","prefix","value","valueEncoded","useAutocomplete","autocomplete","inject"],"mappings":";;AAyBO,MAAMA,IAAkB;AAAA,EAC7B;AACF;AAEO,SAASC,EAA2BC,GAGnB;AAChB,QAAA,EAAE,MAAAC,GAAM,YAAAC,EAAe,IAAAF,GAEvBG,IAAmB,CAACC,MAAgB;;AAClC,UAAAC,KAAgBC,IAAAC,EAAQL,CAAU,MAAlB,gBAAAI,EAAqB,eACrCE,KAAiBH,KAAA,gBAAAA,EAAe,kBAA4C;AAElF,WAAID,MAAQ,aAAaI,EAAc,WAC9B,aAGLJ,MAAQ,cAAc,CAACI,EAAc,YAAeA,EAAc,UAC7D,YAGFJ;AAAA,EAAA;AAGF,SAAA;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA,MACP,8BAA8B,OAAOA,GAAKK,MAAS;AAC3C,cAAAC,IAAaP,EAAiBC,CAAG;AAEvC,eAAOO,EAAM,IAAI,GAAGF,CAAI,uCAAuCC,C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962
|
$formkit: "simpleConditional",
|
|
1963
1963
|
name: "dct:license",
|
|
1964
1964
|
identifier: "licence",
|
|
1965
|
-
voc: "
|
|
1965
|
+
voc: "licenses",
|
|
1966
1966
|
class: "",
|
|
1967
1967
|
options: { text: "dct:title", textarea: "skos:prefLabel", url: "skos:exactMatch" },
|
|
1968
1968
|
selection: { 1: "vocabulary", 2: "manually" }
|