@piveau/piveau-hub-ui-modules 4.4.29 → 4.5.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.
Files changed (69) hide show
  1. package/dist/configurations/configureComponents.mjs +20 -18
  2. package/dist/configurations/configureComponents.mjs.map +1 -1
  3. package/dist/data-provider-interface/DataProviderInterface.vue.d.ts +59 -20
  4. package/dist/data-provider-interface/DataProviderInterface.vue.mjs.map +1 -1
  5. package/dist/data-provider-interface/DataProviderInterface.vue2.mjs +36 -25
  6. package/dist/data-provider-interface/DataProviderInterface.vue2.mjs.map +1 -1
  7. package/dist/data-provider-interface/components/AutocompleteInput.vue.mjs +92 -89
  8. package/dist/data-provider-interface/components/AutocompleteInput.vue.mjs.map +1 -1
  9. package/dist/data-provider-interface/components/ConditionalInput.vue.mjs +104 -107
  10. package/dist/data-provider-interface/components/ConditionalInput.vue.mjs.map +1 -1
  11. package/dist/data-provider-interface/components/SpatialInput.vue.mjs +190 -148
  12. package/dist/data-provider-interface/components/SpatialInput.vue.mjs.map +1 -1
  13. package/dist/data-provider-interface/components/UniqueIdentifierInput.vue.mjs +19 -8
  14. package/dist/data-provider-interface/components/UniqueIdentifierInput.vue.mjs.map +1 -1
  15. package/dist/data-provider-interface/composables/aucotomplete.d.ts +27 -0
  16. package/dist/data-provider-interface/composables/aucotomplete.mjs +52 -0
  17. package/dist/data-provider-interface/composables/aucotomplete.mjs.map +1 -0
  18. package/dist/data-provider-interface/composables/index.d.ts +4 -0
  19. package/dist/data-provider-interface/composables/useDpiContext.mjs +7 -9
  20. package/dist/data-provider-interface/composables/useDpiContext.mjs.map +1 -1
  21. package/dist/data-provider-interface/composables/useRequestUriName.d.ts +18 -0
  22. package/dist/data-provider-interface/composables/useRequestUriName.mjs +59 -0
  23. package/dist/data-provider-interface/composables/useRequestUriName.mjs.map +1 -0
  24. package/dist/data-provider-interface/config/dcatapde/vocab-prefixes.mjs +1 -1
  25. package/dist/data-provider-interface/config/dcatapde/vocab-prefixes.mjs.map +1 -1
  26. package/dist/data-provider-interface/index.mjs +10 -6
  27. package/dist/data-provider-interface/index.mjs.map +1 -1
  28. package/dist/data-provider-interface/store/dpiStore.d.ts +0 -26
  29. package/dist/data-provider-interface/store/dpiStore.mjs +12 -14
  30. package/dist/data-provider-interface/store/dpiStore.mjs.map +1 -1
  31. package/dist/data-provider-interface/views/InputPage.vue.d.ts +49 -20
  32. package/dist/data-provider-interface/views/InputPage.vue.mjs +125 -107
  33. package/dist/data-provider-interface/views/InputPage.vue.mjs.map +1 -1
  34. package/dist/data-provider-interface/views/OverviewPage/CatalogueOverview.vue.d.ts +16 -6
  35. package/dist/data-provider-interface/views/OverviewPage/DatasetOverview.vue.d.ts +32 -14
  36. package/dist/data-provider-interface/views/OverviewPage/DatasetOverview.vue.mjs +27 -31
  37. package/dist/data-provider-interface/views/OverviewPage/DatasetOverview.vue.mjs.map +1 -1
  38. package/dist/data-provider-interface/views/OverviewPage/DistributionOverview.vue.d.ts +16 -6
  39. package/dist/data-provider-interface/views/OverviewPage/Properties/SpecialProp.vue.d.ts +8 -3
  40. package/dist/data-provider-interface/views/OverviewPage/Properties/URIProp.vue.d.ts +8 -3
  41. package/dist/data-provider-interface/views/OverviewPage/Properties/URIProp.vue.mjs +57 -47
  42. package/dist/data-provider-interface/views/OverviewPage/Properties/URIProp.vue.mjs.map +1 -1
  43. package/dist/data-provider-interface/views/OverviewPage/PropertyEntry.vue.d.ts +16 -6
  44. package/dist/data-provider-interface/views/OverviewPage.vue.d.ts +48 -20
  45. package/dist/datasetDetails/DatasetDetailsDataset.vue.mjs +50 -36
  46. package/dist/datasetDetails/DatasetDetailsDataset.vue.mjs.map +1 -1
  47. package/dist/datasetDetails/DatasetDetailsDataset.vue2.mjs +4 -4
  48. package/dist/datasetDetails/DatasetDetailsDataset.vue2.mjs.map +1 -1
  49. package/dist/datasetDetails/features/DatasetDetailsFeatures.vue.d.ts +3 -3
  50. package/dist/datasetDetails/features/DatasetDetailsFeatures.vue.mjs +3 -3
  51. package/dist/datasetDetails/features/DatasetDetailsFeatures.vue.mjs.map +1 -1
  52. package/dist/datasetDetails/features/DatasetDetailsIsUsedBy.vue.mjs +18 -18
  53. package/dist/datasetDetails/properties/DatasetDetailsProperties.vue.mjs +58 -50
  54. package/dist/datasetDetails/properties/DatasetDetailsProperties.vue.mjs.map +1 -1
  55. package/dist/external/@vueuse/core/index +3 -2
  56. package/dist/external/@vueuse/shared/index +86 -72
  57. package/dist/external/@vueuse/shared/index.map +1 -1
  58. package/dist/form/Repeatable.vue.d.ts +11 -10
  59. package/dist/form/Repeatable.vue.mjs +5 -62
  60. package/dist/form/Repeatable.vue.mjs.map +1 -1
  61. package/dist/form/Repeatable.vue2.mjs +72 -2
  62. package/dist/form/Repeatable.vue2.mjs.map +1 -1
  63. package/dist/form/Repeatable.vue3.mjs +5 -0
  64. package/dist/form/Repeatable.vue3.mjs.map +1 -0
  65. package/dist/piveau-hub-ui-modules.css +1 -1
  66. package/package.json +1 -1
  67. package/dist/data-provider-interface/store/modules/autocompleteStore.d.ts +0 -27
  68. package/dist/data-provider-interface/store/modules/autocompleteStore.mjs +0 -54
  69. package/dist/data-provider-interface/store/modules/autocompleteStore.mjs.map +0 -1
