@piveau/piveau-hub-ui-modules 4.5.4 → 4.5.6

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,13 +1,13 @@
1
- import { getCurrentInstance as ie, ref as u, computed as v, watchEffect as ne, watch as A, onMounted as re, nextTick as ce, reactive as de, openBlock as l, createElementBlock as i, unref as y, createElementVNode as c, toDisplayString as m, createTextVNode as d, withDirectives as q, vShow as ue, createCommentVNode as I, Fragment as L, renderList as S, isRef as R, vModelText as pe } from "vue";
2
- import { useStore as ve } from "vuex";
3
- import { getTranslationFor as z } from "../../utils/helpers.mjs";
4
- import { onClickOutside as G } from "../../external/@vueuse/core/index";
5
- import { useRoute as me } from "vue-router";
6
- import { useI18n as fe } from "vue-i18n";
7
- import { useTed as ye } from "../../composables/useTed.mjs";
8
- import { useAutocomplete as ge } from "../composables/aucotomplete.mjs";
9
- import { useRequestUriName as he } from "../composables/useRequestUriName.mjs";
10
- import { useDpiContext as be } from "../composables/useDpiContext.mjs";
1
+ import { getCurrentInstance as re, ref as d, computed as v, watchEffect as ce, watch as L, onMounted as de, nextTick as ue, reactive as pe, openBlock as l, createElementBlock as i, unref as y, createElementVNode as c, toDisplayString as m, createTextVNode as u, withDirectives as S, vShow as ve, createCommentVNode as I, vModelText as J, Fragment as G, renderList as E, isRef as R } from "vue";
2
+ import { useStore as me } from "vuex";
3
+ import { getTranslationFor as W } from "../../utils/helpers.mjs";
4
+ import { onClickOutside as N } from "../../external/@vueuse/core/index";
5
+ import { useRoute as fe } from "vue-router";
6
+ import { useI18n as ye } from "vue-i18n";
7
+ import { useTed as ge } from "../../composables/useTed.mjs";
8
+ import { useAutocomplete as he } from "../composables/aucotomplete.mjs";
9
+ import { useRequestUriName as be } from "../composables/useRequestUriName.mjs";
10
+ import { useDpiContext as Ie } from "../composables/useDpiContext.mjs";
11
11
  import "@formkit/core";
12
12
  import "merge-anything";
13
13
  import "../../configurations/config-schema/apiSchema.mjs";
@@ -20,63 +20,65 @@ import "../../configurations/config-schema/themesSchema.mjs";
20
20
  import "../../configurations/config-schema/trackerSchema.mjs";
21
21
  import "../../configurations/config-schema/configSchema.mjs";
22
22
  import "./SpatialInput.vue2.mjs";
