@piveau/piveau-hub-ui-modules 4.4.15 → 4.4.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/composables/useTed.d.ts +15 -0
- package/dist/composables/useTed.mjs +10 -0
- package/dist/composables/useTed.mjs.map +1 -0
- package/dist/data-provider-interface/DataProviderInterface.vue.d.ts +1 -1
- package/dist/data-provider-interface/components/SpatialInput.vue.mjs +105 -93
- package/dist/data-provider-interface/components/SpatialInput.vue.mjs.map +1 -1
- package/dist/data-provider-interface/views/InputPage.vue.d.ts +1 -1
- package/dist/data-provider-interface/views/OverviewPage/DatasetOverview.vue.d.ts +1 -1
- package/dist/data-provider-interface/views/OverviewPage/DatasetOverview.vue.mjs +7 -5
- package/dist/data-provider-interface/views/OverviewPage/DatasetOverview.vue.mjs.map +1 -1
- package/dist/data-provider-interface/views/OverviewPage.vue.d.ts +1 -1
- package/dist/piveau-hub-ui-modules.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A shorthand for `i18n.te(key) ? i18n.t(key) : def`.
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* const ted = useTed()
|
|
8
|
+
* const label = ted('my-key', 'My Label')
|
|
9
|
+
* // label is computed and returns the translation for 'my-key' if it exists, otherwise 'My Label'
|
|
10
|
+
*
|
|
11
|
+
* @param {MaybeRefOrGetter<string>} key The key to translate
|
|
12
|
+
* @param {MaybeRefOrGetter<string>} def The default value if the key does not exist
|
|
13
|
+
* @returns {ComputedRef<string>} The translated value
|
|
14
|
+
*/
|
|
15
|
+
export declare function useTed(): (key: MaybeRefOrGetter<string>, def: MaybeRefOrGetter<string>) => import('vue').ComputedRef<string>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { computed as u, toValue as t } from "vue";
|
|
2
|
+
import { useI18n as m } from "vue-i18n";
|
|
3
|
+
function s() {
|
|
4
|
+
const { t: e, te: r } = m();
|
|
5
|
+
return (o, n) => u(() => r(t(o)) ? e(t(o)) : t(n));
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
s as useTed
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=useTed.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useTed.mjs","sources":["../../lib/composables/useTed.ts"],"sourcesContent":["import { computed, MaybeRefOrGetter, toValue } from 'vue';\nimport { useI18n } from 'vue-i18n'\n\n/**\n * A shorthand for `i18n.te(key) ? i18n.t(key) : def`.\n *\n * @example\n * const ted = useTed()\n * const label = ted('my-key', 'My Label')\n * // label is computed and returns the translation for 'my-key' if it exists, otherwise 'My Label'\n *\n * @param {MaybeRefOrGetter<string>} key The key to translate\n * @param {MaybeRefOrGetter<string>} def The default value if the key does not exist\n * @returns {ComputedRef<string>} The translated value\n */\nexport function useTed() {\n const { t, te } = useI18n();\n\n const ted = (key: MaybeRefOrGetter<string>, def: MaybeRefOrGetter<string>) => computed(() => te(toValue(key)) ? t(toValue(key)) : toValue(def))\n\n return ted\n}"],"names":["useTed","t","te","useI18n","key","def","computed","toValue"],"mappings":";;AAeO,SAASA,IAAS;AACvB,QAAM,EAAE,GAAAC,GAAG,IAAAC,EAAG,IAAIC,EAAQ;AAInB,SAFK,CAACC,GAA+BC,MAAkCC,EAAS,MAAMJ,EAAGK,EAAQH,CAAG,CAAC,IAAIH,EAAEM,EAAQH,CAAG,CAAC,IAAIG,EAAQF,CAAG,CAAC;AAGhJ;"}
|
|
@@ -313,7 +313,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
313
313
|
getData: import('vuex').Computed;
|
|
314
314
|
}, {
|
|
315
315
|
checkIfPropertySet(data: any, property: any): any;
|
|
316
|
-
getDate(date: any):
|
|
316
|
+
getDate(date: any): string;
|
|
317
317
|
checkIfPropertyValueSet(data: any, property: any, value: any): any;
|
|
318
318
|
reqName(URI: any): Promise<any>;
|
|
319
319
|
requestFirstEntrySuggestions: import('vuex').ActionMethod;
|
|
@@ -1,76 +1,88 @@
|
|
|
1
|
-
import { getCurrentInstance as
|
|
2
|
-
import { useStore as
|
|
3
|
-
import { getTranslationFor as
|
|
1
|
+
import { getCurrentInstance as N, ref as v, watch as w, onMounted as B, nextTick as j, reactive as q, openBlock as l, createElementBlock as i, unref as m, createElementVNode as d, toDisplayString as f, createTextVNode as c, withDirectives as G, vShow as J, createCommentVNode as g, Fragment as S, renderList as R, isRef as I, vModelText as W } from "vue";
|
|
2
|
+
import { useStore as X } from "vuex";
|
|
3
|
+
import { getTranslationFor as D } from "../../utils/helpers.mjs";
|
|
4
4
|
import { onClickOutside as $ } from "../../external/@vueuse/core/index";
|
|
5
|
-
import { useRoute as
|
|
6
|
-
import { useI18n as
|
|
5
|
+
import { useRoute as z } from "vue-router";
|
|
6
|
+
import { useI18n as H } from "vue-i18n";
|
|
7
|
+
import { useTed as Q } from "../../composables/useTed.mjs";
|
|
7
8
|
import "./SpatialInput.vue2.mjs";
|
|
8
|
-
import
|
|
9
|
-
const
|
|
9
|
+
import Y from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
10
|
+
const Z = { class: "d-flex flex-column w-100 spatialWrap" }, ee = {
|
|
10
11
|
key: 0,
|
|
11
12
|
class: "d-flex formkit-inner mx-3 mb-3"
|
|
12
|
-
},
|
|
13
|
+
}, te = { class: "autocompleteInputSingleValue" }, ae = { key: 1 }, se = { class: "w-100 d-flex" }, oe = { class: "d-flex position-relative m-3 w-100" }, le = { class: "w-100" }, ie = ["placeholder"], ne = {
|
|
13
14
|
key: 0,
|
|
14
15
|
class: "d-flex position-relative m-3 w-100"
|
|
15
|
-
},
|
|
16
|
+
}, re = { class: "w-100" }, de = {
|
|
16
17
|
key: 1,
|
|
17
18
|
class: "d-flex position-relative m-3 w-100"
|
|
18
|
-
},
|
|
19
|
+
}, ce = { class: "w-100" }, ue = ["placeholder"], pe = ["onClick"], me = {
|
|
19
20
|
key: 0,
|
|
20
21
|
class: "m-3"
|
|
21
|
-
},
|
|
22
|
+
}, fe = {
|
|
22
23
|
key: 0,
|
|
23
24
|
class: "w-100"
|
|
24
|
-
},
|
|
25
|
+
}, ve = ["placeholder"], ye = ["onClick"], he = {
|
|
25
26
|
data() {
|
|
26
27
|
return {
|
|
27
28
|
man: !1,
|
|
28
29
|
vocSearch: !1
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
|
-
},
|
|
32
|
+
}, ge = /* @__PURE__ */ Object.assign(he, {
|
|
32
33
|
__name: "SpatialInput",
|
|
33
34
|
props: {
|
|
34
35
|
context: Object
|
|
35
36
|
},
|
|
36
|
-
setup(
|
|
37
|
-
let
|
|
38
|
-
const n =
|
|
39
|
-
let
|
|
40
|
-
const
|
|
41
|
-
n.context.attrs.identifier === "politicalGeocodingURI" &&
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
setup(M) {
|
|
38
|
+
let T = N().appContext.app.config.globalProperties.$env, U = z();
|
|
39
|
+
const n = M;
|
|
40
|
+
let b = v([]), o = v({}), y = v({}), k = v({}), C = v({});
|
|
41
|
+
const K = X(), { t: be, locale: V } = H(), u = Q();
|
|
42
|
+
n.context.attrs.identifier === "politicalGeocodingURI" && b.value.push(
|
|
43
|
+
{ item: "Municipality Key", active: !1, placeholder: u("message.dataupload.datasets.conditional.Municipality Key", "Municipality Key") },
|
|
44
|
+
{ item: "Regional Key", active: !1, placeholder: u("message.dataupload.datasets.conditional.Regional Key", "Regional Key") },
|
|
45
|
+
{ item: "Municipal Association Key", active: !1, placeholder: u("message.dataupload.datasets.conditional.Municipal Association Key", "Municipal Association Key") },
|
|
46
|
+
{ item: "District Key", active: !1, placeholder: u("message.dataupload.datasets.conditional.District Key", "District Key") },
|
|
47
|
+
{ item: "Government District Key", active: !1, placeholder: u("message.dataupload.datasets.conditional.Government District Key", "Government District Key") },
|
|
48
|
+
{ item: "State Key", active: !1, placeholder: u("message.dataupload.datasets.conditional.State Key", "State Key") }
|
|
49
|
+
), n.context.attrs.identifier === "spatial" && b.value.push(
|
|
50
|
+
{ item: "Country", active: !1, placeholder: u("message.dataupload.datasets.conditional.Country", "Country") },
|
|
51
|
+
{ item: "Place", active: !1, placeholder: u("message.dataupload.datasets.conditional.Place", "Place") },
|
|
52
|
+
{ item: "Continent", active: !1, placeholder: u("message.dataupload.datasets.conditional.Continent", "Continent") }
|
|
53
|
+
), w(o, async () => {
|
|
54
|
+
F();
|
|
55
|
+
}), w(y, async () => {
|
|
56
|
+
y.value = y.value.toLowerCase();
|
|
57
|
+
}), w(C, async () => {
|
|
58
|
+
n.context.node.input({ name: C, resource: C });
|
|
59
|
+
}), B(async () => {
|
|
60
|
+
k = [{ name: u("message.dataupload.info.searchVocabulary", "--- Type in anything for a live search of the vocabulary ---").value, resource: "invalid" }], await j(), n.context.value.name === void 0 || n.context.value.name === "" ? s.activeValue = !1 : s.activeValue = !0;
|
|
49
61
|
});
|
|
50
|
-
function
|
|
51
|
-
|
|
62
|
+
function E() {
|
|
63
|
+
b.value.forEach((t) => {
|
|
52
64
|
t.active = !1;
|
|
53
65
|
});
|
|
54
66
|
}
|
|
55
|
-
function
|
|
67
|
+
function O(t) {
|
|
56
68
|
s.activeValue = !1, n.context.node.input({});
|
|
57
69
|
}
|
|
58
|
-
function
|
|
70
|
+
function _(t) {
|
|
59
71
|
let e = JSON.parse(localStorage.getItem(`dpi_${U.params.property}`)), a;
|
|
60
|
-
n.context.attrs.identifier === "politicalGeocodingURI" ? a = e.Advised["dcatde:politicalGeocodingURI"] : a = e.Advised["dct:spatial"], a.forEach((r,
|
|
61
|
-
Object.keys(r).length === 0 && a.splice(
|
|
72
|
+
n.context.attrs.identifier === "politicalGeocodingURI" ? a = e.Advised["dcatde:politicalGeocodingURI"] : a = e.Advised["dct:spatial"], a.forEach((r, p) => {
|
|
73
|
+
Object.keys(r).length === 0 && a.splice(p, 1);
|
|
62
74
|
}), a.push(n.context.node._value), n.context.attrs.identifier === "politicalGeocodingURI" ? e.Advised["dcatde:politicalGeocodingURI"] = a : e.Advised["dct:spatial"] = a, localStorage.setItem(`dpi_${U.params.property}`, JSON.stringify(e));
|
|
63
75
|
}
|
|
64
|
-
const
|
|
65
|
-
let t =
|
|
76
|
+
const F = async () => {
|
|
77
|
+
let t = y.value;
|
|
66
78
|
if (n.context.attrs.identifier === "politicalGeocodingURI") {
|
|
67
79
|
t = "political-geocoding-" + t.toLowerCase().replaceAll(" ", "-");
|
|
68
80
|
try {
|
|
69
81
|
let e = o.value;
|
|
70
|
-
await
|
|
71
|
-
|
|
72
|
-
name:
|
|
73
|
-
resource:
|
|
82
|
+
await K.dispatch("dpiStore/requestAutocompleteSuggestions", { voc: t, text: e, base: T.api.baseUrl }).then((a) => {
|
|
83
|
+
k = a.data.result.results.map((p) => ({
|
|
84
|
+
name: D(p.alt_label, V.value, []) + " (" + p.id + ")",
|
|
85
|
+
resource: p.resource
|
|
74
86
|
}));
|
|
75
87
|
});
|
|
76
88
|
} catch {
|
|
@@ -78,41 +90,41 @@ const Q = { class: "d-flex flex-column w-100 spatialWrap" }, Y = {
|
|
|
78
90
|
} else
|
|
79
91
|
try {
|
|
80
92
|
let e = o.value;
|
|
81
|
-
await
|
|
82
|
-
|
|
83
|
-
name:
|
|
84
|
-
resource:
|
|
93
|
+
await K.dispatch("dpiStore/requestAutocompleteSuggestions", { voc: t, text: e, base: T.api.baseUrl }).then((a) => {
|
|
94
|
+
k = a.data.result.results.map((p) => ({
|
|
95
|
+
name: D(p.pref_label, V.value, []) + " (" + p.id + ")",
|
|
96
|
+
resource: p.resource
|
|
85
97
|
}));
|
|
86
98
|
});
|
|
87
99
|
} catch {
|
|
88
100
|
}
|
|
89
101
|
};
|
|
90
|
-
var s =
|
|
102
|
+
var s = q({
|
|
91
103
|
first: !1,
|
|
92
104
|
second: !1,
|
|
93
105
|
third: !1,
|
|
94
106
|
activeValue: !1
|
|
95
107
|
});
|
|
96
|
-
const x =
|
|
108
|
+
const x = v(null), A = v(null), L = v(null);
|
|
97
109
|
$(x, (t) => s.first = !1), $(A, (t) => s.second = !1), $(L, (t) => s.third = !1);
|
|
98
|
-
function
|
|
110
|
+
function h(t) {
|
|
99
111
|
t === "showTable" && (s.first = !s.first), t === "showVocTable" && (s.second = !s.second), t === "showVocEntries" && (s.third === !0 || (s.third = !s.third));
|
|
100
112
|
}
|
|
101
|
-
function
|
|
113
|
+
function P(t) {
|
|
102
114
|
n.context.node.input({ name: t.target.value, resource: t.target.value });
|
|
103
115
|
}
|
|
104
|
-
return (t, e) => (l(), i("div",
|
|
105
|
-
!n.context.attrs.multiple &&
|
|
106
|
-
d("a",
|
|
116
|
+
return (t, e) => (l(), i("div", Z, [
|
|
117
|
+
!n.context.attrs.multiple && m(s).activeValue ? (l(), i("div", ee, [
|
|
118
|
+
d("a", te, f(n.context.value.name), 1),
|
|
107
119
|
e[7] || (e[7] = c()),
|
|
108
120
|
d("div", {
|
|
109
121
|
class: "removeX",
|
|
110
|
-
onClick:
|
|
122
|
+
onClick: O
|
|
111
123
|
})
|
|
112
|
-
])) : (l(), i("div",
|
|
113
|
-
d("div",
|
|
114
|
-
d("div",
|
|
115
|
-
d("label",
|
|
124
|
+
])) : (l(), i("div", ae, [
|
|
125
|
+
d("div", se, [
|
|
126
|
+
d("div", oe, [
|
|
127
|
+
d("label", le, [
|
|
116
128
|
c(f(t.$t("message.dataupload.info.preferredInput")) + " ", 1),
|
|
117
129
|
d("input", {
|
|
118
130
|
id: "I1",
|
|
@@ -120,47 +132,47 @@ const Q = { class: "d-flex flex-column w-100 spatialWrap" }, Y = {
|
|
|
120
132
|
class: "selectInputField formkit-inner",
|
|
121
133
|
readonly: "readonly",
|
|
122
134
|
placeholder: t.$t("message.dataupload.info.preferredInput"),
|
|
123
|
-
onClick: e[0] || (e[0] = (a) =>
|
|
124
|
-
}, null, 8,
|
|
135
|
+
onClick: e[0] || (e[0] = (a) => h("showTable"))
|
|
136
|
+
}, null, 8, ie)
|
|
125
137
|
]),
|
|
126
138
|
e[9] || (e[9] = c()),
|
|
127
|
-
|
|
139
|
+
G(d("ul", {
|
|
128
140
|
ref_key: "I1",
|
|
129
141
|
ref: x,
|
|
130
142
|
class: "spatialListUpload"
|
|
131
143
|
}, [
|
|
132
144
|
d("li", {
|
|
133
145
|
onClick: e[1] || (e[1] = (a) => {
|
|
134
|
-
|
|
146
|
+
h("showTable"), t.man = !0, t.vocSearch && (t.vocSearch = !1);
|
|
135
147
|
}),
|
|
136
148
|
class: "p-2 border-b border-gray-200 choosableItemsAC"
|
|
137
149
|
}, f(t.$t("message.dataupload.datasets.conditional.manually")), 1),
|
|
138
150
|
e[8] || (e[8] = c()),
|
|
139
151
|
d("li", {
|
|
140
152
|
onClick: e[2] || (e[2] = (a) => {
|
|
141
|
-
|
|
153
|
+
h("showTable"), t.vocSearch = !0, t.man && (t.man = !1);
|
|
142
154
|
}),
|
|
143
155
|
class: "p-2 border-b border-gray-200 choosableItemsAC"
|
|
144
156
|
}, f(t.$t("message.dataupload.datasets.conditional.vocabulary")), 1)
|
|
145
157
|
], 512), [
|
|
146
|
-
[
|
|
158
|
+
[J, m(s).first]
|
|
147
159
|
])
|
|
148
160
|
]),
|
|
149
161
|
e[11] || (e[11] = c()),
|
|
150
|
-
t.man ? (l(), i("div",
|
|
151
|
-
d("label",
|
|
162
|
+
t.man ? (l(), i("div", ne, [
|
|
163
|
+
d("label", re, [
|
|
152
164
|
c(f(t.$te("message.dataupload.datasets.isReferencedByUrl.placeholder") ? t.$t("message.dataupload.datasets.isReferencedByUrl.placeholder") : "Provide an URL") + " ", 1),
|
|
153
165
|
d("input", {
|
|
154
166
|
type: "URL",
|
|
155
167
|
class: "selectInputField formkit-inner",
|
|
156
168
|
placeholder: "URL",
|
|
157
|
-
onInput: e[3] || (e[3] = (a) =>
|
|
169
|
+
onInput: e[3] || (e[3] = (a) => P(a))
|
|
158
170
|
}, null, 32)
|
|
159
171
|
])
|
|
160
|
-
])) :
|
|
172
|
+
])) : g("", !0),
|
|
161
173
|
e[12] || (e[12] = c()),
|
|
162
|
-
t.vocSearch ? (l(), i("div",
|
|
163
|
-
d("label",
|
|
174
|
+
t.vocSearch ? (l(), i("div", de, [
|
|
175
|
+
d("label", ce, [
|
|
164
176
|
c(f(t.$te("message.dataupload.datasets.contributorType.placeholder") ? t.$t("message.dataupload.datasets.contributorType.placeholder") : "Choose type of vocabulary") + " ", 1),
|
|
165
177
|
d("input", {
|
|
166
178
|
id: "I2",
|
|
@@ -169,71 +181,71 @@ const Q = { class: "d-flex flex-column w-100 spatialWrap" }, Y = {
|
|
|
169
181
|
readonly: "readonly",
|
|
170
182
|
placeholder: t.$te("message.dataupload.datasets.accessRights.placeholder") ? t.$t("message.dataupload.datasets.accessRights.placeholder") : "Choose type of vocabulary",
|
|
171
183
|
onClick: e[4] || (e[4] = (a) => {
|
|
172
|
-
|
|
184
|
+
h("showVocTable");
|
|
173
185
|
})
|
|
174
|
-
}, null, 8,
|
|
186
|
+
}, null, 8, ue)
|
|
175
187
|
]),
|
|
176
188
|
e[10] || (e[10] = c()),
|
|
177
|
-
|
|
189
|
+
m(s).second ? (l(), i("ul", {
|
|
178
190
|
key: 0,
|
|
179
191
|
ref_key: "I2",
|
|
180
192
|
ref: A,
|
|
181
193
|
class: "spatialListUpload"
|
|
182
194
|
}, [
|
|
183
|
-
(l(!0), i(
|
|
195
|
+
(l(!0), i(S, null, R(m(b), (a) => (l(), i("li", {
|
|
184
196
|
key: a,
|
|
185
197
|
class: "p-2 border-b border-gray-200 choosableItemsAC",
|
|
186
198
|
onClick: (r) => {
|
|
187
|
-
|
|
199
|
+
E(), a.active = !a.active, h("showVocTable"), I(o) ? o.value = "" : o = "", I(y) ? y.value = a.item : y = a.item;
|
|
188
200
|
}
|
|
189
|
-
}, f(t.$t("message.dataupload.datasets.conditional." + a.item)), 9,
|
|
190
|
-
], 512)) :
|
|
191
|
-
])) :
|
|
201
|
+
}, f(t.$t("message.dataupload.datasets.conditional." + a.item)), 9, pe))), 128))
|
|
202
|
+
], 512)) : g("", !0)
|
|
203
|
+
])) : g("", !0)
|
|
192
204
|
]),
|
|
193
205
|
e[14] || (e[14] = c()),
|
|
194
|
-
t.vocSearch ? (l(), i("div",
|
|
195
|
-
(l(!0), i(
|
|
206
|
+
t.vocSearch ? (l(), i("div", me, [
|
|
207
|
+
(l(!0), i(S, null, R(m(b), (a) => (l(), i("div", {
|
|
196
208
|
key: a,
|
|
197
209
|
class: "position-relative"
|
|
198
210
|
}, [
|
|
199
|
-
a.active ? (l(), i("label",
|
|
211
|
+
a.active ? (l(), i("label", fe, [
|
|
200
212
|
c(f(t.$te("message.dataupload.datasets.accessRights.placeholder") ? t.$t("message.dataupload.datasets.accessRights.placeholder") : "Choose type of vocabulary") + " ", 1),
|
|
201
|
-
|
|
213
|
+
G(d("input", {
|
|
202
214
|
id: "I3",
|
|
203
215
|
type: "text",
|
|
204
|
-
"onUpdate:modelValue": e[5] || (e[5] = (r) =>
|
|
216
|
+
"onUpdate:modelValue": e[5] || (e[5] = (r) => I(o) ? o.value = r : o = r),
|
|
205
217
|
class: "selectInputField formkit-inner",
|
|
206
|
-
placeholder: a.
|
|
218
|
+
placeholder: a.placeholder ?? "",
|
|
207
219
|
onClick: e[6] || (e[6] = (r) => {
|
|
208
|
-
|
|
220
|
+
h("showVocEntries"), I(o) ? o.value = "" : o = "";
|
|
209
221
|
})
|
|
210
|
-
}, null, 8,
|
|
211
|
-
[
|
|
222
|
+
}, null, 8, ve), [
|
|
223
|
+
[W, m(o)]
|
|
212
224
|
])
|
|
213
|
-
])) :
|
|
225
|
+
])) : g("", !0),
|
|
214
226
|
e[13] || (e[13] = c()),
|
|
215
|
-
|
|
227
|
+
m(s).third && a.active ? (l(), i("ul", {
|
|
216
228
|
key: 1,
|
|
217
229
|
ref_for: !0,
|
|
218
230
|
ref_key: "I3",
|
|
219
231
|
ref: L,
|
|
220
232
|
class: "spatialListUpload"
|
|
221
233
|
}, [
|
|
222
|
-
(l(!0), i(
|
|
234
|
+
(l(!0), i(S, null, R(m(k), (r) => (l(), i("li", {
|
|
223
235
|
key: r,
|
|
224
236
|
class: "p-2 border-b border-gray-200 choosableItemsAC",
|
|
225
|
-
onClick: (
|
|
226
|
-
n.context.node.input(r),
|
|
237
|
+
onClick: (p) => {
|
|
238
|
+
n.context.node.input(r), I(o) ? o.value = r.name : o = r.name, h("showVocEntries"), m(s).third = !1, _();
|
|
227
239
|
}
|
|
228
|
-
}, f(r.name), 9,
|
|
229
|
-
], 512)) :
|
|
240
|
+
}, f(r.name), 9, ye))), 128))
|
|
241
|
+
], 512)) : g("", !0)
|
|
230
242
|
]))), 128))
|
|
231
|
-
])) :
|
|
243
|
+
])) : g("", !0)
|
|
232
244
|
]))
|
|
233
245
|
]));
|
|
234
246
|
}
|
|
235
|
-
}),
|
|
247
|
+
}), Ke = /* @__PURE__ */ Y(ge, [["__scopeId", "data-v-4d82d7f1"]]);
|
|
236
248
|
export {
|
|
237
|
-
|
|
249
|
+
Ke as default
|
|
238
250
|
};
|
|
239
251
|
//# 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';\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();\n\nif (props.context.attrs.identifier === 'politicalGeocodingURI') {\n listOfVoc.value.push({ item: 'Municipality Key', active: false }, { item: 'Regional Key', active: false }, { item: 'Municipal Association Key', active: false }, { item: 'District Key', active: false }, { item: 'Government District Key', active: false }, { item: 'State Key', active: false })\n\n}\nif (props.context.attrs.identifier === 'spatial') {\n listOfVoc.value.push({ item: 'Country', active: false }, { item: 'Place', active: false }, { item: 'Continent', active: false })\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: '--- Type in anything for a live search of the vocabulary ---', 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});\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 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.item\"\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\nexport default {\n data() {\n return {\n man: false,\n vocSearch: false,\n }\n },\n\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":["__default__","instance","getCurrentInstance","route","useRoute","props","__props","listOfVoc","ref","inputText","voc","matches","manURL","store","useStore","t","locale","useI18n","watch","getAutocompleteSuggestions","onMounted","nextTick","showTable","closeAll","element","removeProperty","e","saveToLocal","el","pathToLocalStorage","arr","index","vocCache","text","response","r","getTranslationFor","reactive","I1","I2","I3","onClickOutside","event","activeInput","manURLInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;2CAoOeA,KAAA;AAAA,EACX,OAAO;AACH,WAAO;AAAA,MACH,KAAK;AAAA,MACL,WAAW;AAAA,IACf;AAAA,EACH;AAEL;;;;;;AAlOA,QAAIC,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,GAChB,EAAE,GAAAC,IAAG,QAAAC,MAAWC;AAEtB,IAAIZ,EAAM,QAAQ,MAAM,eAAe,2BACnCE,EAAU,MAAM,KAAK,EAAE,MAAM,oBAAoB,QAAQ,GAAK,GAAI,EAAE,MAAM,gBAAgB,QAAQ,GAAK,GAAI,EAAE,MAAM,6BAA6B,QAAQ,GAAO,GAAE,EAAE,MAAM,gBAAgB,QAAQ,GAAO,GAAE,EAAE,MAAM,2BAA2B,QAAQ,GAAK,GAAI,EAAE,MAAM,aAAa,QAAQ,IAAO,GAGlSF,EAAM,QAAQ,MAAM,eAAe,aACnCE,EAAU,MAAM,KAAK,EAAE,MAAM,WAAW,QAAQ,MAAS,EAAE,MAAM,SAAS,QAAQ,MAAS,EAAE,MAAM,aAAa,QAAQ,IAAO,GAGnIW,EAAMT,GAAW,YAAY;AACzB,MAAAU;IACJ,CAAC,GACDD,EAAMR,GAAK,YAAY;AACnB,MAAAA,EAAI,QAAQA,EAAI,MAAM,YAAW;AAAA,IACrC,CAAC,GACDQ,EAAMN,GAAQ,YAAY;AACtB,MAAAP,EAAM,QAAQ,KAAK,MAAM,EAAE,MAAQO,GAAQ,UAAYA,GAAQ;AAAA,IACnE,CA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B,EAAU,QAAQ,EAAK;AACnD,aAASqB,EAAYjB,GAAG;AAGpB,MAAIA,MAAM,gBAAaJ,EAAU,QAAQ,CAACA,EAAU,QAChDI,MAAM,mBAAgBJ,EAAU,SAAS,CAACA,EAAU,SACpDI,MAAM,qBACFJ,EAAU,UAAU,OAEnBA,EAAU,QAAQ,CAACA,EAAU;AAAA,IAE1C;AACA,aAASsB,EAAYlB,GAAG;AACpB,MAAArB,EAAM,QAAQ,KAAK,MAAM,EAAE,MAAQqB,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 } 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\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});\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 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\nexport default {\n data() {\n return {\n man: false,\n vocSearch: false,\n }\n },\n\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":["__default__","instance","getCurrentInstance","route","useRoute","props","__props","listOfVoc","ref","inputText","voc","matches","manURL","store","useStore","t","locale","useI18n","ted","useTed","watch","getAutocompleteSuggestions","onMounted","nextTick","showTable","closeAll","element","removeProperty","e","saveToLocal","el","pathToLocalStorage","arr","index","vocCache","text","response","r","getTranslationFor","reactive","I1","I2","I3","onClickOutside","event","activeInput","manURLInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;2CAiPeA,KAAA;AAAA,EACX,OAAO;AACH,WAAO;AAAA,MACH,KAAK;AAAA,MACL,WAAW;AAAA,IACf;AAAA,EACH;AAEL;;;;;;AA9OA,QAAIC,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,GAChB,EAAE,GAAAC,IAAG,QAAAC,MAAWC,KAChBC,IAAMC,EAAM;AAElB,IAAId,EAAM,QAAQ,MAAM,eAAe,2BACnCE,EAAU,MAAM;AAAA,MACZ,EAAE,MAAM,oBAAoB,QAAQ,IAAO,aAAaW,EAAI,4DAA4D,kBAAkB,EAAG;AAAA,MAC7I,EAAE,MAAM,gBAAgB,QAAQ,IAAO,aAAaA,EAAI,wDAAwD,cAAc,EAAG;AAAA,MACjI,EAAE,MAAM,6BAA6B,QAAQ,IAAO,aAAaA,EAAI,qEAAqE,2BAA2B,EAAG;AAAA,MACxK,EAAE,MAAM,gBAAgB,QAAQ,IAAO,aAAaA,EAAI,wDAAwD,cAAc,EAAG;AAAA,MACjI,EAAE,MAAM,2BAA2B,QAAQ,IAAO,aAAa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|
@@ -273,7 +273,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
273
273
|
getData: import('vuex').Computed;
|
|
274
274
|
}, {
|
|
275
275
|
checkIfPropertySet(data: any, property: any): any;
|
|
276
|
-
getDate(date: any):
|
|
276
|
+
getDate(date: any): string;
|
|
277
277
|
checkIfPropertyValueSet(data: any, property: any, value: any): any;
|
|
278
278
|
reqName(URI: any): Promise<any>;
|
|
279
279
|
requestFirstEntrySuggestions: import('vuex').ActionMethod;
|
|
@@ -220,7 +220,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
220
220
|
getData: import('vuex').Computed;
|
|
221
221
|
}, {
|
|
222
222
|
checkIfPropertySet(data: any, property: any): any;
|
|
223
|
-
getDate(date: any):
|
|
223
|
+
getDate(date: any): string;
|
|
224
224
|
checkIfPropertyValueSet(data: any, property: any, value: any): any;
|
|
225
225
|
reqName(URI: any): Promise<any>;
|
|
226
226
|
requestFirstEntrySuggestions: import('vuex').ActionMethod;
|
|
@@ -96,6 +96,8 @@ const k = {
|
|
|
96
96
|
return t[e] != null ? t[e] : "-";
|
|
97
97
|
},
|
|
98
98
|
getDate(t) {
|
|
99
|
+
if (!(t instanceof Date) || isNaN(t.getTime()))
|
|
100
|
+
return "-";
|
|
99
101
|
let e = {};
|
|
100
102
|
return this.dpiLocale === "de" ? (e = { year: "numeric", month: "long", day: "numeric" }, t.toLocaleDateString("de-DE", e)) : (e = { year: "numeric", month: "long", day: "numeric" }, t.toLocaleDateString("en-EN", e));
|
|
101
103
|
},
|
|
@@ -120,7 +122,7 @@ const k = {
|
|
|
120
122
|
}, _ = {
|
|
121
123
|
key: 0,
|
|
122
124
|
class: "mt-2"
|
|
123
|
-
}, S = { class: "overviewHeader p-3" }, V = { class: "firstRow d-flex" }, q = { class: "datasetNotation dsd-title-tag d-flex align-items-center" },
|
|
125
|
+
}, S = { class: "overviewHeader p-3" }, V = { class: "firstRow d-flex" }, q = { class: "datasetNotation dsd-title-tag d-flex align-items-center" }, N = { class: "dsTitle" }, x = { class: "secondRow d-flex justify-content-between" }, E = { class: "dsCatalogue" }, B = { href: "" }, O = { class: "dsPublisher" }, T = { class: "dsIssued" }, G = { class: "dsUpdated" }, j = { class: "dsMainWrap d-flex flex-column mt-3" }, A = { class: "" }, C = { class: "dsDesc px-3" }, M = { class: "" }, F = { class: "table table-borderless table-responsive bg-light disOverview p-3" }, H = {
|
|
124
126
|
key: 0,
|
|
125
127
|
class: "dsDist b-top p-3"
|
|
126
128
|
}, K = { class: "my-4" }, W = {
|
|
@@ -136,16 +138,16 @@ function X(t, e, d, f, c, s) {
|
|
|
136
138
|
a("span", null, i(t.$te("message.metadata.dataset") ? t.$t("message.metadata.dataset") : "Dataset"), 1)
|
|
137
139
|
]),
|
|
138
140
|
e[0] || (e[0] = l()),
|
|
139
|
-
a("h1",
|
|
141
|
+
a("h1", N, i(s.getTitle), 1)
|
|
140
142
|
]),
|
|
141
143
|
e[7] || (e[7] = l()),
|
|
142
|
-
a("div",
|
|
143
|
-
a("div",
|
|
144
|
+
a("div", x, [
|
|
145
|
+
a("div", E, [
|
|
144
146
|
a("span", null, [
|
|
145
147
|
a("b", null, i(t.$te("message.metadata.catalog") ? t.$t("message.metadata.catalog") : "Catalogue") + ":", 1)
|
|
146
148
|
]),
|
|
147
149
|
e[1] || (e[1] = l()),
|
|
148
|
-
a("a",
|
|
150
|
+
a("a", B, i(s.checkIfPropertySet(s.getDatasets, "dcat:catalog")), 1)
|
|
149
151
|
]),
|
|
150
152
|
e[4] || (e[4] = l()),
|
|
151
153
|
a("div", O, [
|