@@ -1,250 +1,292 @@
1
- import { getCurrentInstance as q, ref as v, computed as J, watch as R, onMounted as W, nextTick as X, reactive as z, openBlock as l, createElementBlock as i, unref as m, createElementVNode as d, toDisplayString as f, createTextVNode as c, withDirectives as M, vShow as H, createCommentVNode as g, Fragment as $, renderList as S, isRef as C, vModelText as Q } from "vue";
2
- import { useStore as Y } from "vuex";
3
- import { getTranslationFor as O } from "../../utils/helpers.mjs";
4
- import { onClickOutside as T } from "../../external/@vueuse/core/index";
5
- import { useRoute as Z } from "vue-router";
6
- import { useI18n as ee } from "vue-i18n";
7
- import { useTed as te } from "../../composables/useTed.mjs";
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";
11
+ import "@formkit/core";
12
+ import "merge-anything";
13
+ import "../../configurations/config-schema/apiSchema.mjs";
14
+ import "../../configurations/config-schema/authenticationSchema.mjs";
15
+ import "../../configurations/config-schema/contentSchema.mjs";
16
+ import "../../configurations/config-schema/routingSchema.mjs";
17
+ import "../../configurations/config-schema/metadataSchema.mjs";
18
+ import "../../configurations/config-schema/languagesSchema.mjs";
19
+ import "../../configurations/config-schema/themesSchema.mjs";
20
+ import "../../configurations/config-schema/trackerSchema.mjs";
21
+ import "../../configurations/config-schema/configSchema.mjs";
8
22
  import "./SpatialInput.vue2.mjs";