23
- import Ie from "../../_virtual/_plugin-vue_export-helper.mjs";
24
- import { whenever as ke } from "../../external/@vueuse/shared/index";
25
- const Ce = { class: "d-flex flex-column w-100 spatialWrap" }, xe = {
23
+ import ke from "../../_virtual/_plugin-vue_export-helper.mjs";
24
+ import { whenever as Ce } from "../../external/@vueuse/shared/index";
25
+ const xe = { class: "d-flex flex-column w-100 spatialWrap" }, we = {
26
26
  key: 0,
27
27
  class: "d-flex formkit-inner mx-3 mb-3"
28
- }, we = { class: "autocompleteInputSingleValue" }, $e = { key: 1 }, Re = { class: "w-100 d-flex" }, Ue = {
28
+ }, $e = { class: "autocompleteInputSingleValue" }, Re = { key: 1 }, Ue = { class: "w-100 d-flex" }, Ke = {
29
29
  key: 0,
30
30
  class: "d-flex position-relative m-3 w-100"
31
- }, Ke = { class: "w-100" }, Te = ["placeholder"], Ve = {
31
+ }, Te = { class: "w-100" }, Ve = ["placeholder"], Ae = {
32
32
  key: 1,
33
33
  class: "d-flex position-relative m-3 w-100"
34
- }, Ae = { class: "w-100" }, Le = {
34
+ }, Le = { class: "w-100" }, Se = {
35
35
  key: 2,
36
36
  class: "d-flex position-relative m-3 w-100"
37
- }, Se = { class: "w-100" }, Ge = ["placeholder"], _e = ["onClick"], Ee = {
37
+ }, Ge = { class: "w-100" }, Ee = ["placeholder"], Ne = ["onClick"], De = {
38
38
  key: 0,
39
39
  class: "m-3"
40
- }, Ne = {
40
+ }, Me = {
41
41
  key: 0,
42
42
  class: "w-100"
43
- }, De = ["placeholder"], Me = ["onClick"], Fe = {
43
+ }, _e = ["placeholder"], Fe = ["onClick"], Oe = {
44
44
  __name: "SpatialInput",
45
45
  props: {
46
46
  context: Object
47
47
  },
48
- setup(J) {
49
- let _ = ie().appContext.app.config.globalProperties.$env, E = me();
50
- const W = be(), o = J, { requestAutocompleteSuggestions: N } = ge();
51
- let x = u([]), n = u({}), g = u({}), w = u({}), U = u({});
52
- ve();
53
- const { t: Z, locale: K } = fe({ inheritLocale: !0, useScope: "global" }), p = ye(), k = u(!1), C = u(!1), D = v(() => {
54
- var e;
55
- return !!((e = W.value.edit) != null && e.enabled);
56
- }), h = v(() => !!D.value && o.context.value.resource), T = v(() => h.value ? h.value.split("/")[h.value.split("/").length - 2] : ""), X = v(() => {
57
- if (!T.value)
48
+ setup(Z) {
49
+ let D = re().appContext.app.config.globalProperties.$env, M = fe();
50
+ const X = Ie(), o = Z, { requestAutocompleteSuggestions: _ } = he();
51
+ let x = d([]);
52
+ const U = d("");
53
+ let n = d({}), g = d({}), w = d({}), K = d({});
54
+ me();
55
+ const { t: H, locale: T } = ye({ inheritLocale: !0, useScope: "global" }), p = ge(), k = d(!1), C = d(!1), F = v(() => {
56
+ var t;
57
+ return !!((t = X.value.edit) != null && t.enabled);
58
+ }), h = v(() => !!F.value && o.context.value.resource), V = v(() => h.value ? h.value.split("/")[h.value.split("/").length - 2] : ""), Q = v(() => {
59
+ if (!V.value)
58
60
  return "";
59
- const e = o.context.attrs.identifier === "politicalGeocodingURI" ? "political-geocoding-" : "", t = T.value.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
60
- return `${e}${t}`;
61
- }), H = v(() => {
62
- const t = T.value.replace(/([a-z])([A-Z])/g, "$1 $2").toLowerCase().split(" ").map((a) => a.charAt(0).toUpperCase() + a.slice(1)).join(" ");
63
- return Z(`message.dataupload.datasets.conditional.${t}`);
64
- }), { execute: Q, state: M, isLoading: Y } = he({
65
- voc: X,
61
+ const t = o.context.attrs.identifier === "politicalGeocodingURI" ? "political-geocoding-" : "", e = V.value.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase();
62
+ return `${t}${e}`;
63
+ }), Y = v(() => {
64
+ const e = V.value.replace(/([a-z])([A-Z])/g, "$1 $2").toLowerCase().split(" ").map((a) => a.charAt(0).toUpperCase() + a.slice(1)).join(" ");
65
+ return H(`message.dataupload.datasets.conditional.${e}`);
66
+ }), { execute: ee, state: O, isLoading: te } = be({
67
+ voc: Q,
66
68
  res: v(() => o.context.value.resource),
67
69
  // property: 'dcatde:politicalGeocodingURI',
68
70
  property: v(() => o.context.attrs.identifier === "politicalGeocodingURI" ? "dcatde:politicalGeocodingURI" : "dct:spatial"),
69
- locale: K
70
- }), V = v(() => D.value && !Y.value && h.value && M.value ? `${H.value}: ${M.value} (${h.value.split("/").pop()})` : ""), F = u(!1);
71
- ne(() => {
72
- F.value || h.value && (F.value = !0, Q());
73
- }, { immediate: !0 }), ke(V, () => {
74
- const e = { name: V.value, resource: h.value };
75
- o.context.node.input(e);
71
+ locale: T
72
+ }), A = v(() => F.value && !te.value && h.value && O.value ? `${Y.value}: ${O.value} (${h.value.split("/").pop()})` : ""), P = d(!1);
73
+ ce(() => {
74
+ P.value || h.value && (P.value = !0, ee());
75
+ }, { immediate: !0 }), Ce(A, () => {
76
+ const t = { name: A.value, resource: h.value };
77
+ o.context.node.input(t);
76
78
  });
77
- const O = v(() => {
78
- var e, t;
79
- return !!((t = (e = o.context) == null ? void 0 : e.attrs) != null && t.vocabularyOnly);
79
+ const B = v(() => {
80
+ var t, e;
81
+ return !!((e = (t = o.context) == null ? void 0 : t.attrs) != null && e.vocabularyOnly);
80
82
  });
81
83
  o.context.attrs.identifier === "politicalGeocodingURI" && x.value.push(
82
84
  { item: "Municipality Key", active: !1, placeholder: p("message.dataupload.datasets.conditional.Municipality Key", "Municipality Key") },
@@ -89,39 +91,39 @@ const Ce = { class: "d-flex flex-column w-100 spatialWrap" }, xe = {
89
91
  { item: "Country", active: !1, placeholder: p("message.dataupload.datasets.conditional.Country", "Country") },
90
92
  { item: "Place", active: !1, placeholder: p("message.dataupload.datasets.conditional.Place", "Place") },
91
93
  { item: "Continent", active: !1, placeholder: p("message.dataupload.datasets.conditional.Continent", "Continent") }
92
- ), A(n, async () => {
93
- oe();
94
- }), A(g, async (e, t) => {
95
- e !== t && (g.value = g.value.toLowerCase());
96
- }), A(U, async () => {
97
- o.context.node.input({ name: U, resource: U });
98
- }), re(async () => {
99
- w = [{ name: p("message.dataupload.info.searchVocabulary", "--- Type in anything for a live search of the vocabulary ---").value, resource: "invalid" }], await ce(), o.context.value.name === void 0 || o.context.value.name === "" ? s.activeValue = !1 : s.activeValue = !0, O.value && (f("showTable"), C.value = !0, k.value && (k.value = !1));
94
+ ), L(n, async () => {
95
+ le();
96
+ }), L(g, async (t, e) => {
97
+ t !== e && (g.value = g.value.toLowerCase());
98
+ }), L(K, async () => {
99
+ o.context.node.input({ name: K, resource: K });
100
+ }), de(async () => {
101
+ w = [{ name: p("message.dataupload.info.searchVocabulary", "--- Type in anything for a live search of the vocabulary ---").value, resource: "invalid" }], await ue(), o.context.value.name === void 0 || o.context.value.name === "" ? s.activeValue = !1 : s.activeValue = !0, B.value && (f("showTable"), C.value = !0, k.value && (k.value = !1));
100
102
  });
101
- function ee() {
102
- x.value.forEach((e) => {
103
- e.active = !1;
103
+ function ae() {
104
+ x.value.forEach((t) => {
105
+ t.active = !1;
104
106
  });
105
107
  }
106
- function te(e) {
108
+ function oe(t) {
107
109
  s.activeValue = !1, o.context.node.input({});
108
110
  }
109
- function ae(e) {
110
- let t = JSON.parse(localStorage.getItem(`dpi_${E.params.property}`)), a;
111
- o.context.attrs.identifier === "politicalGeocodingURI" ? a = t.Advised["dcatde:politicalGeocodingURI"] : a = t.Advised["dct:spatial"], a.forEach((r, $) => {
111
+ function se(t) {
112
+ let e = JSON.parse(localStorage.getItem(`dpi_${M.params.property}`)), a;
113
+ o.context.attrs.identifier === "politicalGeocodingURI" ? a = e.Advised["dcatde:politicalGeocodingURI"] : a = e.Advised["dct:spatial"], a.forEach((r, $) => {
112
114
  Object.keys(r).length === 0 && a.splice($, 1);
113
- }), a.push(o.context.node._value), o.context.attrs.identifier === "politicalGeocodingURI" ? t.Advised["dcatde:politicalGeocodingURI"] = a : t.Advised["dct:spatial"] = a, localStorage.setItem(`dpi_${E.params.property}`, JSON.stringify(t));
115
+ }), a.push(o.context.node._value), o.context.attrs.identifier === "politicalGeocodingURI" ? e.Advised["dcatde:politicalGeocodingURI"] = a : e.Advised["dct:spatial"] = a, localStorage.setItem(`dpi_${M.params.property}`, JSON.stringify(e));
114
116
  }
115
- const oe = async () => {
116
- var t;
117
- let e = (t = g.value) == null ? void 0 : t.toLowerCase();
117
+ const le = async () => {
118
+ var e;
119
+ let t = (e = g.value) == null ? void 0 : e.toLowerCase();
118
120
  if (o.context.attrs.identifier === "politicalGeocodingURI") {
119
- e = "political-geocoding-" + e.toLowerCase().replaceAll(" ", "-");
121
+ t = "political-geocoding-" + t.toLowerCase().replaceAll(" ", "-");
120
122
  try {
121
123
  let a = n.value;
122
- await N({ voc: e, text: a, base: _.api.baseUrl }).then((r) => {
124
+ await _({ voc: t, text: a, base: D.api.baseUrl }).then((r) => {
123
125
  w = r.data.result.results.map((b) => ({
124
- name: z(b.alt_label, K.value, []) + " (" + b.id + ")",
126
+ name: W(b.alt_label, T.value, []) + " (" + b.id + ")",
125
127
  resource: b.resource
126
128
  }));
127
129
  });
@@ -130,163 +132,166 @@ const Ce = { class: "d-flex flex-column w-100 spatialWrap" }, xe = {
130
132
  } else
131
133
  try {
132
134
  let a = n.value;
133
- await N({ voc: e, text: a, base: _.api.baseUrl }).then((r) => {
135
+ await _({ voc: t, text: a, base: D.api.baseUrl }).then((r) => {
134
136
  w = r.data.result.results.map((b) => ({
135
- name: z(b.pref_label, K.value, []) + " (" + b.id + ")",
137
+ name: W(b.pref_label, T.value, []) + " (" + b.id + ")",
136
138
  resource: b.resource
137
139
  }));
138
140
  });
139
141
  } catch {
140
142
  }
141
143
  };
142
- var s = de({
144
+ var s = pe({
143
145
  first: !1,
144
146
  second: !1,
145
147
  third: !1,
146
148
  activeValue: !1
147
149
  });
148
- const P = u(null), B = u(null), j = u(null);
149
- G(P, (e) => s.first = !1), G(B, (e) => s.second = !1), G(j, (e) => s.third = !1);
150
- function f(e) {
151
- e === "showTable" && (s.first = !s.first), e === "showVocTable" && (s.second = !s.second), e === "showVocEntries" && (s.third === !0 || (s.third = !s.third));
150
+ const j = d(null), q = d(null), z = d(null);
151
+ N(j, (t) => s.first = !1), N(q, (t) => s.second = !1), N(z, (t) => s.third = !1);
152
+ function f(t) {
153
+ t === "showTable" && (s.first = !s.first), t === "showVocTable" && (s.second = !s.second), t === "showVocEntries" && (s.third === !0 || (s.third = !s.third));
152
154
  }
153
- function se(e) {
154
- o.context.node.input({ name: e.target.value, resource: e.target.value });
155
+ function ie(t) {
156
+ o.context.node.input({ name: t.target.value, resource: t.target.value });
155
157
  }
156
- function le(e) {
157
- o.context.node.input(e), n.value = e.name, f("showVocEntries"), s.third = !1, ae();
158
+ function ne(t) {
159
+ o.context.node.input(t), n.value = t.name, f("showVocEntries"), s.third = !1, se();
158
160
  }
159
- return (e, t) => (l(), i("div", Ce, [
160
- !o.context.attrs.multiple && y(s).activeValue ? (l(), i("div", xe, [
161
- c("a", we, m(V.value), 1),
162
- t[7] || (t[7] = d()),
161
+ return (t, e) => (l(), i("div", xe, [
162
+ !o.context.attrs.multiple && y(s).activeValue ? (l(), i("div", we, [
163
+ c("a", $e, m(A.value), 1),
164
+ e[8] || (e[8] = u()),
163
165
  c("div", {
164
166
  class: "removeX",
165
- onClick: te
167
+ onClick: oe
166
168
  })
167
- ])) : (l(), i("div", $e, [
168
- c("div", Re, [
169
- O.value ? I("", !0) : (l(), i("div", Ue, [
170
- c("label", Ke, [
171
- d(m(e.$t("message.dataupload.info.preferredInput")) + " ", 1),
169
+ ])) : (l(), i("div", Re, [
170
+ c("div", Ue, [
171
+ B.value ? I("", !0) : (l(), i("div", Ke, [
172
+ c("label", Te, [
173
+ u(m(t.$t("message.dataupload.info.preferredInput")) + " ", 1),
172
174
  c("input", {
173
175
  id: "I1",
174
176
  type: "text",
175
177
  class: "selectInputField formkit-inner",
176
178
  readonly: "readonly",
177
- placeholder: e.$t("message.dataupload.info.preferredInput"),
178
- onClick: t[0] || (t[0] = (a) => f("showTable"))
179
- }, null, 8, Te)
179
+ placeholder: t.$t("message.dataupload.info.preferredInput"),
180
+ onClick: e[0] || (e[0] = (a) => f("showTable"))
181
+ }, null, 8, Ve)
180
182
  ]),
181
- t[9] || (t[9] = d()),
182
- q(c("ul", {
183
+ e[10] || (e[10] = u()),
184
+ S(c("ul", {
183
185
  ref_key: "I1",
184
- ref: P,
186
+ ref: j,
185
187
  class: "spatialListUpload"
186
188
  }, [
187
189
  c("li", {
188
- onClick: t[1] || (t[1] = (a) => {
190
+ onClick: e[1] || (e[1] = (a) => {
189
191
  f("showTable"), k.value = !0, C.value && (C.value = !1);
190
192
  }),
191
193
  class: "p-2 border-b border-gray-200 choosableItemsAC"
192
- }, m(e.$t("message.dataupload.datasets.conditional.manually")), 1),
193
- t[8] || (t[8] = d()),
194
+ }, m(t.$t("message.dataupload.datasets.conditional.manually")), 1),
195
+ e[9] || (e[9] = u()),
194
196
  c("li", {
195
- onClick: t[2] || (t[2] = (a) => {
197
+ onClick: e[2] || (e[2] = (a) => {
196
198
  f("showTable"), C.value = !0, k.value && (k.value = !1);
197
199
  }),
198
200
  class: "p-2 border-b border-gray-200 choosableItemsAC"
199
- }, m(e.$t("message.dataupload.datasets.conditional.vocabulary")), 1)
201
+ }, m(t.$t("message.dataupload.datasets.conditional.vocabulary")), 1)
200
202
  ], 512), [
201
- [ue, y(s).first]
203
+ [ve, y(s).first]
202
204
  ])
203
205
  ])),
204
- t[11] || (t[11] = d()),
205
- k.value ? (l(), i("div", Ve, [
206
- c("label", Ae, [
207
- d(m(e.$te("message.dataupload.datasets.isReferencedByUrl.placeholder") ? e.$t("message.dataupload.datasets.isReferencedByUrl.placeholder") : "Provide an URL") + " ", 1),
206
+ e[12] || (e[12] = u()),
207
+ k.value ? (l(), i("div", Ae, [
208
+ c("label", Le, [
209
+ u(m(t.$te("message.dataupload.datasets.isReferencedByUrl.placeholder") ? t.$t("message.dataupload.datasets.isReferencedByUrl.placeholder") : "Provide an URL") + " ", 1),
208
210
  c("input", {
209
211
  type: "URL",
210
212
  class: "selectInputField formkit-inner",
211
213
  placeholder: "URL",
212
- onInput: t[3] || (t[3] = (a) => se(a))
214
+ onInput: e[3] || (e[3] = (a) => ie(a))
213
215
  }, null, 32)
214
216
  ])
215
217
  ])) : I("", !0),
216
- t[12] || (t[12] = d()),
217
- C.value ? (l(), i("div", Le, [
218
- c("label", Se, [
219
- d(m(e.$te("message.dataupload.datasets.contributorType.placeholder") ? e.$t("message.dataupload.datasets.contributorType.placeholder") : "Choose type of vocabulary") + " ", 1),
220
- c("input", {
218
+ e[13] || (e[13] = u()),
219
+ C.value ? (l(), i("div", Se, [
220
+ c("label", Ge, [
221
+ u(m(t.$te("message.dataupload.datasets.contributorType.placeholder") ? t.$t("message.dataupload.datasets.contributorType.placeholder") : "Choose type of vocabulary") + " ", 1),
222
+ S(c("input", {
221
223
  id: "I2",
222
224
  type: "text",
223
225
  class: "selectInputField formkit-inner",
224
226
  readonly: "readonly",
225
- placeholder: e.$te("message.dataupload.datasets.accessRights.placeholder") ? e.$t("message.dataupload.datasets.accessRights.placeholder") : "Choose type of vocabulary",
226
- onClick: t[4] || (t[4] = (a) => {
227
+ "onUpdate:modelValue": e[4] || (e[4] = (a) => U.value = a),
228
+ placeholder: t.$te("message.dataupload.datasets.accessRights.placeholder") ? t.$t("message.dataupload.datasets.accessRights.placeholder") : "Choose type of vocabulary",
229
+ onClick: e[5] || (e[5] = (a) => {
227
230
  f("showVocTable");
228
231
  })
229
- }, null, 8, Ge)
232
+ }, null, 8, Ee), [
233
+ [J, U.value]
234
+ ])
230
235
  ]),
231
- t[10] || (t[10] = d()),
236
+ e[11] || (e[11] = u()),
232
237
  y(s).second ? (l(), i("ul", {
233
238
  key: 0,
234
239
  ref_key: "I2",
235
- ref: B,
240
+ ref: q,
236
241
  class: "spatialListUpload"
237
242
  }, [
238
- (l(!0), i(L, null, S(y(x), (a) => (l(), i("li", {
243
+ (l(!0), i(G, null, E(y(x), (a) => (l(), i("li", {
239
244
  key: a,
240
245
  class: "p-2 border-b border-gray-200 choosableItemsAC",
241
246
  onClick: (r) => {
242
- ee(), a.active = !a.active, f("showVocTable"), R(n) ? n.value = "" : n = "", R(g) ? g.value = a.item : g = a.item;
247
+ ae(), a.active = !a.active, f("showVocTable"), R(n) ? n.value = "" : n = "", R(g) ? g.value = a.item : g = a.item, U.value = a.placeholder;
243
248
  }
244
- }, m(e.$t("message.dataupload.datasets.conditional." + a.item)), 9, _e))), 128))
249
+ }, m(t.$t("message.dataupload.datasets.conditional." + a.item)), 9, Ne))), 128))
245
250
  ], 512)) : I("", !0)
246
251
  ])) : I("", !0)
247
252
  ]),
248
- t[14] || (t[14] = d()),
249
- C.value ? (l(), i("div", Ee, [
250
- (l(!0), i(L, null, S(y(x), (a) => (l(), i("div", {
253
+ e[15] || (e[15] = u()),
254
+ C.value ? (l(), i("div", De, [
255
+ (l(!0), i(G, null, E(y(x), (a) => (l(), i("div", {
251
256
  key: a,
252
257
  class: "position-relative"
253
258
  }, [
254
- a.active ? (l(), i("label", Ne, [
255
- d(m(e.$te("message.dataupload.datasets.accessRights.placeholder") ? e.$t("message.dataupload.datasets.accessRights.placeholder") : "Choose type of vocabulary") + " ", 1),
256
- q(c("input", {
259
+ a.active ? (l(), i("label", Me, [
260
+ u(m(a.placeholder ? a.placeholder : t.$t("message.dataupload.datasets.conditional." + a.item)) + " ", 1),
261
+ S(c("input", {
257
262
  id: "I3",
258
263
  type: "text",
259
- "onUpdate:modelValue": t[5] || (t[5] = (r) => R(n) ? n.value = r : n = r),
264
+ "onUpdate:modelValue": e[6] || (e[6] = (r) => R(n) ? n.value = r : n = r),
260
265
  class: "selectInputField formkit-inner",
261
- placeholder: a.placeholder ?? "",
262
- onClick: t[6] || (t[6] = (r) => {
266
+ placeholder: t.$te("message.dataupload.datasets.accessRights.placeholder") ? t.$t("message.dataupload.datasets.accessRights.placeholder") : "Choose type of vocabulary",
267
+ onClick: e[7] || (e[7] = (r) => {
263
268
  f("showVocEntries"), R(n) ? n.value = "" : n = "";
264
269
  })
265
- }, null, 8, De), [
266
- [pe, y(n)]
270
+ }, null, 8, _e), [
271
+ [J, y(n)]
267
272
  ])
268
273
  ])) : I("", !0),
269
- t[13] || (t[13] = d()),
274
+ e[14] || (e[14] = u()),
270
275
  y(s).third && a.active ? (l(), i("ul", {
271
276
  key: 1,
272
277
  ref_for: !0,
273
278
  ref_key: "I3",
274
- ref: j,
279
+ ref: z,
275
280
  class: "spatialListUpload"
276
281
  }, [
277
- (l(!0), i(L, null, S(y(w), (r) => (l(), i("li", {
282
+ (l(!0), i(G, null, E(y(w), (r) => (l(), i("li", {
278
283
  key: r,
279
284
  class: "p-2 border-b border-gray-200 choosableItemsAC",
280
- onClick: ($) => le(r)
281
- }, m(r.name), 9, Me))), 128))
285
+ onClick: ($) => ne(r)
286
+ }, m(r.name), 9, Fe))), 128))
282
287
  ], 512)) : I("", !0)
283
288
  ]))), 128))
284
289
  ])) : I("", !0)
285
290
  ]))
286
291
  ]));
287
292
  }
288
- }, ut = /* @__PURE__ */ Ie(Fe, [["__scopeId", "data-v-6cab5868"]]);
293
+ }, pt = /* @__PURE__ */ ke(Oe, [["__scopeId", "data-v-c7b8d84d"]]);
289
294
  export {
290
- ut as default
295
+ pt as default
291
296
  };
292
297
  //# sourceMappingURL=SpatialInput.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"SpatialInput.vue.mjs","sources":["../../../lib/data-provider-interface/components/SpatialInput.vue"],"sourcesContent":["<script setup>\n\nimport { ref, reactive, watch, computed, onBeforeMount, onMounted, nextTick, watchEffect } from 'vue';\nimport { useStore } from 'vuex';\nimport { getTranslationFor } from \"../../utils/helpers\";\nimport { onClickOutside, whenever } from '@vueuse/core'\nimport { getCurrentInstance } from \"vue\";\nimport { useRoute } from 'vue-router';\nimport { useI18n } from 'vue-i18n';\nimport { useTed } from '../../composables/useTed';\nimport { useAutocomplete } from '../composables/aucotomplete';\nimport { useRequestUriName } from '../composables/useRequestUriName';\nimport { useDpiContext } from '../composables';\n\n\nlet instance = getCurrentInstance().appContext.app.config.globalProperties.$env\nlet route = useRoute();\nconst dpiContext = useDpiContext();\n\nconst props = defineProps({\n context: Object,\n})\n\nconst { requestAutocompleteSuggestions } = useAutocomplete()\n\n// let listOfVoc: [{ item: 'Country', active: false }, { item: 'Place', active: false }, { item: 'Continent', active: false }],\nlet listOfVoc = ref([])\nlet inputText = ref({})\nlet voc = ref({})\nlet matches = ref({})\nlet manURL = ref({})\nconst store = useStore();\nconst { t, locale } = useI18n({ inheritLocale: true, useScope: 'global' });\nconst ted = useTed();\n\nconst man = ref(false)\nconst vocSearch = ref(false)\n\nconst isEdit = computed(() => !!dpiContext.value.edit?.enabled)\nconst resourceNameWhenEditing = computed(() => !!isEdit.value && props.context.value.resource)\n// e.g. extract \"municipalityKey\" (second to last) out of resourceName\nconst keyFromResourceName = computed(() => {\n if (resourceNameWhenEditing.value) {\n return resourceNameWhenEditing.value.split('/')[resourceNameWhenEditing.value.split('/').length - 2]\n }\n return ''\n})\nconst spatialVocabName = computed(() => {\n if (!keyFromResourceName.value) {\n return ''\n }\n\n const maybePrefix = props.context.attrs.identifier === 'politicalGeocodingURI'\n ? 'political-geocoding-'\n // todo: extend this for other vocabularies\n : ''\n\n // transform key from camelCase to kebab-case\n const vocabKey = keyFromResourceName.value.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()\n return `${maybePrefix}${vocabKey}`\n})\n\nconst translatedResourceName = computed(() => {\n // transform key 'districtKey' to 'District Key'\n const vocabKey = keyFromResourceName.value.replace(/([a-z])([A-Z])/g, '$1 $2').toLowerCase()\n // make first letters of each word uppercase\n const vocabKeyUpper = vocabKey.split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ')\n return t(`message.dataupload.datasets.conditional.${vocabKeyUpper}`)\n})\n\nconst { execute, state, isLoading } = useRequestUriName({\n voc: spatialVocabName,\n res: computed(() => props.context.value.resource),\n // property: 'dcatde:politicalGeocodingURI',\n property: computed(() => props.context.attrs.identifier === 'politicalGeocodingURI' ? 'dcatde:politicalGeocodingURI' : 'dct:spatial'), \n locale,\n})\n\nconst restoredValueFromEditMode = computed(() => {\n if (isEdit.value && !isLoading.value && resourceNameWhenEditing.value && state.value) {\n return `${translatedResourceName.value}: ${state.value} (${resourceNameWhenEditing.value.split('/').pop()})`\n }\n\n return ''\n})\n\nconst once = ref(false)\nwatchEffect(() => {\n if (once.value) return;\n\n if (!!resourceNameWhenEditing.value) {\n once.value = true\n execute()\n }\n}, { immediate: true })\n\nwhenever(restoredValueFromEditMode, () => {\n const v = { name: restoredValueFromEditMode.value, resource: resourceNameWhenEditing.value }\n props.context.node.input(v)\n})\n\n// If true, then:\n// - hides the select input for manual and vocabulary\n// - pre-selects the vocabulary option\n// When using formkit schema, enable this option by setting vocabularyOnly to true\n// {\n// $formkit: 'spatialinput',\n// name: 'dcatde:politicalGeocodingURI',\n// identifier: 'politicalGeocodingURI',\n// vocabularyOnly: true,\n// }\nconst vocabularyOnly = computed(() => !!props.context?.attrs?.vocabularyOnly)\n\nif (props.context.attrs.identifier === 'politicalGeocodingURI') {\n listOfVoc.value.push(\n { item: 'Municipality Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Municipality Key', 'Municipality Key') },\n { item: 'Regional Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Regional Key', 'Regional Key') },\n { item: 'Municipal Association Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Municipal Association Key', 'Municipal Association Key') },\n { item: 'District Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.District Key', 'District Key') },\n { item: 'Government District Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Government District Key', 'Government District Key') },\n { item: 'State Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.State Key', 'State Key') },\n )\n\n}\nif (props.context.attrs.identifier === 'spatial') {\n listOfVoc.value.push(\n { item: 'Country', active: false, placeholder: ted('message.dataupload.datasets.conditional.Country', 'Country') },\n { item: 'Place', active: false, placeholder: ted('message.dataupload.datasets.conditional.Place', 'Place') },\n { item: 'Continent', active: false, placeholder: ted('message.dataupload.datasets.conditional.Continent', 'Continent') },\n )\n}\n\nwatch(inputText, async () => {\n getAutocompleteSuggestions();\n})\nwatch(voc, async (newValue, oldValue) => {\n if (newValue === oldValue) { return }\n voc.value = voc.value.toLowerCase();\n})\nwatch(manURL, async () => {\n props.context.node.input({ 'name': manURL, 'resource': manURL })\n})\nonMounted(async () => {\n matches = [{ name: ted('message.dataupload.info.searchVocabulary', '--- Type in anything for a live search of the vocabulary ---').value, resource: 'invalid' }]\n\n await nextTick()\n // DOM loaded\n if (props.context.value.name === undefined || props.context.value.name === \"\") {\n showTable.activeValue = false\n } else showTable.activeValue = true\n // console.log(showTable.activeValue);\n\n if (vocabularyOnly.value) {\n activeInput('showTable'); vocSearch.value = true; if (man.value) { man.value = false }\n }\n\n});\n\nfunction closeAll() {\n listOfVoc.value.forEach(element => {\n element.active = false;\n });\n}\nfunction removeProperty(e) {\n // props.context.value = {}\n showTable.activeValue = false\n props.context.node.input({})\n}\nfunction saveToLocal(el) {\n\n let pathToLocalStorage = JSON.parse(localStorage.getItem(`dpi_${route.params.property}`));\n let arr\n if (props.context.attrs.identifier === 'politicalGeocodingURI') {\n arr = pathToLocalStorage.Advised['dcatde:politicalGeocodingURI'];\n }\n else arr = pathToLocalStorage.Advised['dct:spatial'];\n\n arr.forEach((element, index) => {\n if (Object.keys(element).length === 0) {\n arr.splice(index, 1)\n }\n })\n arr.push(props.context.node._value)\n if (props.context.attrs.identifier === 'politicalGeocodingURI') {\n pathToLocalStorage.Advised['dcatde:politicalGeocodingURI'] = arr\n }\n else pathToLocalStorage.Advised['dct:spatial'] = arr\n\n localStorage.setItem(`dpi_${route.params.property}`, JSON.stringify(pathToLocalStorage))\n}\nconst getAutocompleteSuggestions = async () => {\n\n let vocCache = voc.value?.toLowerCase()\n\n if (props.context.attrs.identifier === 'politicalGeocodingURI') {\n\n vocCache = 'political-geocoding-' + vocCache.toLowerCase().replaceAll(\" \", '-')\n\n try {\n let text = inputText.value;\n await requestAutocompleteSuggestions({ voc: vocCache, text: text, base: instance.api.baseUrl }).then((response) => {\n const results = response.data.result.results.map((r) => ({\n name: getTranslationFor(r.alt_label, locale.value, []) + \" (\" + r.id + \")\",\n resource: r.resource,\n }));\n matches = results;\n });\n } catch (error) {\n }\n }\n else {\n try {\n let text = inputText.value;\n await requestAutocompleteSuggestions({ voc: vocCache, text: text, 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 matches = results;\n });\n } catch (error) {\n }\n }\n\n}\n\nvar showTable = reactive({\n first: false,\n second: false,\n third: false,\n activeValue: false\n})\n\nconst I1 = ref(null);\nconst I2 = ref(null);\nconst I3 = ref(null);\n\nonClickOutside(I1, event => showTable.first = false)\nonClickOutside(I2, event => showTable.second = false)\nonClickOutside(I3, event => showTable.third = false)\nfunction activeInput(e) {\n\n // console.log('in', showTable);\n if (e === \"showTable\") showTable.first = !showTable.first;\n if (e === \"showVocTable\") showTable.second = !showTable.second;\n if (e === \"showVocEntries\") {\n if (showTable.third === true) {\n }\n else showTable.third = !showTable.third;\n }\n}\nfunction manURLInput(e) {\n props.context.node.input({ 'name': e.target.value, 'resource': e.target.value })\n}\n\nfunction handleSpatielListClick(el) {\n props.context.node.input(el);\n inputText.value = el.name;\n activeInput('showVocEntries');\n showTable.third = false;\n saveToLocal(el)\n}\n// console.log(voc);\n</script>\n\n<template>\n <div class=\"d-flex flex-column w-100 spatialWrap\">\n <div class=\"d-flex formkit-inner mx-3 mb-3\" v-if=\"!props.context.attrs.multiple && showTable.activeValue\">\n <!-- <div class=\"infoI\">\n <div class=\"tooltipFormkit\">{{ props.context.attrs.info }}</div>\n </div> -->\n <a class=\"autocompleteInputSingleValue \">{{ restoredValueFromEditMode }}</a>\n <div class=\"removeX\" @click=\"removeProperty\"></div>\n </div>\n <div v-else>\n <div class=\" w-100 d-flex\">\n <div v-if=\"!vocabularyOnly\" class=\"d-flex position-relative m-3 w-100\">\n <label class=\"w-100\"> {{ $t('message.dataupload.info.preferredInput') }}\n <input id=\"I1\" type=\"text\" class=\"selectInputField formkit-inner\" readonly=\"readonly\"\n :placeholder=\"$t('message.dataupload.info.preferredInput')\"\n @click=\"activeInput('showTable')\" />\n </label>\n\n <ul ref=\"I1\" v-show=\"showTable.first\" class=\"spatialListUpload\">\n <li @click=\"activeInput('showTable'); man = true; if (vocSearch) { vocSearch = false; };\"\n class=\"p-2 border-b border-gray-200 choosableItemsAC\">\n {{ $t('message.dataupload.datasets.conditional.manually') }}\n </li>\n <li @click=\"activeInput('showTable'); vocSearch = true; if (man) { man = false }\"\n class=\"p-2 border-b border-gray-200 choosableItemsAC\">\n {{ $t('message.dataupload.datasets.conditional.vocabulary') }}\n </li>\n </ul>\n </div>\n <div v-if=\"man\" class=\"d-flex position-relative m-3 w-100\">\n <label class=\"w-100\">\n <!-- todo: I borrowed this from another input. Maybe refactor? -->\n {{ $te('message.dataupload.datasets.isReferencedByUrl.placeholder') ? $t('message.dataupload.datasets.isReferencedByUrl.placeholder') : 'Provide an URL' }}\n <input type=\"URL\" class=\"selectInputField formkit-inner\" placeholder=\"URL\"\n @input=\"manURLInput($event)\">\n </label>\n </div>\n <div v-if=\"vocSearch\" class=\"d-flex position-relative m-3 w-100\">\n <!-- todo: I borrowed this from another input. Maybe refactor? -->\n <label class=\"w-100\"> {{ $te('message.dataupload.datasets.contributorType.placeholder') ? $t('message.dataupload.datasets.contributorType.placeholder') : 'Choose type of vocabulary' }} \n <input id=\"I2\" type=\"text\" class=\"selectInputField formkit-inner\" readonly=\"readonly\"\n :placeholder=\"$te('message.dataupload.datasets.accessRights.placeholder') ? $t('message.dataupload.datasets.accessRights.placeholder') : 'Choose type of vocabulary'\" @click=\"activeInput('showVocTable');\">\n </label>\n <ul ref=\"I2\" v-if=\"showTable.second\" class=\"spatialListUpload\">\n <li v-for=\"el in listOfVoc\" :key=\"el\" class=\"p-2 border-b border-gray-200 choosableItemsAC\"\n @click=\" closeAll(); el.active = !el.active; activeInput('showVocTable'); inputText = ''; voc = el.item\">\n {{ $t('message.dataupload.datasets.conditional.' + el.item) }}</li>\n </ul>\n </div>\n </div>\n <div class=\"m-3\" v-if=\"vocSearch\">\n <div v-for=\"el in listOfVoc\" :key=\"el\" class=\"position-relative\">\n <label class=\"w-100\" v-if=\"el.active\">\n <!-- todo: I borrowed this from another input. Maybe refactor? -->\n {{ $te('message.dataupload.datasets.accessRights.placeholder') ? $t('message.dataupload.datasets.accessRights.placeholder') : 'Choose type of vocabulary' }} \n <input id=\"I3\" type=\"text\"\n v-model=\"inputText\" class=\"selectInputField formkit-inner\" :placeholder=\"el.placeholder ?? ''\"\n @click=\"activeInput('showVocEntries'); inputText = ''\"\n >\n </label>\n <ul ref=\"I3\" v-if=\"showTable.third && el.active\" class=\"spatialListUpload\">\n <li v-for=\"el in matches\" :key=\"el\" class=\"p-2 border-b border-gray-200 choosableItemsAC\"\n @click=\"handleSpatielListClick(el)\">\n {{ el.name }}</li>\n </ul>\n </div>\n\n </div>\n\n </div>\n </div>\n</template>\n\n<script>\n\n</script>\n\n<style lang=\"scss\" scoped>\n.spatialWrap label {\n font-family: var(--fk-font-family-label);\n font-size: var(--fk-font-size-label);\n font-weight: var(--fk-font-weight-label);\n line-height: var(--fk-line-height-label);\n}\n\n.spatialWrap {\n .spatialListUpload {\n width: 100%;\n left: 0;\n top: 78px;\n }\n}\n</style>\n"],"names":["instance","getCurrentInstance","route","useRoute","dpiContext","useDpiContext","props","__props","requestAutocompleteSuggestions","useAutocomplete","listOfVoc","ref","inputText","voc","matches","manURL","useStore","t","locale","useI18n","ted","useTed","man","vocSearch","isEdit","computed","_a","resourceNameWhenEditing","keyFromResourceName","spatialVocabName","maybePrefix","vocabKey","translatedResourceName","vocabKeyUpper","word","execute","state","isLoading","useRequestUriName","restoredValueFromEditMode","once","watchEffect","whenever","v","vocabularyOnly","_b","watch","getAutocompleteSuggestions","newValue","oldValue","onMounted","nextTick","showTable","activeInput","closeAll","element","removeProperty","saveToLocal","el","pathToLocalStorage","arr","index","vocCache","text","response","r","getTranslationFor","reactive","I1","I2","I3","onClickOutside","event","manURLInput","handleSpatielListClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,QAAIA,IAAWC,GAAkB,EAAG,WAAW,IAAI,OAAO,iBAAiB,MACvEC,IAAQC,GAAQ;AACpB,UAAMC,IAAaC,GAAa,GAE1BC,IAAQC,GAIR,EAAE,gCAAAC,EAAgC,IAAGC,GAAgB;AAG3D,QAAIC,IAAYC,EAAI,EAAE,GAClBC,IAAYD,EAAI,EAAE,GAClBE,IAAMF,EAAI,EAAE,GACZG,IAAUH,EAAI,EAAE,GAChBI,IAASJ,EAAI,EAAE;AACL,IAAAK,GAAU;AACxB,UAAM,EAAE,GAAAC,GAAG,QAAAC,EAAQ,IAAGC,GAAQ,EAAE,eAAe,IAAM,UAAU,SAAQ,CAAE,GACnEC,IAAMC,GAAM,GAEZC,IAAMX,EAAI,EAAK,GACfY,IAAYZ,EAAI,EAAK,GAErBa,IAASC,EAAS;;AAAM,cAAC,GAACC,IAAAtB,EAAW,MAAM,SAAjB,QAAAsB,EAAuB;AAAA,KAAO,GACxDC,IAA0BF,EAAS,MAAM,CAAC,CAACD,EAAO,SAASlB,EAAM,QAAQ,MAAM,QAAQ,GAEvFsB,IAAsBH,EAAS,MAC7BE,EAAwB,QACjBA,EAAwB,MAAM,MAAM,GAAG,EAAEA,EAAwB,MAAM,MAAM,GAAG,EAAE,SAAS,CAAC,IAEhG,EACV,GACKE,IAAmBJ,EAAS,MAAM;AACtC,UAAI,CAACG,EAAoB;AACvB,eAAO;AAGT,YAAME,IAAcxB,EAAM,QAAQ,MAAM,eAAe,0B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eH,GAAI,CAAAI,MAASpB,EAAU,QAAQ,EAAK,GACnDmB,EAAeF,GAAI,CAAAG,MAASpB,EAAU,SAAS,EAAK,GACpDmB,EAAeD,GAAI,CAAAE,MAASpB,EAAU,QAAQ,EAAK;AACnD,aAASC,EAAY,GAAG;AAGpB,MAAI,MAAM,gBAAaD,EAAU,QAAQ,CAACA,EAAU,QAChD,MAAM,mBAAgBA,EAAU,SAAS,CAACA,EAAU,SACpD,MAAM,qBACFA,EAAU,UAAU,OAEnBA,EAAU,QAAQ,CAACA,EAAU;AAAA,IAE1C;AACA,aAASqB,GAAY,GAAG;AACpB,MAAAnE,EAAM,QAAQ,KAAK,MAAM,EAAE,MAAQ,EAAE,OAAO,OAAO,UAAY,EAAE,OAAO,MAAK,CAAE;AAAA,IACnF;AAEA,aAASoE,GAAuBhB,GAAI;AAClC,MAAApD,EAAM,QAAQ,KAAK,MAAMoD,CAAE,GAC3B9C,EAAU,QAAQ8C,EAAG,MACrBL,EAAY,gBAAgB,GAC5BD,EAAU,QAAQ,IAClBK,GAAc;AAAA,IAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SpatialInput.vue.mjs","sources":["../../../lib/data-provider-interface/components/SpatialInput.vue"],"sourcesContent":["<script setup>\n\nimport { ref, reactive, watch, computed, onBeforeMount, onMounted, nextTick, watchEffect } from 'vue';\nimport { useStore } from 'vuex';\nimport { getTranslationFor } from \"../../utils/helpers\";\nimport { onClickOutside, whenever } from '@vueuse/core'\nimport { getCurrentInstance } from \"vue\";\nimport { useRoute } from 'vue-router';\nimport { useI18n } from 'vue-i18n';\nimport { useTed } from '../../composables/useTed';\nimport { useAutocomplete } from '../composables/aucotomplete';\nimport { useRequestUriName } from '../composables/useRequestUriName';\nimport { useDpiContext } from '../composables';\n\n\nlet instance = getCurrentInstance().appContext.app.config.globalProperties.$env\nlet route = useRoute();\nconst dpiContext = useDpiContext();\n\nconst props = defineProps({\n context: Object,\n})\n\nconst { requestAutocompleteSuggestions } = useAutocomplete()\n\n// let listOfVoc: [{ item: 'Country', active: false }, { item: 'Place', active: false }, { item: 'Continent', active: false }],\nlet listOfVoc = ref([])\nconst typeText = ref('')\nlet inputText = ref({})\nlet voc = ref({})\nlet matches = ref({})\nlet manURL = ref({})\nconst store = useStore();\nconst { t, locale } = useI18n({ inheritLocale: true, useScope: 'global' });\nconst ted = useTed();\n\nconst man = ref(false)\nconst vocSearch = ref(false)\n\nconst isEdit = computed(() => !!dpiContext.value.edit?.enabled)\nconst resourceNameWhenEditing = computed(() => !!isEdit.value && props.context.value.resource)\n// e.g. extract \"municipalityKey\" (second to last) out of resourceName\nconst keyFromResourceName = computed(() => {\n if (resourceNameWhenEditing.value) {\n return resourceNameWhenEditing.value.split('/')[resourceNameWhenEditing.value.split('/').length - 2]\n }\n return ''\n})\nconst spatialVocabName = computed(() => {\n if (!keyFromResourceName.value) {\n return ''\n }\n\n const maybePrefix = props.context.attrs.identifier === 'politicalGeocodingURI'\n ? 'political-geocoding-'\n // todo: extend this for other vocabularies\n : ''\n\n // transform key from camelCase to kebab-case\n const vocabKey = keyFromResourceName.value.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()\n return `${maybePrefix}${vocabKey}`\n})\n\nconst translatedResourceName = computed(() => {\n // transform key 'districtKey' to 'District Key'\n const vocabKey = keyFromResourceName.value.replace(/([a-z])([A-Z])/g, '$1 $2').toLowerCase()\n // make first letters of each word uppercase\n const vocabKeyUpper = vocabKey.split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ')\n return t(`message.dataupload.datasets.conditional.${vocabKeyUpper}`)\n})\n\nconst { execute, state, isLoading } = useRequestUriName({\n voc: spatialVocabName,\n res: computed(() => props.context.value.resource),\n // property: 'dcatde:politicalGeocodingURI',\n property: computed(() => props.context.attrs.identifier === 'politicalGeocodingURI' ? 'dcatde:politicalGeocodingURI' : 'dct:spatial'), \n locale,\n})\n\nconst restoredValueFromEditMode = computed(() => {\n if (isEdit.value && !isLoading.value && resourceNameWhenEditing.value && state.value) {\n return `${translatedResourceName.value}: ${state.value} (${resourceNameWhenEditing.value.split('/').pop()})`\n }\n\n return ''\n})\n\nconst once = ref(false)\nwatchEffect(() => {\n if (once.value) return;\n\n if (!!resourceNameWhenEditing.value) {\n once.value = true\n execute()\n }\n}, { immediate: true })\n\nwhenever(restoredValueFromEditMode, () => {\n const v = { name: restoredValueFromEditMode.value, resource: resourceNameWhenEditing.value }\n props.context.node.input(v)\n})\n\n// If true, then:\n// - hides the select input for manual and vocabulary\n// - pre-selects the vocabulary option\n// When using formkit schema, enable this option by setting vocabularyOnly to true\n// {\n// $formkit: 'spatialinput',\n// name: 'dcatde:politicalGeocodingURI',\n// identifier: 'politicalGeocodingURI',\n// vocabularyOnly: true,\n// }\nconst vocabularyOnly = computed(() => !!props.context?.attrs?.vocabularyOnly)\n\nif (props.context.attrs.identifier === 'politicalGeocodingURI') {\n listOfVoc.value.push(\n { item: 'Municipality Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Municipality Key', 'Municipality Key') },\n { item: 'Regional Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Regional Key', 'Regional Key') },\n { item: 'Municipal Association Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Municipal Association Key', 'Municipal Association Key') },\n { item: 'District Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.District Key', 'District Key') },\n { item: 'Government District Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Government District Key', 'Government District Key') },\n { item: 'State Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.State Key', 'State Key') },\n )\n\n}\nif (props.context.attrs.identifier === 'spatial') {\n listOfVoc.value.push(\n { item: 'Country', active: false, placeholder: ted('message.dataupload.datasets.conditional.Country', 'Country') },\n { item: 'Place', active: false, placeholder: ted('message.dataupload.datasets.conditional.Place', 'Place') },\n { item: 'Continent', active: false, placeholder: ted('message.dataupload.datasets.conditional.Continent', 'Continent') },\n )\n}\n\nwatch(inputText, async () => {\n getAutocompleteSuggestions();\n})\nwatch(voc, async (newValue, oldValue) => {\n if (newValue === oldValue) { return }\n voc.value = voc.value.toLowerCase();\n})\nwatch(manURL, async () => {\n props.context.node.input({ 'name': manURL, 'resource': manURL })\n})\nonMounted(async () => {\n matches = [{ name: ted('message.dataupload.info.searchVocabulary', '--- Type in anything for a live search of the vocabulary ---').value, resource: 'invalid' }]\n\n await nextTick()\n // DOM loaded\n if (props.context.value.name === undefined || props.context.value.name === \"\") {\n showTable.activeValue = false\n } else showTable.activeValue = true\n // console.log(showTable.activeValue);\n\n if (vocabularyOnly.value) {\n activeInput('showTable'); vocSearch.value = true; if (man.value) { man.value = false }\n }\n\n});\n\nfunction closeAll() {\n listOfVoc.value.forEach(element => {\n element.active = false;\n });\n}\nfunction removeProperty(e) {\n // props.context.value = {}\n showTable.activeValue = false\n props.context.node.input({})\n}\nfunction saveToLocal(el) {\n\n let pathToLocalStorage = JSON.parse(localStorage.getItem(`dpi_${route.params.property}`));\n let arr\n if (props.context.attrs.identifier === 'politicalGeocodingURI') {\n arr = pathToLocalStorage.Advised['dcatde:politicalGeocodingURI'];\n }\n else arr = pathToLocalStorage.Advised['dct:spatial'];\n\n arr.forEach((element, index) => {\n if (Object.keys(element).length === 0) {\n arr.splice(index, 1)\n }\n })\n arr.push(props.context.node._value)\n if (props.context.attrs.identifier === 'politicalGeocodingURI') {\n pathToLocalStorage.Advised['dcatde:politicalGeocodingURI'] = arr\n }\n else pathToLocalStorage.Advised['dct:spatial'] = arr\n\n localStorage.setItem(`dpi_${route.params.property}`, JSON.stringify(pathToLocalStorage))\n}\nconst getAutocompleteSuggestions = async () => {\n\n let vocCache = voc.value?.toLowerCase()\n\n if (props.context.attrs.identifier === 'politicalGeocodingURI') {\n\n vocCache = 'political-geocoding-' + vocCache.toLowerCase().replaceAll(\" \", '-')\n\n try {\n let text = inputText.value;\n await requestAutocompleteSuggestions({ voc: vocCache, text: text, base: instance.api.baseUrl }).then((response) => {\n const results = response.data.result.results.map((r) => ({\n name: getTranslationFor(r.alt_label, locale.value, []) + \" (\" + r.id + \")\",\n resource: r.resource,\n }));\n matches = results;\n });\n } catch (error) {\n }\n }\n else {\n try {\n let text = inputText.value;\n await requestAutocompleteSuggestions({ voc: vocCache, text: text, 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 matches = results;\n });\n } catch (error) {\n }\n }\n\n}\n\nvar showTable = reactive({\n first: false,\n second: false,\n third: false,\n activeValue: false\n})\n\nconst I1 = ref(null);\nconst I2 = ref(null);\nconst I3 = ref(null);\n\nonClickOutside(I1, event => showTable.first = false)\nonClickOutside(I2, event => showTable.second = false)\nonClickOutside(I3, event => showTable.third = false)\nfunction activeInput(e) {\n\n // console.log('in', showTable);\n if (e === \"showTable\") showTable.first = !showTable.first;\n if (e === \"showVocTable\") showTable.second = !showTable.second;\n if (e === \"showVocEntries\") {\n if (showTable.third === true) {\n }\n else showTable.third = !showTable.third;\n }\n}\nfunction manURLInput(e) {\n props.context.node.input({ 'name': e.target.value, 'resource': e.target.value })\n}\n\nfunction handleSpatielListClick(el) {\n props.context.node.input(el);\n inputText.value = el.name;\n activeInput('showVocEntries');\n showTable.third = false;\n saveToLocal(el)\n}\n\nfunction submitType() {\n activeInput('showVocTable');\n\n}\n// console.log(voc);\n</script>\n\n<template>\n <div class=\"d-flex flex-column w-100 spatialWrap\">\n <div class=\"d-flex formkit-inner mx-3 mb-3\" v-if=\"!props.context.attrs.multiple && showTable.activeValue\">\n <!-- <div class=\"infoI\">\n <div class=\"tooltipFormkit\">{{ props.context.attrs.info }}</div>\n </div> -->\n <a class=\"autocompleteInputSingleValue \">{{ restoredValueFromEditMode }}</a>\n <div class=\"removeX\" @click=\"removeProperty\"></div>\n </div>\n <div v-else>\n <div class=\" w-100 d-flex\">\n <div v-if=\"!vocabularyOnly\" class=\"d-flex position-relative m-3 w-100\">\n <label class=\"w-100\"> {{ $t('message.dataupload.info.preferredInput') }}\n <input id=\"I1\" type=\"text\" class=\"selectInputField formkit-inner\" readonly=\"readonly\"\n :placeholder=\"$t('message.dataupload.info.preferredInput')\"\n @click=\"activeInput('showTable')\" />\n </label>\n\n <ul ref=\"I1\" v-show=\"showTable.first\" class=\"spatialListUpload\">\n <li @click=\"activeInput('showTable'); man = true; if (vocSearch) { vocSearch = false; };\"\n class=\"p-2 border-b border-gray-200 choosableItemsAC\">\n {{ $t('message.dataupload.datasets.conditional.manually') }}\n </li>\n <li @click=\"activeInput('showTable'); vocSearch = true; if (man) { man = false }\"\n class=\"p-2 border-b border-gray-200 choosableItemsAC\">\n {{ $t('message.dataupload.datasets.conditional.vocabulary') }}\n </li>\n </ul>\n </div>\n <div v-if=\"man\" class=\"d-flex position-relative m-3 w-100\">\n <label class=\"w-100\">\n <!-- todo: I borrowed this from another input. Maybe refactor? -->\n {{ $te('message.dataupload.datasets.isReferencedByUrl.placeholder') ? $t('message.dataupload.datasets.isReferencedByUrl.placeholder') : 'Provide an URL' }}\n <input type=\"URL\" class=\"selectInputField formkit-inner\" placeholder=\"URL\"\n @input=\"manURLInput($event)\">\n </label>\n </div>\n <div v-if=\"vocSearch\" class=\"d-flex position-relative m-3 w-100\">\n <!-- todo: I borrowed this from another input. Maybe refactor? -->\n <label class=\"w-100\"> {{ $te('message.dataupload.datasets.contributorType.placeholder') ? $t('message.dataupload.datasets.contributorType.placeholder') : 'Choose type of vocabulary' }} \n <input id=\"I2\" type=\"text\" class=\"selectInputField formkit-inner\" readonly=\"readonly\" v-model=\"typeText\"\n :placeholder=\"$te('message.dataupload.datasets.accessRights.placeholder') ? $t('message.dataupload.datasets.accessRights.placeholder') : 'Choose type of vocabulary'\" @click=\"activeInput('showVocTable');\">\n </label>\n <ul ref=\"I2\" v-if=\"showTable.second\" class=\"spatialListUpload\">\n <li v-for=\"el in listOfVoc\" :key=\"el\" class=\"p-2 border-b border-gray-200 choosableItemsAC\"\n @click=\" closeAll(); el.active = !el.active; activeInput('showVocTable'); inputText = ''; voc = el.item; typeText = el.placeholder\">\n {{ $t('message.dataupload.datasets.conditional.' + el.item) }}</li>\n </ul>\n </div>\n </div>\n <div class=\"m-3\" v-if=\"vocSearch\">\n <div v-for=\"el in listOfVoc\" :key=\"el\" class=\"position-relative\">\n <label class=\"w-100\" v-if=\"el.active\">\n <!-- todo: I borrowed this from another input. Maybe refactor? -->\n <!-- {{ $te('message.dataupload.datasets.accessRights.placeholder') ? $t('message.dataupload.datasets.accessRights.placeholder') : 'Choose type of vocabulary' }} -->\n {{ el.placeholder ? el.placeholder : $t('message.dataupload.datasets.conditional.' + el.item) }}\n <input id=\"I3\" type=\"text\"\n v-model=\"inputText\" class=\"selectInputField formkit-inner\" :placeholder=\"$te('message.dataupload.datasets.accessRights.placeholder') ? $t('message.dataupload.datasets.accessRights.placeholder') : 'Choose type of vocabulary'\"\n @click=\"activeInput('showVocEntries'); inputText = ''\"\n >\n </label>\n <ul ref=\"I3\" v-if=\"showTable.third && el.active\" class=\"spatialListUpload\">\n <li v-for=\"el in matches\" :key=\"el\" class=\"p-2 border-b border-gray-200 choosableItemsAC\"\n @click=\"handleSpatielListClick(el)\">\n {{ el.name }}</li>\n </ul>\n </div>\n\n </div>\n\n </div>\n </div>\n</template>\n\n<script>\n\n</script>\n\n<style lang=\"scss\" scoped>\n.spatialWrap label {\n font-family: var(--fk-font-family-label);\n font-size: var(--fk-font-size-label);\n font-weight: var(--fk-font-weight-label);\n line-height: var(--fk-line-height-label);\n}\n\n.spatialWrap {\n .spatialListUpload {\n width: 100%;\n left: 0;\n top: 78px;\n }\n}\n</style>\n"],"names":["instance","getCurrentInstance","route","useRoute","dpiContext","useDpiContext","props","__props","requestAutocompleteSuggestions","useAutocomplete","listOfVoc","ref","typeText","inputText","voc","matches","manURL","useStore","t","locale","useI18n","ted","useTed","man","vocSearch","isEdit","computed","_a","resourceNameWhenEditing","keyFromResourceName","spatialVocabName","maybePrefix","vocabKey","translatedResourceName","vocabKeyUpper","word","execute","state","isLoading","useRequestUriName","restoredValueFromEditMode","once","watchEffect","whenever","v","vocabularyOnly","_b","watch","getAutocompleteSuggestions","newValue","oldValue","onMounted","nextTick","showTable","activeInput","closeAll","element","removeProperty","e","saveToLocal","el","pathToLocalStorage","arr","index","vocCache","text","response","r","getTranslationFor","reactive","I1","I2","I3","onClickOutside","event","manURLInput","handleSpatielListClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,QAAIA,IAAWC,GAAkB,EAAG,WAAW,IAAI,OAAO,iBAAiB,MACvEC,IAAQC,GAAQ;AACpB,UAAMC,IAAaC,GAAa,GAE1BC,IAAQC,GAIR,EAAE,gCAAAC,EAAgC,IAAGC,GAAgB;AAG3D,QAAIC,IAAYC,EAAI,EAAE;AACtB,UAAMC,IAAWD,EAAI,EAAE;AACvB,QAAIE,IAAYF,EAAI,EAAE,GAClBG,IAAMH,EAAI,EAAE,GACZI,IAAUJ,EAAI,EAAE,GAChBK,IAASL,EAAI,EAAE;AACL,IAAAM,GAAU;AACxB,UAAM,EAAE,GAAAC,GAAG,QAAAC,EAAQ,IAAGC,GAAQ,EAAE,eAAe,IAAM,UAAU,SAAQ,CAAE,GACnEC,IAAMC,GAAM,GAEZC,IAAMZ,EAAI,EAAK,GACfa,IAAYb,EAAI,EAAK,GAErBc,IAASC,EAAS;;AAAM,cAAC,GAACC,IAAAvB,EAAW,MAAM,SAAjB,QAAAuB,EAAuB;AAAA,KAAO,GACxDC,IAA0BF,EAAS,MAAM,CAAC,CAACD,EAAO,SAASnB,EAAM,QAAQ,MAAM,QAAQ,GAEvFuB,IAAsBH,EAAS,MAC7BE,EAAwB,QACjBA,EAAwB,MAAM,MAAM,GAAG,EAAEA,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