@piveau/piveau-hub-ui-modules 4.4.0-beta.2 → 4.4.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/catalogues/CatalogPage.vue.mjs +23 -22
- package/dist/catalogues/CatalogPage.vue.mjs.map +1 -1
- package/dist/composables/head/useDatasetDetailsDatasetHead.mjs +19 -15
- package/dist/composables/head/useDatasetDetailsDatasetHead.mjs.map +1 -1
- package/dist/composables/useRuntimeEnv.d.ts +1 -1
- package/dist/configurations/config-schema/apiSchema.d.ts +3 -3
- package/dist/configurations/config-schema/apiSchema.mjs +1 -1
- package/dist/configurations/config-schema/apiSchema.mjs.map +1 -1
- package/dist/configurations/config-schema/configSchema.d.ts +5 -5
- package/dist/data-provider-interface/DPIMenu.vue.d.ts +2 -2
- package/dist/data-provider-interface/DPIMenu.vue.mjs +3 -3
- package/dist/data-provider-interface/DPIMenu.vue.mjs.map +1 -1
- package/dist/data-provider-interface/DataProviderInterface.vue.d.ts +29 -7
- package/dist/data-provider-interface/DataProviderInterface.vue.mjs +12 -69
- package/dist/data-provider-interface/DataProviderInterface.vue.mjs.map +1 -1
- package/dist/data-provider-interface/DataProviderInterface.vue2.mjs +91 -2
- package/dist/data-provider-interface/DataProviderInterface.vue2.mjs.map +1 -1
- package/dist/data-provider-interface/DataProviderInterface.vue3.mjs +5 -0
- package/dist/data-provider-interface/DataProviderInterface.vue3.mjs.map +1 -0
- package/dist/data-provider-interface/components/AutocompleteInput.vue.mjs +66 -65
- package/dist/data-provider-interface/components/AutocompleteInput.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/ConditionalInput.vue.mjs +127 -115
- package/dist/data-provider-interface/components/ConditionalInput.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/DataFetchingComponent.vue.d.ts +1 -1
- package/dist/data-provider-interface/components/DataFetchingComponent.vue.mjs +25 -19
- package/dist/data-provider-interface/components/DataFetchingComponent.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/FileUpload.vue.d.ts +1 -1
- package/dist/data-provider-interface/components/Navigation.vue.d.ts +5 -5
- package/dist/data-provider-interface/composables/index.d.ts +2 -0
- package/dist/data-provider-interface/composables/useDpiContext.d.ts +17 -0
- package/dist/data-provider-interface/composables/useDpiContext.mjs +19 -0
- package/dist/data-provider-interface/composables/useDpiContext.mjs.map +1 -0
- package/dist/data-provider-interface/composables/useDpiEditMode.d.ts +16 -0
- package/dist/data-provider-interface/composables/useDpiEditMode.mjs +41 -0
- package/dist/data-provider-interface/composables/useDpiEditMode.mjs.map +1 -0
- package/dist/data-provider-interface/config/dcatap/input-definition.mjs +28 -2
- package/dist/data-provider-interface/config/dcatap/input-definition.mjs.map +1 -1
- package/dist/data-provider-interface/config/dcatapde/input-definition.mjs +5 -2
- package/dist/data-provider-interface/config/dcatapde/input-definition.mjs.map +1 -1
- package/dist/data-provider-interface/config/dpi-spec-config.mjs +1 -0
- package/dist/data-provider-interface/config/dpi-spec-config.mjs.map +1 -1
- package/dist/data-provider-interface/index.d.ts +2 -0
- package/dist/data-provider-interface/index.mjs +11 -0
- package/dist/data-provider-interface/index.mjs.map +1 -0
- package/dist/data-provider-interface/store/dpiStore.d.ts +31 -15
- package/dist/data-provider-interface/store/dpiStore.mjs +30 -13
- package/dist/data-provider-interface/store/dpiStore.mjs.map +1 -1
- package/dist/data-provider-interface/store/modules/autocompleteStore.d.ts +3 -1
- package/dist/data-provider-interface/store/modules/autocompleteStore.mjs +28 -29
- package/dist/data-provider-interface/store/modules/autocompleteStore.mjs.map +1 -1
- package/dist/data-provider-interface/store/modules/conversionStore.d.ts +6 -6
- package/dist/data-provider-interface/store/modules/conversionStore.mjs +21 -22
- package/dist/data-provider-interface/store/modules/conversionStore.mjs.map +1 -1
- package/dist/data-provider-interface/store/modules/formSchemaStore.d.ts +5 -3
- package/dist/data-provider-interface/store/modules/formSchemaStore.mjs +29 -29
- package/dist/data-provider-interface/store/modules/formSchemaStore.mjs.map +1 -1
- package/dist/data-provider-interface/store/modules/navigationStore.d.ts +1 -1
- package/dist/data-provider-interface/store/modules/navigationStore.mjs +13 -14
- package/dist/data-provider-interface/store/modules/navigationStore.mjs.map +1 -1
- package/dist/data-provider-interface/utils/RDFconverter.mjs +63 -60
- package/dist/data-provider-interface/utils/RDFconverter.mjs.map +1 -1
- package/dist/data-provider-interface/views/DraftsPage.vue.d.ts +2 -2
- package/dist/data-provider-interface/views/InputPage.vue.d.ts +3 -3
- package/dist/data-provider-interface/views/OverviewPage/Properties/URIProp.vue.mjs +1 -1
- package/dist/data-provider-interface/views/OverviewPage.vue.d.ts +1 -1
- package/dist/datasetDetails/DatasetDetails.vue.d.ts +1 -1
- package/dist/datasetDetails/DatasetDetailsDataset.vue.mjs +1 -1
- package/dist/datasetDetails/DatasetDetailsDataset.vue.mjs.map +1 -1
- package/dist/datasetDetails/DatasetDetailsDataset.vue2.mjs.map +1 -1
- package/dist/datasetDetails/DatasetDetailsDescription.vue.d.ts +1 -1
- package/dist/datasetDetails/distributions/Distribution.vue.mjs +45 -43
- package/dist/datasetDetails/distributions/Distribution.vue.mjs.map +1 -1
- package/dist/datasetDetails/distributions/DistributionFormat.vue.d.ts +3 -3
- package/dist/datasetDetails/distributions/DownloadAllDistributions.vue.d.ts +2 -2
- package/dist/datasetDetails/distributions/distributionActions/DistributionActions.vue.d.ts +1 -0
- package/dist/datasetDetails/distributions/distributionActions/DistributionActions.vue.mjs +18 -14
- package/dist/datasetDetails/distributions/distributionActions/DistributionActions.vue.mjs.map +1 -1
- package/dist/datasetDetails/distributions/distributionActions/DistributionDownload.vue.d.ts +3 -3
- package/dist/datasetDetails/distributions/distributionActions/DistributionDownload.vue.mjs +68 -57
- package/dist/datasetDetails/distributions/distributionActions/DistributionDownload.vue.mjs.map +1 -1
- package/dist/datasetDetails/distributions/distributionActions/DistributionDownload.vue2.mjs +2 -2
- package/dist/datasetDetails/header/DatasetDetailsHeaderTitle.vue.d.ts +1 -1
- package/dist/datasetDetails/navigation/DatasetDetailsNavigation.vue.d.ts +1 -1
- package/dist/datasetDetails/navigation/DatasetDetailsNavigationLinks.vue.d.ts +1 -1
- package/dist/embed/EmbedDataset.vue.d.ts +1 -1
- package/dist/embed/EmbedDatasetSnippet.vue.d.ts +2 -2
- package/dist/external/@vueuse/core/index +129 -80
- package/dist/external/@vueuse/core/index.map +1 -1
- package/dist/external/@vueuse/shared/index +121 -17
- package/dist/external/@vueuse/shared/index.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +250 -248
- package/dist/index.mjs.map +1 -1
- package/dist/piveau-hub-ui-modules.css +1 -1
- package/dist/services/datasetService.d.ts +1 -1
- package/dist/services/datasetService.mjs +2 -2
- package/dist/services/datasetService.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getCurrentInstance as ee, computed as
|
|
2
|
-
import { useStore as
|
|
3
|
-
import { getTranslationFor as
|
|
1
|
+
import { getCurrentInstance as ee, computed as L, ref as y, onMounted as te, watch as W, watchEffect as ne, openBlock as r, createElementBlock as i, unref as u, toDisplayString as v, createCommentVNode as N, createTextVNode as p, createElementVNode as s, withDirectives as B, isRef as O, vModelText as ae, Fragment as S, renderList as V, vShow as oe, normalizeClass as le } from "vue";
|
|
2
|
+
import { useStore as se } from "vuex";
|
|
3
|
+
import { getTranslationFor as $ } from "../../utils/helpers.mjs";
|
|
4
4
|
import { getNode as re } from "@formkit/core";
|
|
5
|
-
import { onClickOutside as
|
|
5
|
+
import { onClickOutside as X } from "../../external/@vueuse/core/index";
|
|
6
6
|
import { useI18n as ie } from "vue-i18n";
|
|
7
7
|
import ce from "qs";
|
|
8
8
|
import ue from "axios";
|
|
@@ -15,23 +15,23 @@ const de = { class: "formkitProperty" }, fe = {
|
|
|
15
15
|
}, ge = { class: "autocompleteInputSingleValue" }, ye = { key: 1 }, xe = { class: "d-flex align-items-center justify-content-center formkit-inner mb-2" }, _e = ["placeholder"], ke = ["onClick"], be = {
|
|
16
16
|
key: 0,
|
|
17
17
|
class: "d-flex flex-wrap"
|
|
18
|
-
}, we = { class: "activeResultsAutocompleteWrapper" }, Ce = ["onClick"], Ie = ["onClick"],
|
|
18
|
+
}, we = { class: "activeResultsAutocompleteWrapper" }, Ce = ["onClick"], Ie = ["onClick"], Le = { class: "w-100 mt-4" }, Se = { class: "d-flex justify-content-between align-items-center flex-wrap" }, Ve = {
|
|
19
19
|
key: 0,
|
|
20
20
|
class: "annifresultContainer"
|
|
21
21
|
}, Te = ["onClick"], Ae = { class: "d-flex" }, Pe = {
|
|
22
22
|
key: 1,
|
|
23
23
|
class: "d-flex flex-wrap"
|
|
24
|
-
},
|
|
24
|
+
}, Ne = ["onClick"], Oe = { class: "formkit-wrapper" }, $e = ["innerHTML"], He = {
|
|
25
25
|
__name: "AutocompleteInput",
|
|
26
26
|
props: {
|
|
27
27
|
context: Object
|
|
28
28
|
},
|
|
29
29
|
setup(J) {
|
|
30
30
|
let x = ee().appContext.app.config.globalProperties.$env;
|
|
31
|
-
const a = J, R =
|
|
32
|
-
let h =
|
|
31
|
+
const a = J, R = se(), { t: j, locale: M } = ie();
|
|
32
|
+
let h = L(() => a.context.value), d, _ = a.context.attrs.voc, z = L(() => j("message.dataupload.info.searchVocabulary")), G = L(() => j("message.dataupload.info.matchesNothingFound")), w = y({
|
|
33
33
|
value: { name: z }
|
|
34
|
-
}), f = y(),
|
|
34
|
+
}), f = y(), E = y(null), k = y({}), m = [], C = [], q = y({
|
|
35
35
|
value: !1
|
|
36
36
|
});
|
|
37
37
|
y();
|
|
@@ -39,22 +39,22 @@ const de = { class: "formkitProperty" }, fe = {
|
|
|
39
39
|
te(async () => {
|
|
40
40
|
k.value = "";
|
|
41
41
|
});
|
|
42
|
-
let D =
|
|
42
|
+
let D = L(() => {
|
|
43
43
|
try {
|
|
44
44
|
if (a.context.attrs.class.includes("inDistribution"))
|
|
45
45
|
return !0;
|
|
46
46
|
} catch {
|
|
47
47
|
}
|
|
48
48
|
});
|
|
49
|
-
|
|
50
|
-
}),
|
|
49
|
+
W(w, async () => {
|
|
50
|
+
}), W(T, async () => {
|
|
51
51
|
});
|
|
52
52
|
const U = async (t) => {
|
|
53
53
|
if (t != null) {
|
|
54
54
|
let n = _ === "iana-media-types" || _ === "spdx-checksum-algorithm", e;
|
|
55
55
|
return await R.dispatch("dpiStore/requestResourceName", { voc: _, uri: t, envs: x }).then(
|
|
56
56
|
(o) => {
|
|
57
|
-
a.context.attrs.property === "dcatde:politicalGeocodingURI" ? o != null && (e = n ? o.data.result.results.filter((l) => l.resource === t).map((l) => l.alt_label)[0].en :
|
|
57
|
+
a.context.attrs.property === "dcatde:politicalGeocodingURI" ? o != null && (e = n ? o.data.result.results.filter((l) => l.resource === t).map((l) => l.alt_label)[0].en : $(o.data.result.alt_label, "en", [])) : o != null && (e = n ? o.data.result.results.filter((l) => l.resource === t).map((l) => l.pref_label)[0].en : $(o.data.result.pref_label, "en", []));
|
|
58
58
|
}
|
|
59
59
|
), e;
|
|
60
60
|
}
|
|
@@ -83,9 +83,9 @@ const de = { class: "formkitProperty" }, fe = {
|
|
|
83
83
|
} catch {
|
|
84
84
|
}
|
|
85
85
|
}
|
|
86
|
-
window.removeEventListener("click",
|
|
86
|
+
window.removeEventListener("click", X);
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
X(E, (t) => f.value = !1);
|
|
89
89
|
let F = async (t, n) => {
|
|
90
90
|
let e = 10;
|
|
91
91
|
n != null && (e = e + 10);
|
|
@@ -130,12 +130,12 @@ const de = { class: "formkitProperty" }, fe = {
|
|
|
130
130
|
a.context.classes.outer += " autocompleteInput " + a.context.attrs.identifier;
|
|
131
131
|
const P = async (t) => {
|
|
132
132
|
if (Object.keys(t).length !== 1) {
|
|
133
|
-
if (h.value.length > 0 && (
|
|
134
|
-
if (
|
|
135
|
-
let n = { name: t.name, resource: t.resource }, e =
|
|
133
|
+
if (h.value.length > 0 && (m = h.value), a.context.attrs.multiple)
|
|
134
|
+
if (m.length != 0) {
|
|
135
|
+
let n = { name: t.name, resource: t.resource }, e = m.filter((o) => o.name != t.name);
|
|
136
136
|
e.push(n), d = e, await a.context.node.input(d);
|
|
137
137
|
} else
|
|
138
|
-
|
|
138
|
+
m.push({ name: t.name, resource: t.resource }), d = m, await a.context.node.input(d);
|
|
139
139
|
else {
|
|
140
140
|
if (t.resource === "invalid")
|
|
141
141
|
return;
|
|
@@ -145,9 +145,9 @@ const de = { class: "formkitProperty" }, fe = {
|
|
|
145
145
|
}
|
|
146
146
|
}, Y = async (t) => {
|
|
147
147
|
let n = t.target.value;
|
|
148
|
-
console.log(
|
|
148
|
+
console.log(M), await R.dispatch("dpiStore/requestAutocompleteSuggestions", { voc: _, text: n, base: x.api.baseUrl }).then((e) => {
|
|
149
149
|
const o = e.data.result.results.map((c) => ({
|
|
150
|
-
name:
|
|
150
|
+
name: $(c.pref_label, M.value, []) + " (" + c.id + ")",
|
|
151
151
|
resource: c.resource
|
|
152
152
|
}));
|
|
153
153
|
o.length === 0 ? w.value = { value: { name: G } } : w.value = o;
|
|
@@ -156,55 +156,55 @@ const de = { class: "formkitProperty" }, fe = {
|
|
|
156
156
|
function Z(t) {
|
|
157
157
|
a.context.node.input({}), P("erase");
|
|
158
158
|
}
|
|
159
|
-
function
|
|
160
|
-
x.content.dataProviderInterface.annifIntegration && I(), h.value.length > 0 && (
|
|
159
|
+
function H(t) {
|
|
160
|
+
x.content.dataProviderInterface.annifIntegration && I(), h.value.length > 0 && (m = h.value), m.splice(m.findIndex((n) => n.name == t.name), 1), d = m, a.context.node.input(d), A();
|
|
161
161
|
}
|
|
162
162
|
return (t, n) => (r(), i("div", de, [
|
|
163
|
-
u(D) ? (r(), i("h4", fe,
|
|
164
|
-
|
|
165
|
-
a.context.attrs.identifier != "licence" && !u(D) ? (r(), i("h4", pe,
|
|
166
|
-
|
|
163
|
+
u(D) ? (r(), i("h4", fe, v(t.$t("message.dataupload.distributions." + a.context.attrs.identifier + ".label")), 1)) : N("", !0),
|
|
164
|
+
p(),
|
|
165
|
+
a.context.attrs.identifier != "licence" && !u(D) ? (r(), i("h4", pe, v(t.$t("message.dataupload.datasets." + a.context.attrs.identifier + ".label")), 1)) : N("", !0),
|
|
166
|
+
p(),
|
|
167
167
|
s("div", me, [
|
|
168
168
|
s("div", ve, [
|
|
169
169
|
!a.context.attrs.multiple && a.context.value.name ? (r(), i("div", he, [
|
|
170
|
-
s("a", ge,
|
|
171
|
-
|
|
170
|
+
s("a", ge, v(a.context.value.name), 1),
|
|
171
|
+
p(),
|
|
172
172
|
s("div", {
|
|
173
173
|
class: "removeX",
|
|
174
174
|
onClick: Z
|
|
175
175
|
})
|
|
176
176
|
])) : (r(), i("div", ye, [
|
|
177
177
|
s("div", xe, [
|
|
178
|
-
|
|
178
|
+
B(s("input", {
|
|
179
179
|
class: "autocompleteInputfield",
|
|
180
180
|
placeholder: a.context.attrs.placeholder,
|
|
181
|
-
"onUpdate:modelValue": n[0] || (n[0] = (e) =>
|
|
181
|
+
"onUpdate:modelValue": n[0] || (n[0] = (e) => O(k) ? k.value = e : k = e),
|
|
182
182
|
type: "text",
|
|
183
183
|
onKeyup: n[1] || (n[1] = (e) => Y(e)),
|
|
184
|
-
onClick: n[2] || (n[2] = (e) =>
|
|
184
|
+
onClick: n[2] || (n[2] = (e) => O(f) ? f.value = !u(f) : f = !u(f))
|
|
185
185
|
}, null, 40, _e), [
|
|
186
186
|
[ae, u(k)]
|
|
187
187
|
])
|
|
188
188
|
]),
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
p(),
|
|
190
|
+
B(s("ul", {
|
|
191
191
|
ref_key: "dropdownList",
|
|
192
|
-
ref:
|
|
192
|
+
ref: E,
|
|
193
193
|
class: "autocompleteResultList"
|
|
194
194
|
}, [
|
|
195
|
-
(r(!0), i(
|
|
195
|
+
(r(!0), i(S, null, V(u(w), (e) => (r(), i("li", {
|
|
196
196
|
key: e,
|
|
197
197
|
onClick: (o) => {
|
|
198
|
-
P(e),
|
|
198
|
+
P(e), O(f) ? f.value = !u(f) : f = !u(f);
|
|
199
199
|
},
|
|
200
200
|
class: "p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC"
|
|
201
|
-
},
|
|
201
|
+
}, v(e.name), 9, ke))), 128))
|
|
202
202
|
], 512), [
|
|
203
203
|
[oe, u(f)]
|
|
204
204
|
]),
|
|
205
|
-
|
|
205
|
+
p(),
|
|
206
206
|
u(x).content.dataProviderInterface.annifIntegration && a.context.attrs.annifTheme ? (r(), i("div", be, [
|
|
207
|
-
(r(!0), i(
|
|
207
|
+
(r(!0), i(S, null, V(u(h), (e) => (r(), i("div", { key: e }, [
|
|
208
208
|
s("div", we, [
|
|
209
209
|
s("div", {
|
|
210
210
|
class: "d-flex",
|
|
@@ -212,65 +212,66 @@ const de = { class: "formkitProperty" }, fe = {
|
|
|
212
212
|
e.activeValue = !e.activeValue;
|
|
213
213
|
}
|
|
214
214
|
}, [
|
|
215
|
-
s("span", null,
|
|
216
|
-
|
|
215
|
+
s("span", null, v(e.name), 1),
|
|
216
|
+
p(),
|
|
217
217
|
s("div", {
|
|
218
218
|
class: "removeX",
|
|
219
|
-
onClick: (o) =>
|
|
219
|
+
onClick: (o) => H(e)
|
|
220
220
|
}, null, 8, Ie)
|
|
221
221
|
], 8, Ce)
|
|
222
222
|
])
|
|
223
223
|
]))), 128)),
|
|
224
|
-
|
|
225
|
-
s("div",
|
|
226
|
-
s("div",
|
|
227
|
-
s("h3", null,
|
|
228
|
-
|
|
229
|
-
s("span", null, p(t.$t("message.dataupload.info.suggestionText")), 1),
|
|
230
|
-
m(),
|
|
224
|
+
p(),
|
|
225
|
+
s("div", Le, [
|
|
226
|
+
s("div", Se, [
|
|
227
|
+
s("h3", null, v(t.$t("message.dataupload.info.suggestions")), 1),
|
|
228
|
+
p(),
|
|
231
229
|
s("button", {
|
|
232
230
|
class: "navlikeButton",
|
|
233
231
|
type: "button",
|
|
234
232
|
onClick: n[3] || (n[3] = (e) => {
|
|
235
233
|
I(), u(q).value = !0;
|
|
236
234
|
})
|
|
237
|
-
},
|
|
235
|
+
}, v(t.$t("message.dataupload.info.tryIt")), 1)
|
|
238
236
|
]),
|
|
239
|
-
|
|
237
|
+
p(),
|
|
240
238
|
u(q).value ? (r(), i("div", Ve, [
|
|
241
|
-
(r(!0), i(
|
|
239
|
+
(r(!0), i(S, null, V(u(T), (e) => (r(), i("div", {
|
|
242
240
|
key: e,
|
|
243
241
|
class: "d-flex"
|
|
244
242
|
}, [
|
|
245
243
|
s("div", {
|
|
246
|
-
class:
|
|
244
|
+
class: le(["activeResultsAutocompleteWrapper annifResults", { loadMore: e.resource === "invalid" }]),
|
|
247
245
|
onClick: (o) => {
|
|
248
246
|
e.activeValue = !e.activeValue, K(e);
|
|
249
247
|
}
|
|
250
248
|
}, [
|
|
251
249
|
s("div", Ae, [
|
|
252
|
-
s("span", null,
|
|
250
|
+
s("span", null, v(e.name), 1)
|
|
253
251
|
])
|
|
254
252
|
], 10, Te)
|
|
255
253
|
]))), 128))
|
|
256
|
-
])) :
|
|
254
|
+
])) : N("", !0)
|
|
257
255
|
])
|
|
258
256
|
])) : (r(), i("div", Pe, [
|
|
259
|
-
(r(!0), i(
|
|
257
|
+
(r(!0), i(S, null, V(a.context.value, (e) => (r(), i("div", {
|
|
260
258
|
class: "activeResultsAutocompleteWrapper",
|
|
261
259
|
key: e
|
|
262
260
|
}, [
|
|
263
|
-
s("span", null,
|
|
264
|
-
|
|
261
|
+
s("span", null, v(e.name), 1),
|
|
262
|
+
p(),
|
|
265
263
|
s("div", {
|
|
266
264
|
class: "removeX",
|
|
267
|
-
onClick: (o) =>
|
|
268
|
-
}, null, 8,
|
|
265
|
+
onClick: (o) => H(e)
|
|
266
|
+
}, null, 8, Ne)
|
|
269
267
|
]))), 128))
|
|
270
268
|
])),
|
|
271
|
-
|
|
272
|
-
s("div",
|
|
273
|
-
s("div",
|
|
269
|
+
p(),
|
|
270
|
+
s("div", Oe, [
|
|
271
|
+
s("div", {
|
|
272
|
+
innerHTML: a.context.help,
|
|
273
|
+
class: "formkit-help"
|
|
274
|
+
}, null, 8, $e)
|
|
274
275
|
])
|
|
275
276
|
]))
|
|
276
277
|
])
|
|
@@ -279,6 +280,6 @@ const de = { class: "formkitProperty" }, fe = {
|
|
|
279
280
|
}
|
|
280
281
|
};
|
|
281
282
|
export {
|
|
282
|
-
|
|
283
|
+
He as default
|
|
283
284
|
};
|
|
284
285
|
//# sourceMappingURL=AutocompleteInput.vue.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutocompleteInput.vue.mjs","sources":["../../../lib/data-provider-interface/components/AutocompleteInput.vue"],"sourcesContent":["<template>\n <div class=\"formkitProperty\">\n\n <!-- need to make a condition for the licence property of the distribution - otherwise the dropdown doesnt work-->\n\n <h4 class=\"formkitHeader\" v-if=\"inDis\">\n {{ $t('message.dataupload.distributions.' + props.context.attrs.identifier + '.label') }}\n </h4>\n <h4 v-if=\"props.context.attrs.identifier != 'licence' && !inDis\">{{ $t('message.dataupload.datasets.' +\n props.context.attrs.identifier + '.label') }}</h4>\n\n <div class=\"formkitCmpWrap\">\n\n <div class=\"formkit-outer\">\n <div class=\"d-flex formkit-inner\" v-if=\"!props.context.attrs.multiple && props.context.value.name\">\n <!-- <div class=\"infoI\">\n <div class=\"tooltipFormkit\">{{ props.context.attrs.info }}</div>\n </div> -->\n <a class=\"autocompleteInputSingleValue \">{{ props.context.value.name }}</a>\n <div class=\"removeX\" @click=\"removeProperty\"></div>\n </div>\n <div v-else>\n <div class=\"d-flex align-items-center justify-content-center formkit-inner mb-2\">\n <!-- <div class=\"infoI\">\n <div class=\"tooltipFormkit\">{{ props.context.attrs.info }}</div>\n </div> -->\n <input class=\"autocompleteInputfield\" :placeholder=\"props.context.attrs.placeholder\" v-model=\"inputText\"\n type=\"text\" v-on:keyup=\"getAutocompleteSuggestions($event)\" @click=\"activeList = !activeList\">\n </div>\n <ul ref=\"dropdownList\" v-show=\"activeList\" class=\"autocompleteResultList\">\n <li v-for=\"match in matches\" :key=\"match\" @click=\"setValue(match); activeList = !activeList\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{ match.name }}\n </li>\n </ul>\n <div v-if=\"instance.content.dataProviderInterface.annifIntegration && props.context.attrs.annifTheme\"\n class=\"d-flex flex-wrap\">\n <div v-for=\"item in listOfValues\" :key=\"item\">\n <div class=\"activeResultsAutocompleteWrapper\">\n <div class=\"d-flex\" @click=\"item.activeValue = !item.activeValue;\">\n <span>{{ item.name }}</span>\n <div class=\"removeX\" @click=\"removeMultipleProperty(item)\"></div>\n </div>\n </div>\n </div>\n <div class=\"w-100 mt-4\">\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <h3>{{ props.context.label }} - {{ $t('message.dataupload.info.suggestions') }}</h3>\n <span>{{ $t('message.dataupload.info.suggestionText') }}</span>\n <button class=\"navlikeButton\" type=\"button\"\n @click=\"fillAnnifsuggestions(); annifTrigger.value = true\">{{ $t('message.dataupload.info.tryIt')\n }}</button>\n </div>\n <div class=\"annifresultContainer\" v-if=\"annifTrigger.value\">\n <div v-for=\"item in annifSelectionList\" :key=\"item\" class=\"d-flex \">\n <div class=\"activeResultsAutocompleteWrapper annifResults\"\n :class=\"{ loadMore: item.resource === 'invalid' }\"\n @click=\"item.activeValue = !item.activeValue; updateAnnifselection(item)\">\n <div class=\"d-flex\">\n <span>{{ item.name }}</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div v-else class=\"d-flex flex-wrap\">\n <div class=\"activeResultsAutocompleteWrapper\" v-for=\"item in props.context.value\" :key=\"item\">\n <span>{{ item.name }}</span>\n <div class=\"removeX\" @click=\"removeMultipleProperty(item)\"></div>\n </div>\n </div>\n <div class=\"formkit-wrapper\">\n <div class=\"formkit-help\">{{ props.context.help }}</div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script setup>\nimport { ref, watch, computed, onMounted, watchEffect } from 'vue';\nimport { useStore } from 'vuex';\nimport { getTranslationFor } from \"../../utils/helpers\";\nimport { getCurrentInstance } from \"vue\";\nimport { getNode } from '@formkit/core'\nimport { onClickOutside } from '@vueuse/core'\nimport { useI18n } from 'vue-i18n';\n\nimport qs from 'qs';\nimport axios from 'axios';\n\nlet instance = getCurrentInstance().appContext.app.config.globalProperties.$env\n\nconst props = defineProps({\n context: Object\n})\nconst store = useStore();\nconst { t,locale } = useI18n();\n\nlet listOfValues = computed(() => {\n return props.context.value;\n})\n\nlet selection;\nlet voc = props.context.attrs.voc;\n\nlet matchesSearchstring = computed(() => {\n return t('message.dataupload.info.searchVocabulary')\n})\nlet matchesNothingFound = computed(() => {\n return t('message.dataupload.info.matchesNothingFound')\n})\nlet matches = ref({\n value: { name: matchesSearchstring }\n})\nlet activeList = ref()\nlet dropdownList = ref(null)\nlet inputText = ref({})\nlet cacheList = [];\nlet annifList = [];\nlet annifTrigger = ref({\n value: false\n});\nlet initialValues = ref();\nlet annifSelectionList = ref({})\n\nonMounted(async () => {\n inputText.value = \"\"\n});\nlet inDis = computed(() => {\n try {\n if (props.context.attrs.class.includes(\"inDistribution\")) {\n return true\n }\n } catch (error) {\n\n }\n\n\n});\nwatch(matches, async () => { })\nwatch(annifSelectionList, async () => { })\n\nconst requestURIname = async (res) => {\n\n if (res != undefined) {\n let vocMatch =\n voc === \"iana-media-types\" ||\n voc === \"spdx-checksum-algorithm\";\n\n let name;\n\n await store.dispatch('dpiStore/requestResourceName', { voc: voc, uri: res, envs: instance }).then(\n (response) => {\n if (props.context.attrs.property === 'dcatde:politicalGeocodingURI') {\n if (response != undefined) {\n let result = vocMatch\n ? response.data.result.results\n .filter((dataset) => dataset.resource === res)\n .map((dataset) => dataset.alt_label)[0].en\n : getTranslationFor(response.data.result.alt_label, 'en', []);\n name = result;\n }\n } else {\n\n if (response != undefined) {\n let result = vocMatch\n ? response.data.result.results\n .filter((dataset) => dataset.resource === res)\n .map((dataset) => dataset.pref_label)[0].en\n : getTranslationFor(response.data.result.pref_label, 'en', []);\n name = result;\n\n }\n }\n }\n );\n return name\n }\n\n}\n\nwatchEffect(async () => {\n const values = listOfValues.value;\n\n // single URI's\n if (values.hasOwnProperty('name')) {\n if (values.name === values.resource) {\n let uriName;\n if (!props.context.attrs.multiple) {\n uriName = requestURIname(values.resource)\n props.context.node.input({ name: await uriName, resource: values.resource })\n\n }\n }\n }\n // multiple URI's\n if (values.length >= 1) {\n let uriNameList = [];\n for (let index = 0; index < values.length; index++) {\n if (values[index].name === values[index].resource) {\n uriNameList.push({ name: await requestURIname(values[index].resource), resource: values[index].resource })\n props.context.node.input(uriNameList)\n }\n }\n }\n});\nfunction findPropertyToUpdate(trigger) {\n\n let finalPath = { step: '', prop: props.context.node.name }\n let pathToLocalStorage = JSON.parse(localStorage.getItem('dpi_datasets'));\n\n for (let index = 0; index < Object.keys(pathToLocalStorage).length; index++) {\n for (let innerIndex = 0; innerIndex < Object.keys(pathToLocalStorage)[index].length; innerIndex++) {\n let ntry = Object.entries((pathToLocalStorage))\n try {\n Object.keys(ntry[index][innerIndex]).filter(e => {\n if (e === props.context.node.name) {\n finalPath.step = ntry[index][0]\n\n if (trigger === 'erase') {\n\n selection = {}\n pathToLocalStorage[finalPath.step][finalPath.prop] = selection\n }\n if (typeof selection === 'object') {\n\n pathToLocalStorage[finalPath.step][finalPath.prop] = selection\n }\n else pathToLocalStorage[finalPath.step][finalPath.prop] = selection\n localStorage.setItem('dpi_datasets', JSON.stringify(pathToLocalStorage))\n }\n });\n } catch (error) {\n }\n }\n }\n\n window.removeEventListener(\"click\", onClickOutside);\n}\nonClickOutside(dropdownList, event => activeList.value = false)\nlet annifHandlerTheme = async (input, limit) => {\n\n let finalLimit = 10;\n if (limit != undefined) {\n finalLimit = finalLimit + 10\n }\n\n let query = qs.stringify({\n 'text': input,\n 'limit': finalLimit\n });\n\n\n var config = {\n method: 'post',\n url: voc == \"eurovoc\"\n ? instance.content.dataProviderInterface.annifLinkSubject\n : instance.content.dataProviderInterface.annifLinkTheme,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Accept': 'application/json'\n },\n data: query\n };\n\n let list = []\n\n axios(config)\n .then(async (response) => {\n \n for (let i = 0; i < response.data.results.length; i++) {\n \n \n annifList[i] = { \"name\": response.data.results[i].label, \"resource\": response.data.results[i].uri, \"activeValue\": false }\n }\n let annifCacheList = []\n if (listOfValues.value.length > 0) {\n listOfValues.value.forEach(element => {\n annifCacheList.push({ \"name\": element.name, \"resource\": element.resource, \"activeValue\": true })\n });\n }\n if (response.data.results.length > 9) {\n annifList[annifList.length + 1] = { \"name\": \"...\", \"resource\": \"invalid\", \"activeValue\": false }\n }\n\n annifSelectionList.value = eraseDuplicates(annifCacheList, annifList)\n\n })\n .catch(function (error) {\n console.log(error);\n });\n}\nasync function updateAnnifselection(item) {\n\n if (item.resource === 'invalid') {\n fillAnnifsuggestions(5);\n }\n else {\n setValue({ name: item.name, resource: item.resource })\n fillAnnifsuggestions()\n }\n}\nfunction eraseDuplicates(array1, array2) {\n\n let mergedArray = array1.concat(array2);\n let filteredArray = [];\n let resourceSet = new Set();\n\n mergedArray.forEach(obj => {\n if (!resourceSet.has(obj.resource)) {\n resourceSet.add(obj.resource);\n if (!obj.activeValue) {\n filteredArray.push(obj);\n }\n }\n });\n\n\n return filteredArray;\n}\nconst fillAnnifsuggestions = async (limitChange) => {\n\n let arr = getNode('Mandatory').value['dct:description']\n for (let i = 0; i < arr.length; i++) {\n if (arr[i]['@language'] === 'en') {\n if (limitChange != undefined) {\n await annifHandlerTheme(arr[i]['@value'], 5)\n }\n else await annifHandlerTheme(arr[i]['@value'])\n }\n }\n\n}\n\n// Need to append the classes to the formkit-outer element\nprops.context.classes.outer += ' autocompleteInput ' + props.context.attrs.identifier\n\nconst setValue = async (e) => {\n if (Object.keys(e).length === 1) {\n return\n }\n if (listOfValues.value.length > 0) {\n\n cacheList = listOfValues.value\n }\n\n // when its a multi input\n if (props.context.attrs.multiple) {\n // check for doubled values\n if (cacheList.length != 0) {\n let filteredProperty = { name: e.name, resource: e.resource };\n let filteredList = cacheList.filter((element) => element.name != e.name);\n filteredList.push(filteredProperty)\n selection = filteredList;\n await props.context.node.input(selection);\n\n }\n else {\n cacheList.push({ name: e.name, resource: e.resource })\n selection = cacheList\n await props.context.node.input(selection);\n }\n\n }\n else if (e.resource === \"invalid\") return\n else if (e === \"erase\") { await props.context.node.input({}); findPropertyToUpdate(e) }\n else {\n selection = { name: e.name, resource: e.resource };\n await props.context.node.input(selection);\n }\n findPropertyToUpdate();\n}\n\nconst getAutocompleteSuggestions = async (e) => {\n let innerText = e.target.value\nconsole.log(locale);\n\n\n await store.dispatch('dpiStore/requestAutocompleteSuggestions', { voc: voc, text: innerText, base: instance.api.baseUrl }).then((response) => {\n const results = response.data.result.results.map((r) => ({\n name: getTranslationFor(r.pref_label, locale.value, []) + \" (\" + r.id + \")\",\n resource: r.resource,\n }));\n if (results.length === 0) {\n matches.value = { value: { name: matchesNothingFound } }\n }\n else matches.value = results;\n });\n}\n\nfunction removeProperty(e) {\n props.context.node.input({})\n setValue('erase');\n}\nfunction removeMultipleProperty(e) {\n\n if (instance.content.dataProviderInterface.annifIntegration) {\n fillAnnifsuggestions()\n }\n if (listOfValues.value.length > 0) {\n cacheList = listOfValues.value\n }\n // Get Index in the array where all values of the Span are stored and cut it out of the list of Values\n cacheList.splice(cacheList.findIndex((element) => element.name == e.name), 1)\n selection = cacheList;\n props.context.node.input(selection);\n findPropertyToUpdate();\n}\n</script>"],"names":["instance","getCurrentInstance","props","__props","store","useStore","t","locale","useI18n","listOfValues","computed","selection","voc","matchesSearchstring","matchesNothingFound","matches","ref","activeList","dropdownList","inputText","cacheList","annifList","annifTrigger","annifSelectionList","onMounted","inDis","watch","requestURIname","res","vocMatch","name","response","dataset","getTranslationFor","watchEffect","values","uriName","uriNameList","index","findPropertyToUpdate","trigger","finalPath","pathToLocalStorage","innerIndex","ntry","e","onClickOutside","event","annifHandlerTheme","input","limit","finalLimit","query","qs","config","axios","i","annifCacheList","element","eraseDuplicates","error","updateAnnifselection","item","fillAnnifsuggestions","setValue","array1","array2","mergedArray","filteredArray","resourceSet","obj","limitChange","arr","getNode","filteredProperty","filteredList","getAutocompleteSuggestions","innerText","results","r","removeProperty","removeMultipleProperty"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,QAAIA,IAAWC,GAAkB,EAAG,WAAW,IAAI,OAAO,iBAAiB;AAE3E,UAAMC,IAAQC,GAGRC,IAAQC,GAAQ,GAChB,EAAE,GAAAC,GAAE,QAAAC,MAAWC;AAErB,QAAIC,IAAeC,EAAS,MACnBR,EAAM,QAAQ,KACtB,GAEGS,GACAC,IAAMV,EAAM,QAAQ,MAAM,KAE1BW,IAAsBH,EAAS,MAC1BJ,EAAE,0CAA0C,CACpD,GACGQ,IAAsBJ,EAAS,MAC1BJ,EAAE,6CAA6C,CACvD,GACGS,IAAUC,EAAI;AAAA,MAChB,OAAO,EAAE,MAAMH,EAAqB;AAAA,IACtC,CAAC,GACGI,IAAaD,EAAK,GAClBE,IAAeF,EAAI,IAAI,GACvBG,IAAYH,EAAI,EAAE,GAClBI,IAAY,CAAA,GACZC,IAAY,CAAA,GACZC,IAAeN,EAAI;AAAA,MACrB,OAAO;AAAA,IACT,CAAC;AACmB,IAAAA,EAAM;AAC1B,QAAIO,IAAqBP,EAAI,EAAE;AAE/B,IAAAQ,GAAU,YAAY;AACpB,MAAAL,EAAU,QAAQ;AAAA,IACpB,CAAC;AACD,QAAIM,IAAQf,EAAS,MAAM;AACzB,UAAI;AACF,YAAIR,EAAM,QAAQ,MAAM,MAAM,SAAS,gBAAgB;AACrD,iBAAO;AAAA,MAEV,QAAe;AAAA,MAEf;AAAA,IAGH,CAAC;AACD,IAAAwB,EAAMX,GAAS,YAAY;AAAA,KAAG,GAC9BW,EAAMH,GAAoB,YAAY;AAAA,KAAG;AAEzC,UAAMI,IAAiB,OAAOC,MAAQ;AAEpC,UAAIA,KAAO,MAAW;AACpB,YAAIC,I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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"AutocompleteInput.vue.mjs","sources":["../../../lib/data-provider-interface/components/AutocompleteInput.vue"],"sourcesContent":["<template>\n <div class=\"formkitProperty\">\n\n <!-- need to make a condition for the licence property of the distribution - otherwise the dropdown doesnt work-->\n\n <h4 class=\"formkitHeader\" v-if=\"inDis\">\n {{ $t('message.dataupload.distributions.' + props.context.attrs.identifier + '.label') }}\n </h4>\n <h4 v-if=\"props.context.attrs.identifier != 'licence' && !inDis\">{{ $t('message.dataupload.datasets.' +\n props.context.attrs.identifier + '.label') }}</h4>\n\n <div class=\"formkitCmpWrap\">\n\n <div class=\"formkit-outer\">\n <div class=\"d-flex formkit-inner\" v-if=\"!props.context.attrs.multiple && props.context.value.name\">\n <!-- <div class=\"infoI\">\n <div class=\"tooltipFormkit\">{{ props.context.attrs.info }}</div>\n </div> -->\n <a class=\"autocompleteInputSingleValue \">{{ props.context.value.name }}</a>\n <div class=\"removeX\" @click=\"removeProperty\"></div>\n </div>\n <div v-else>\n <div class=\"d-flex align-items-center justify-content-center formkit-inner mb-2\">\n <!-- <div class=\"infoI\">\n <div class=\"tooltipFormkit\">{{ props.context.attrs.info }}</div>\n </div> -->\n <input class=\"autocompleteInputfield\" :placeholder=\"props.context.attrs.placeholder\" v-model=\"inputText\"\n type=\"text\" v-on:keyup=\"getAutocompleteSuggestions($event)\" @click=\"activeList = !activeList\">\n </div>\n <ul ref=\"dropdownList\" v-show=\"activeList\" class=\"autocompleteResultList\">\n <li v-for=\"match in matches\" :key=\"match\" @click=\"setValue(match); activeList = !activeList\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{ match.name }}\n </li>\n </ul>\n <div v-if=\"instance.content.dataProviderInterface.annifIntegration && props.context.attrs.annifTheme\"\n class=\"d-flex flex-wrap\">\n <div v-for=\"item in listOfValues\" :key=\"item\">\n <div class=\"activeResultsAutocompleteWrapper\">\n <div class=\"d-flex\" @click=\"item.activeValue = !item.activeValue;\">\n <span>{{ item.name }}</span>\n <div class=\"removeX\" @click=\"removeMultipleProperty(item)\"></div>\n </div>\n </div>\n </div>\n <div class=\"w-100 mt-4\">\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <h3>{{ $t('message.dataupload.info.suggestions') }}</h3>\n <!-- span>{{ $t('message.dataupload.info.suggestionText') }}</span -->\n <button class=\"navlikeButton\" type=\"button\"\n @click=\"fillAnnifsuggestions(); annifTrigger.value = true\">{{ $t('message.dataupload.info.tryIt')\n }}</button>\n </div>\n <div class=\"annifresultContainer\" v-if=\"annifTrigger.value\">\n <div v-for=\"item in annifSelectionList\" :key=\"item\" class=\"d-flex \">\n <div class=\"activeResultsAutocompleteWrapper annifResults\"\n :class=\"{ loadMore: item.resource === 'invalid' }\"\n @click=\"item.activeValue = !item.activeValue; updateAnnifselection(item)\">\n <div class=\"d-flex\">\n <span>{{ item.name }}</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div v-else class=\"d-flex flex-wrap\">\n <div class=\"activeResultsAutocompleteWrapper\" v-for=\"item in props.context.value\" :key=\"item\">\n <span>{{ item.name }}</span>\n <div class=\"removeX\" @click=\"removeMultipleProperty(item)\"></div>\n </div>\n </div>\n <div class=\"formkit-wrapper\">\n <div v-html=\"props.context.help\" class=\"formkit-help\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script setup>\nimport { ref, watch, computed, onMounted, watchEffect } from 'vue';\nimport { useStore } from 'vuex';\nimport { getTranslationFor } from \"../../utils/helpers\";\nimport { getCurrentInstance } from \"vue\";\nimport { getNode } from '@formkit/core'\nimport { onClickOutside } from '@vueuse/core'\nimport { useI18n } from 'vue-i18n';\n\nimport qs from 'qs';\nimport axios from 'axios';\n\nlet instance = getCurrentInstance().appContext.app.config.globalProperties.$env\n\nconst props = defineProps({\n context: Object\n})\nconst store = useStore();\nconst { t,locale } = useI18n();\n\nlet listOfValues = computed(() => {\n return props.context.value;\n})\n\nlet selection;\nlet voc = props.context.attrs.voc;\n\nlet matchesSearchstring = computed(() => {\n return t('message.dataupload.info.searchVocabulary')\n})\nlet matchesNothingFound = computed(() => {\n return t('message.dataupload.info.matchesNothingFound')\n})\nlet matches = ref({\n value: { name: matchesSearchstring }\n})\nlet activeList = ref()\nlet dropdownList = ref(null)\nlet inputText = ref({})\nlet cacheList = [];\nlet annifList = [];\nlet annifTrigger = ref({\n value: false\n});\nlet initialValues = ref();\nlet annifSelectionList = ref({})\n\nonMounted(async () => {\n inputText.value = \"\"\n});\nlet inDis = computed(() => {\n try {\n if (props.context.attrs.class.includes(\"inDistribution\")) {\n return true\n }\n } catch (error) {\n\n }\n\n\n});\nwatch(matches, async () => { })\nwatch(annifSelectionList, async () => { })\n\nconst requestURIname = async (res) => {\n\n if (res != undefined) {\n let vocMatch =\n voc === \"iana-media-types\" ||\n voc === \"spdx-checksum-algorithm\";\n\n let name;\n\n await store.dispatch('dpiStore/requestResourceName', { voc: voc, uri: res, envs: instance }).then(\n (response) => {\n if (props.context.attrs.property === 'dcatde:politicalGeocodingURI') {\n if (response != undefined) {\n let result = vocMatch\n ? response.data.result.results\n .filter((dataset) => dataset.resource === res)\n .map((dataset) => dataset.alt_label)[0].en\n : getTranslationFor(response.data.result.alt_label, 'en', []);\n name = result;\n }\n } else {\n\n if (response != undefined) {\n let result = vocMatch\n ? response.data.result.results\n .filter((dataset) => dataset.resource === res)\n .map((dataset) => dataset.pref_label)[0].en\n : getTranslationFor(response.data.result.pref_label, 'en', []);\n name = result;\n\n }\n }\n }\n );\n return name\n }\n\n}\n\nwatchEffect(async () => {\n const values = listOfValues.value;\n\n // single URI's\n if (values.hasOwnProperty('name')) {\n if (values.name === values.resource) {\n let uriName;\n if (!props.context.attrs.multiple) {\n uriName = requestURIname(values.resource)\n props.context.node.input({ name: await uriName, resource: values.resource })\n\n }\n }\n }\n // multiple URI's\n if (values.length >= 1) {\n let uriNameList = [];\n for (let index = 0; index < values.length; index++) {\n if (values[index].name === values[index].resource) {\n uriNameList.push({ name: await requestURIname(values[index].resource), resource: values[index].resource })\n props.context.node.input(uriNameList)\n }\n }\n }\n});\nfunction findPropertyToUpdate(trigger) {\n\n let finalPath = { step: '', prop: props.context.node.name }\n let pathToLocalStorage = JSON.parse(localStorage.getItem('dpi_datasets'));\n\n for (let index = 0; index < Object.keys(pathToLocalStorage).length; index++) {\n for (let innerIndex = 0; innerIndex < Object.keys(pathToLocalStorage)[index].length; innerIndex++) {\n let ntry = Object.entries((pathToLocalStorage))\n try {\n Object.keys(ntry[index][innerIndex]).filter(e => {\n if (e === props.context.node.name) {\n finalPath.step = ntry[index][0]\n\n if (trigger === 'erase') {\n\n selection = {}\n pathToLocalStorage[finalPath.step][finalPath.prop] = selection\n }\n if (typeof selection === 'object') {\n\n pathToLocalStorage[finalPath.step][finalPath.prop] = selection\n }\n else pathToLocalStorage[finalPath.step][finalPath.prop] = selection\n localStorage.setItem('dpi_datasets', JSON.stringify(pathToLocalStorage))\n }\n });\n } catch (error) {\n }\n }\n }\n\n window.removeEventListener(\"click\", onClickOutside);\n}\nonClickOutside(dropdownList, event => activeList.value = false)\nlet annifHandlerTheme = async (input, limit) => {\n\n let finalLimit = 10;\n if (limit != undefined) {\n finalLimit = finalLimit + 10\n }\n\n let query = qs.stringify({\n 'text': input,\n 'limit': finalLimit\n });\n\n\n var config = {\n method: 'post',\n url: voc == \"eurovoc\"\n ? instance.content.dataProviderInterface.annifLinkSubject\n : instance.content.dataProviderInterface.annifLinkTheme,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Accept': 'application/json'\n },\n data: query\n };\n\n let list = []\n\n axios(config)\n .then(async (response) => {\n\n for (let i = 0; i < response.data.results.length; i++) {\n\n\n annifList[i] = { \"name\": response.data.results[i].label, \"resource\": response.data.results[i].uri, \"activeValue\": false }\n }\n let annifCacheList = []\n if (listOfValues.value.length > 0) {\n listOfValues.value.forEach(element => {\n annifCacheList.push({ \"name\": element.name, \"resource\": element.resource, \"activeValue\": true })\n });\n }\n if (response.data.results.length > 9) {\n annifList[annifList.length + 1] = { \"name\": \"...\", \"resource\": \"invalid\", \"activeValue\": false }\n }\n\n annifSelectionList.value = eraseDuplicates(annifCacheList, annifList)\n\n })\n .catch(function (error) {\n console.log(error);\n });\n}\nasync function updateAnnifselection(item) {\n\n if (item.resource === 'invalid') {\n fillAnnifsuggestions(5);\n }\n else {\n setValue({ name: item.name, resource: item.resource })\n fillAnnifsuggestions()\n }\n}\nfunction eraseDuplicates(array1, array2) {\n\n let mergedArray = array1.concat(array2);\n let filteredArray = [];\n let resourceSet = new Set();\n\n mergedArray.forEach(obj => {\n if (!resourceSet.has(obj.resource)) {\n resourceSet.add(obj.resource);\n if (!obj.activeValue) {\n filteredArray.push(obj);\n }\n }\n });\n\n\n return filteredArray;\n}\nconst fillAnnifsuggestions = async (limitChange) => {\n\n let arr = getNode('Mandatory').value['dct:description']\n for (let i = 0; i < arr.length; i++) {\n if (arr[i]['@language'] === 'en') {\n if (limitChange != undefined) {\n await annifHandlerTheme(arr[i]['@value'], 5)\n }\n else await annifHandlerTheme(arr[i]['@value'])\n }\n }\n\n}\n\n// Need to append the classes to the formkit-outer element\nprops.context.classes.outer += ' autocompleteInput ' + props.context.attrs.identifier\n\nconst setValue = async (e) => {\n if (Object.keys(e).length === 1) {\n return\n }\n if (listOfValues.value.length > 0) {\n\n cacheList = listOfValues.value\n }\n\n // when its a multi input\n if (props.context.attrs.multiple) {\n // check for doubled values\n if (cacheList.length != 0) {\n let filteredProperty = { name: e.name, resource: e.resource };\n let filteredList = cacheList.filter((element) => element.name != e.name);\n filteredList.push(filteredProperty)\n selection = filteredList;\n await props.context.node.input(selection);\n\n }\n else {\n cacheList.push({ name: e.name, resource: e.resource })\n selection = cacheList\n await props.context.node.input(selection);\n }\n\n }\n else if (e.resource === \"invalid\") return\n else if (e === \"erase\") { await props.context.node.input({}); findPropertyToUpdate(e) }\n else {\n selection = { name: e.name, resource: e.resource };\n await props.context.node.input(selection);\n }\n findPropertyToUpdate();\n}\n\nconst getAutocompleteSuggestions = async (e) => {\n let innerText = e.target.value\nconsole.log(locale);\n\n\n await store.dispatch('dpiStore/requestAutocompleteSuggestions', { voc: voc, text: innerText, base: instance.api.baseUrl }).then((response) => {\n const results = response.data.result.results.map((r) => ({\n name: getTranslationFor(r.pref_label, locale.value, []) + \" (\" + r.id + \")\",\n resource: r.resource,\n }));\n if (results.length === 0) {\n matches.value = { value: { name: matchesNothingFound } }\n }\n else matches.value = results;\n });\n}\n\nfunction removeProperty(e) {\n props.context.node.input({})\n setValue('erase');\n}\nfunction removeMultipleProperty(e) {\n\n if (instance.content.dataProviderInterface.annifIntegration) {\n fillAnnifsuggestions()\n }\n if (listOfValues.value.length > 0) {\n cacheList = listOfValues.value\n }\n // Get Index in the array where all values of the Span are stored and cut it out of the list of Values\n cacheList.splice(cacheList.findIndex((element) => element.name == e.name), 1)\n selection = cacheList;\n props.context.node.input(selection);\n findPropertyToUpdate();\n}\n</script>\n"],"names":["instance","getCurrentInstance","props","__props","store","useStore","t","locale","useI18n","listOfValues","computed","selection","voc","matchesSearchstring","matchesNothingFound","matches","ref","activeList","dropdownList","inputText","cacheList","annifList","annifTrigger","annifSelectionList","onMounted","inDis","watch","requestURIname","res","vocMatch","name","response","dataset","getTranslationFor","watchEffect","values","uriName","uriNameList","index","findPropertyToUpdate","trigger","finalPath","pathToLocalStorage","innerIndex","ntry","e","onClickOutside","event","annifHandlerTheme","input","limit","finalLimit","query","qs","config","axios","i","annifCacheList","element","eraseDuplicates","error","updateAnnifselection","item","fillAnnifsuggestions","setValue","array1","array2","mergedArray","filteredArray","resourceSet","obj","limitChange","arr","getNode","filteredProperty","filteredList","getAutocompleteSuggestions","innerText","results","r","removeProperty","removeMultipleProperty"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,QAAIA,IAAWC,GAAkB,EAAG,WAAW,IAAI,OAAO,iBAAiB;AAE3E,U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