9
- import ae from "../../_virtual/_plugin-vue_export-helper.mjs";
10
- const se = { class: "d-flex flex-column w-100 spatialWrap" }, oe = {
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 = {
11
26
  key: 0,
12
27
  class: "d-flex formkit-inner mx-3 mb-3"
13
- }, le = { class: "autocompleteInputSingleValue" }, ie = { key: 1 }, ne = { class: "w-100 d-flex" }, re = {
28
+ }, we = { class: "autocompleteInputSingleValue" }, $e = { key: 1 }, Re = { class: "w-100 d-flex" }, Ue = {
14
29
  key: 0,
15
30
  class: "d-flex position-relative m-3 w-100"
16
- }, de = { class: "w-100" }, ce = ["placeholder"], ue = {
31
+ }, Ke = { class: "w-100" }, Te = ["placeholder"], Ve = {
17
32
  key: 1,
18
33
  class: "d-flex position-relative m-3 w-100"
19
- }, pe = { class: "w-100" }, ve = {
34
+ }, Ae = { class: "w-100" }, Le = {
20
35
  key: 2,
21
36
  class: "d-flex position-relative m-3 w-100"
22
- }, me = { class: "w-100" }, fe = ["placeholder"], ye = ["onClick"], he = {
37
+ }, Se = { class: "w-100" }, Ge = ["placeholder"], _e = ["onClick"], Ee = {
23
38
  key: 0,
24
39
  class: "m-3"
25
- }, ge = {
40
+ }, Ne = {
26
41
  key: 0,
27
42
  class: "w-100"
28
- }, be = ["placeholder"], Ie = ["onClick"], ke = {
43
+ }, De = ["placeholder"], Me = ["onClick"], Fe = {
29
44
  __name: "SpatialInput",
30
45
  props: {
31
46
  context: Object
32
47
  },
33
- setup(E) {
34
- let U = q().appContext.app.config.globalProperties.$env, K = Z();
35
- const n = E;
36
- let k = v([]), o = v({}), h = v({}), w = v({}), x = v({});
37
- const V = Y(), { t: Ce, locale: A } = ee(), u = te(), b = v(!1), I = v(!1), L = J(() => {
38
- var t, e;
39
- return !!((e = (t = n.context) == null ? void 0 : t.attrs) != null && e.vocabularyOnly);
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)
58
+ 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,
66
+ res: v(() => o.context.value.resource),
67
+ // property: 'dcatde:politicalGeocodingURI',
68
+ 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);
40
76
  });
41
- n.context.attrs.identifier === "politicalGeocodingURI" && k.value.push(
42
- { item: "Municipality Key", active: !1, placeholder: u("message.dataupload.datasets.conditional.Municipality Key", "Municipality Key") },
43
- { item: "Regional Key", active: !1, placeholder: u("message.dataupload.datasets.conditional.Regional Key", "Regional Key") },
44
- { item: "Municipal Association Key", active: !1, placeholder: u("message.dataupload.datasets.conditional.Municipal Association Key", "Municipal Association Key") },
45
- { item: "District Key", active: !1, placeholder: u("message.dataupload.datasets.conditional.District Key", "District Key") },
46
- { item: "Government District Key", active: !1, placeholder: u("message.dataupload.datasets.conditional.Government District Key", "Government District Key") },
47
- { item: "State Key", active: !1, placeholder: u("message.dataupload.datasets.conditional.State Key", "State Key") }
48
- ), n.context.attrs.identifier === "spatial" && k.value.push(
49
- { item: "Country", active: !1, placeholder: u("message.dataupload.datasets.conditional.Country", "Country") },
50
- { item: "Place", active: !1, placeholder: u("message.dataupload.datasets.conditional.Place", "Place") },
51
- { item: "Continent", active: !1, placeholder: u("message.dataupload.datasets.conditional.Continent", "Continent") }
52
- ), R(o, async () => {
53
- B();
54
- }), R(h, async () => {
55
- h.value = h.value.toLowerCase();
56
- }), R(x, async () => {
57
- n.context.node.input({ name: x, resource: x });
58
- }), W(async () => {
59
- w = [{ name: u("message.dataupload.info.searchVocabulary", "--- Type in anything for a live search of the vocabulary ---").value, resource: "invalid" }], await X(), n.context.value.name === void 0 || n.context.value.name === "" ? s.activeValue = !1 : s.activeValue = !0, L.value && (y("showTable"), I.value = !0, b.value && (b.value = !1));
77
+ const O = v(() => {
78
+ var e, t;
79
+ return !!((t = (e = o.context) == null ? void 0 : e.attrs) != null && t.vocabularyOnly);
60
80
  });
61
- function F() {
62
- k.value.forEach((t) => {
63
- t.active = !1;
81
+ o.context.attrs.identifier === "politicalGeocodingURI" && x.value.push(
82
+ { item: "Municipality Key", active: !1, placeholder: p("message.dataupload.datasets.conditional.Municipality Key", "Municipality Key") },
83
+ { item: "Regional Key", active: !1, placeholder: p("message.dataupload.datasets.conditional.Regional Key", "Regional Key") },
84
+ { item: "Municipal Association Key", active: !1, placeholder: p("message.dataupload.datasets.conditional.Municipal Association Key", "Municipal Association Key") },
85
+ { item: "District Key", active: !1, placeholder: p("message.dataupload.datasets.conditional.District Key", "District Key") },
86
+ { item: "Government District Key", active: !1, placeholder: p("message.dataupload.datasets.conditional.Government District Key", "Government District Key") },
87
+ { item: "State Key", active: !1, placeholder: p("message.dataupload.datasets.conditional.State Key", "State Key") }
88
+ ), o.context.attrs.identifier === "spatial" && x.value.push(
89
+ { item: "Country", active: !1, placeholder: p("message.dataupload.datasets.conditional.Country", "Country") },
90
+ { item: "Place", active: !1, placeholder: p("message.dataupload.datasets.conditional.Place", "Place") },
91
+ { 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));
100
+ });
101
+ function ee() {
102
+ x.value.forEach((e) => {
103
+ e.active = !1;
64
104
  });
65
105
  }
66
- function P(t) {
67
- s.activeValue = !1, n.context.node.input({});
106
+ function te(e) {
107
+ s.activeValue = !1, o.context.node.input({});
68
108
  }
69
- function N(t) {
70
- let e = JSON.parse(localStorage.getItem(`dpi_${K.params.property}`)), a;
71
- n.context.attrs.identifier === "politicalGeocodingURI" ? a = e.Advised["dcatde:politicalGeocodingURI"] : a = e.Advised["dct:spatial"], a.forEach((r, p) => {
72
- Object.keys(r).length === 0 && a.splice(p, 1);
73
- }), a.push(n.context.node._value), n.context.attrs.identifier === "politicalGeocodingURI" ? e.Advised["dcatde:politicalGeocodingURI"] = a : e.Advised["dct:spatial"] = a, localStorage.setItem(`dpi_${K.params.property}`, JSON.stringify(e));
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, $) => {
112
+ 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));
74
114
  }
75
- const B = async () => {
76
- let t = h.value;
77
- if (n.context.attrs.identifier === "politicalGeocodingURI") {
78
- t = "political-geocoding-" + t.toLowerCase().replaceAll(" ", "-");
115
+ const oe = async () => {
116
+ var t;
117
+ let e = (t = g.value) == null ? void 0 : t.toLowerCase();
118
+ if (o.context.attrs.identifier === "politicalGeocodingURI") {
119
+ e = "political-geocoding-" + e.toLowerCase().replaceAll(" ", "-");
79
120
  try {
80
- let e = o.value;
81
- await V.dispatch("dpiStore/requestAutocompleteSuggestions", { voc: t, text: e, base: U.api.baseUrl }).then((a) => {
82
- w = a.data.result.results.map((p) => ({
83
- name: O(p.alt_label, A.value, []) + " (" + p.id + ")",
84
- resource: p.resource
121
+ let a = n.value;
122
+ await N({ voc: e, text: a, base: _.api.baseUrl }).then((r) => {
123
+ w = r.data.result.results.map((b) => ({
124
+ name: z(b.alt_label, K.value, []) + " (" + b.id + ")",
125
+ resource: b.resource
85
126
  }));
86
127
  });
87
128
  } catch {
88
129
  }
89
130
  } else
90
131
  try {
91
- let e = o.value;
92
- await V.dispatch("dpiStore/requestAutocompleteSuggestions", { voc: t, text: e, base: U.api.baseUrl }).then((a) => {
93
- w = a.data.result.results.map((p) => ({
94
- name: O(p.pref_label, A.value, []) + " (" + p.id + ")",
95
- resource: p.resource
132
+ let a = n.value;
133
+ await N({ voc: e, text: a, base: _.api.baseUrl }).then((r) => {
134
+ w = r.data.result.results.map((b) => ({
135
+ name: z(b.pref_label, K.value, []) + " (" + b.id + ")",
136
+ resource: b.resource
96
137
  }));
97
138
  });
98
139
  } catch {
99
140
  }
100
141
  };
101
- var s = z({
142
+ var s = de({
102
143
  first: !1,
103
144
  second: !1,
104
145
  third: !1,
105
146
  activeValue: !1
106
147
  });
107
- const _ = v(null), G = v(null), D = v(null);
108
- T(_, (t) => s.first = !1), T(G, (t) => s.second = !1), T(D, (t) => s.third = !1);
109
- function y(t) {
110
- t === "showTable" && (s.first = !s.first), t === "showVocTable" && (s.second = !s.second), t === "showVocEntries" && (s.third === !0 || (s.third = !s.third));
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));
152
+ }
153
+ function se(e) {
154
+ o.context.node.input({ name: e.target.value, resource: e.target.value });
111
155
  }
112
- function j(t) {
113
- n.context.node.input({ name: t.target.value, resource: t.target.value });
156
+ function le(e) {
157
+ o.context.node.input(e), n.value = e.name, f("showVocEntries"), s.third = !1, ae();
114
158
  }
115
- return (t, e) => (l(), i("div", se, [
116
- !n.context.attrs.multiple && m(s).activeValue ? (l(), i("div", oe, [
117
- d("a", le, f(n.context.value.name), 1),
118
- e[7] || (e[7] = c()),
119
- d("div", {
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()),
163
+ c("div", {
120
164
  class: "removeX",
121
- onClick: P
165
+ onClick: te
122
166
  })
123
- ])) : (l(), i("div", ie, [
124
- d("div", ne, [
125
- L.value ? g("", !0) : (l(), i("div", re, [
126
- d("label", de, [
127
- c(f(t.$t("message.dataupload.info.preferredInput")) + " ", 1),
128
- d("input", {
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),
172
+ c("input", {
129
173
  id: "I1",
130
174
  type: "text",
131
175
  class: "selectInputField formkit-inner",
132
176
  readonly: "readonly",
133
- placeholder: t.$t("message.dataupload.info.preferredInput"),
134
- onClick: e[0] || (e[0] = (a) => y("showTable"))
135
- }, null, 8, ce)
177
+ placeholder: e.$t("message.dataupload.info.preferredInput"),
178
+ onClick: t[0] || (t[0] = (a) => f("showTable"))
179
+ }, null, 8, Te)
136
180
  ]),
137
- e[9] || (e[9] = c()),
138
- M(d("ul", {
181
+ t[9] || (t[9] = d()),
182
+ q(c("ul", {
139
183
  ref_key: "I1",
140
- ref: _,
184
+ ref: P,
141
185
  class: "spatialListUpload"
142
186
  }, [
143
- d("li", {
144
- onClick: e[1] || (e[1] = (a) => {
145
- y("showTable"), b.value = !0, I.value && (I.value = !1);
187
+ c("li", {
188
+ onClick: t[1] || (t[1] = (a) => {
189
+ f("showTable"), k.value = !0, C.value && (C.value = !1);
146
190
  }),
147
191
  class: "p-2 border-b border-gray-200 choosableItemsAC"
148
- }, f(t.$t("message.dataupload.datasets.conditional.manually")), 1),
149
- e[8] || (e[8] = c()),
150
- d("li", {
151
- onClick: e[2] || (e[2] = (a) => {
152
- y("showTable"), I.value = !0, b.value && (b.value = !1);
192
+ }, m(e.$t("message.dataupload.datasets.conditional.manually")), 1),
193
+ t[8] || (t[8] = d()),
194
+ c("li", {
195
+ onClick: t[2] || (t[2] = (a) => {
196
+ f("showTable"), C.value = !0, k.value && (k.value = !1);
153
197
  }),
154
198
  class: "p-2 border-b border-gray-200 choosableItemsAC"
155
- }, f(t.$t("message.dataupload.datasets.conditional.vocabulary")), 1)
199
+ }, m(e.$t("message.dataupload.datasets.conditional.vocabulary")), 1)
156
200
  ], 512), [
157
- [H, m(s).first]
201
+ [ue, y(s).first]
158
202
  ])
159
203
  ])),
160
- e[11] || (e[11] = c()),
161
- b.value ? (l(), i("div", ue, [
162
- d("label", pe, [
163
- c(f(t.$te("message.dataupload.datasets.isReferencedByUrl.placeholder") ? t.$t("message.dataupload.datasets.isReferencedByUrl.placeholder") : "Provide an URL") + " ", 1),
164
- d("input", {
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),
208
+ c("input", {
165
209
  type: "URL",
166
210
  class: "selectInputField formkit-inner",
167
211
  placeholder: "URL",
168
- onInput: e[3] || (e[3] = (a) => j(a))
212
+ onInput: t[3] || (t[3] = (a) => se(a))
169
213
  }, null, 32)
170
214
  ])
171
- ])) : g("", !0),
172
- e[12] || (e[12] = c()),
173
- I.value ? (l(), i("div", ve, [
174
- d("label", me, [
175
- c(f(t.$te("message.dataupload.datasets.contributorType.placeholder") ? t.$t("message.dataupload.datasets.contributorType.placeholder") : "Choose type of vocabulary") + " ", 1),
176
- d("input", {
215
+ ])) : 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", {
177
221
  id: "I2",
178
222
  type: "text",
179
223
  class: "selectInputField formkit-inner",
180
224
  readonly: "readonly",
181
- placeholder: t.$te("message.dataupload.datasets.accessRights.placeholder") ? t.$t("message.dataupload.datasets.accessRights.placeholder") : "Choose type of vocabulary",
182
- onClick: e[4] || (e[4] = (a) => {
183
- y("showVocTable");
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
+ f("showVocTable");
184
228
  })
185
- }, null, 8, fe)
229
+ }, null, 8, Ge)
186
230
  ]),
187
- e[10] || (e[10] = c()),
188
- m(s).second ? (l(), i("ul", {
231
+ t[10] || (t[10] = d()),
232
+ y(s).second ? (l(), i("ul", {
189
233
  key: 0,
190
234
  ref_key: "I2",
191
- ref: G,
235
+ ref: B,
192
236
  class: "spatialListUpload"
193
237
  }, [
194
- (l(!0), i($, null, S(m(k), (a) => (l(), i("li", {
238
+ (l(!0), i(L, null, S(y(x), (a) => (l(), i("li", {
195
239
  key: a,
196
240
  class: "p-2 border-b border-gray-200 choosableItemsAC",
197
241
  onClick: (r) => {
198
- F(), a.active = !a.active, y("showVocTable"), C(o) ? o.value = "" : o = "", C(h) ? h.value = a.item : h = a.item;
242
+ ee(), a.active = !a.active, f("showVocTable"), R(n) ? n.value = "" : n = "", R(g) ? g.value = a.item : g = a.item;
199
243
  }
200
- }, f(t.$t("message.dataupload.datasets.conditional." + a.item)), 9, ye))), 128))
201
- ], 512)) : g("", !0)
202
- ])) : g("", !0)
244
+ }, m(e.$t("message.dataupload.datasets.conditional." + a.item)), 9, _e))), 128))
245
+ ], 512)) : I("", !0)
246
+ ])) : I("", !0)
203
247
  ]),
204
- e[14] || (e[14] = c()),
205
- I.value ? (l(), i("div", he, [
206
- (l(!0), i($, null, S(m(k), (a) => (l(), i("div", {
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", {
207
251
  key: a,
208
252
  class: "position-relative"
209
253
  }, [
210
- a.active ? (l(), i("label", ge, [
211
- c(f(t.$te("message.dataupload.datasets.accessRights.placeholder") ? t.$t("message.dataupload.datasets.accessRights.placeholder") : "Choose type of vocabulary") + " ", 1),
212
- M(d("input", {
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", {
213
257
  id: "I3",
214
258
  type: "text",
215
- "onUpdate:modelValue": e[5] || (e[5] = (r) => C(o) ? o.value = r : o = r),
259
+ "onUpdate:modelValue": t[5] || (t[5] = (r) => R(n) ? n.value = r : n = r),
216
260
  class: "selectInputField formkit-inner",
217
261
  placeholder: a.placeholder ?? "",
218
- onClick: e[6] || (e[6] = (r) => {
219
- y("showVocEntries"), C(o) ? o.value = "" : o = "";
262
+ onClick: t[6] || (t[6] = (r) => {
263
+ f("showVocEntries"), R(n) ? n.value = "" : n = "";
220
264
  })
221
- }, null, 8, be), [
222
- [Q, m(o)]
265
+ }, null, 8, De), [
266
+ [pe, y(n)]
223
267
  ])
224
- ])) : g("", !0),
225
- e[13] || (e[13] = c()),
226
- m(s).third && a.active ? (l(), i("ul", {
268
+ ])) : I("", !0),
269
+ t[13] || (t[13] = d()),
270
+ y(s).third && a.active ? (l(), i("ul", {
227
271
  key: 1,
228
272
  ref_for: !0,
229
273
  ref_key: "I3",
230
- ref: D,
274
+ ref: j,
231
275
  class: "spatialListUpload"
232
276
  }, [
233
- (l(!0), i($, null, S(m(w), (r) => (l(), i("li", {
277
+ (l(!0), i(L, null, S(y(w), (r) => (l(), i("li", {
234
278
  key: r,
235
279
  class: "p-2 border-b border-gray-200 choosableItemsAC",
236
- onClick: (p) => {
237
- n.context.node.input(r), C(o) ? o.value = r.name : o = r.name, y("showVocEntries"), m(s).third = !1, N();
238
- }
239
- }, f(r.name), 9, Ie))), 128))
240
- ], 512)) : g("", !0)
280
+ onClick: ($) => le(r)
281
+ }, m(r.name), 9, Me))), 128))
282
+ ], 512)) : I("", !0)
241
283
  ]))), 128))
242
- ])) : g("", !0)
284
+ ])) : I("", !0)
243
285
  ]))
244
286
  ]));
245
287
  }
246
- }, Ae = /* @__PURE__ */ ae(ke, [["__scopeId", "data-v-1595a9da"]]);
288
+ }, ut = /* @__PURE__ */ Ie(Fe, [["__scopeId", "data-v-6cab5868"]]);
247
289
  export {
248
- Ae as default
290
+ ut as default
249
291
  };
250
292
  //# 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 } from 'vue';\nimport { useStore } from 'vuex';\nimport { getTranslationFor } from \"../../utils/helpers\";\nimport { onClickOutside } from '@vueuse/core'\nimport { getCurrentInstance } from \"vue\";\nimport { useRoute } from 'vue-router';\nimport { useI18n } from 'vue-i18n';\nimport { useTed } from '../../composables/useTed';\n\nlet instance = getCurrentInstance().appContext.app.config.globalProperties.$env\nlet route = useRoute();\n\nconst props = defineProps({\n context: Object,\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();\nconst ted = useTed();\n\nconst man = ref(false)\nconst vocSearch = ref(false)\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 () => {\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\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 store.dispatch('dpiStore/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 store.dispatch('dpiStore/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// 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 \">{{ props.context.value.name }}</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=\"props.context.node.input(el); inputText = el.name; activeInput('showVocEntries'); showTable.third = false; saveToLocal(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","props","__props","listOfVoc","ref","inputText","voc","matches","manURL","store","useStore","t","locale","useI18n","ted","useTed","man","vocSearch","vocabularyOnly","computed","_b","_a","watch","getAutocompleteSuggestions","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,QAAIA,IAAWC,EAAkB,EAAG,WAAW,IAAI,OAAO,iBAAiB,MACvEC,IAAQC,EAAQ;AAEpB,UAAMC,IAAQC;AAId,QAAIC,IAAYC,EAAI,EAAE,GAClBC,IAAYD,EAAI,EAAE,GAClBE,IAAMF,EAAI,EAAE,GACZG,IAAUH,EAAI,EAAE,GAChBI,IAASJ,EAAI,EAAE;AACnB,UAAMK,IAAQC,EAAQ,GA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C,EAAI,IAAI,GACbwC,IAAKxC,EAAI,IAAI,GACbyC,IAAKzC,EAAI,IAAI;AAEnB,IAAA0C,EAAeH,GAAI,CAAAI,MAASrB,EAAU,QAAQ,EAAK,GACnDoB,EAAeF,GAAI,CAAAG,MAASrB,EAAU,SAAS,EAAK,GACpDoB,EAAeD,GAAI,CAAAE,MAASrB,EAAU,QAAQ,EAAK;AACnD,aAASC,EAAYI,GAAG;AAGpB,MAAIA,MAAM,gBAAaL,EAAU,QAAQ,CAACA,EAAU,QAChDK,MAAM,mBAAgBL,EAAU,SAAS,CAACA,EAAU,SACpDK,MAAM,qBACFL,EAAU,UAAU,OAEnBA,EAAU,QAAQ,CAACA,EAAU;AAAA,IAE1C;AACA,aAASsB,EAAYjB,GAAG;AACpB,MAAA9B,EAAM,QAAQ,KAAK,MAAM,EAAE,MAAQ8B,EAAE,OAAO,OAAO,UAAYA,EAAE,OAAO,MAAK,CAAE;AAAA,IACnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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,0BACnD,yBAEA,IAGEyB,IAAWH,EAAoB,MAAM,QAAQ,mBAAmB,OAAO,EAAE,YAAY;AAC3F,aAAO,GAAGE,CAAW,GAAGC,CAAQ;AAAA,IAClC,CAAC,GAEKC,IAAyBP,EAAS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