@piveau/piveau-hub-ui-modules 4.3.0-beta.0 → 4.3.1

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 (48) hide show
  1. package/dist/composables/useRuntimeEnv.d.ts +1 -0
  2. package/dist/configurations/config-schema/configSchema.d.ts +9 -0
  3. package/dist/configurations/config-schema/contentSchema.d.ts +7 -0
  4. package/dist/configurations/config-schema/contentSchema.mjs +78 -77
  5. package/dist/configurations/config-schema/contentSchema.mjs.map +1 -1
  6. package/dist/data-provider-interface/components/AutocompleteInput.vue.mjs +98 -98
  7. package/dist/data-provider-interface/components/AutocompleteInput.vue.mjs.map +1 -1
  8. package/dist/data-provider-interface/components/ConditionalInput.vue.mjs +129 -135
  9. package/dist/data-provider-interface/components/ConditionalInput.vue.mjs.map +1 -1
  10. package/dist/data-provider-interface/components/DistributionStepper.vue.mjs +60 -60
  11. package/dist/data-provider-interface/components/DistributionStepper.vue.mjs.map +1 -1
  12. package/dist/data-provider-interface/components/FileUpload.vue.mjs +2 -2
  13. package/dist/data-provider-interface/components/FileUpload.vue.mjs.map +1 -1
  14. package/dist/data-provider-interface/components/Navigation.vue.d.ts +1 -0
  15. package/dist/data-provider-interface/components/SimpleInput.vue.mjs +20 -16
  16. package/dist/data-provider-interface/components/SimpleInput.vue.mjs.map +1 -1
  17. package/dist/data-provider-interface/components/SimpleSelect.vue.mjs +31 -31
  18. package/dist/data-provider-interface/components/SimpleSelect.vue.mjs.map +1 -1
  19. package/dist/data-provider-interface/components/SpatialInput.vue.mjs +94 -90
  20. package/dist/data-provider-interface/components/SpatialInput.vue.mjs.map +1 -1
  21. package/dist/data-provider-interface/components/SpatialInput.vue2.mjs +2 -2
  22. package/dist/data-provider-interface/components/UniqueIdentifierInput.vue.mjs +30 -41
  23. package/dist/data-provider-interface/components/UniqueIdentifierInput.vue.mjs.map +1 -1
  24. package/dist/data-provider-interface/config/dcatapde/input-definition.mjs +39 -19
  25. package/dist/data-provider-interface/config/dcatapde/input-definition.mjs.map +1 -1
  26. package/dist/data-provider-interface/views/DistributionInputPage.vue.mjs +52 -52
  27. package/dist/data-provider-interface/views/DistributionInputPage.vue.mjs.map +1 -1
  28. package/dist/data-provider-interface/views/DraftsPage.vue.d.ts +1 -0
  29. package/dist/data-provider-interface/views/InputPage.vue.mjs +67 -67
  30. package/dist/data-provider-interface/views/InputPage.vue.mjs.map +1 -1
  31. package/dist/datasetDetails/DatasetDetailsSimilarDatasets.vue.mjs +25 -28
  32. package/dist/datasetDetails/DatasetDetailsSimilarDatasets.vue.mjs.map +1 -1
  33. package/dist/datasetDetails/features/DatasetDetailsFeatures.vue.d.ts +1 -0
  34. package/dist/datasetDetails/features/DatasetDetailsFeatures.vue.mjs +145 -78
  35. package/dist/datasetDetails/features/DatasetDetailsFeatures.vue.mjs.map +1 -1
  36. package/dist/form/Repeatable.vue.mjs +18 -18
  37. package/dist/form/Repeatable.vue.mjs.map +1 -1
  38. package/dist/index.d.ts +2 -1
  39. package/dist/index.mjs +152 -150
  40. package/dist/index.mjs.map +1 -1
  41. package/dist/piveau-hub-ui-modules.css +1 -1
  42. package/dist/services/datasetService.d.ts +6 -5
  43. package/dist/services/datasetService.mjs +6 -5
  44. package/dist/services/datasetService.mjs.map +1 -1
  45. package/dist/store/modules/datasetDetailsStore.d.ts +2 -1
  46. package/dist/store/modules/datasetDetailsStore.mjs +85 -80
  47. package/dist/store/modules/datasetDetailsStore.mjs.map +1 -1
  48. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleSelect.vue.mjs","sources":["../../../lib/data-provider-interface/components/SimpleSelect.vue"],"sourcesContent":["<template>\n <div class=\"formkitProperty\">\n <h4>{{ props.context.label }}</h4>\n <div class=\"position-relative formkitCmpWrap\">\n <FormKit v-if=\"isEditMode.value && !isDuplicate\" class=\"autocompleteInputfield\" type=\"text\" readonly\n :placeholder=\"getNode('dcat:catalog').value\" :name=\"props.context.node.name\" />\n <FormKit v-else class=\"autocompleteInputfield\" v-model=\"catVal\"\n :placeholder=\"props.context.attrs.placeholder\" type=\"text\" @click=\"showList = !showList\"\n validation=\"required\" mandatory=\"true\" readonly :validation-messages=\"{\n required: props.context.attrs.placeholder,\n }\" :name=\"props.context.node.name\" />\n\n <ul ref=\"dropdownList\" v-show=\"showList\" class=\"autocompleteResultList selectListFK catSelectList\">\n\n <li v-for=\"match in filteredCatalogs\" :key=\"match\" @click=\"setvalue(match)\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{\n match.name }}\n </li>\n <li v-if=\"filteredCatalogs.length === 0\" v-for=\"idMatch in userCats\" :key=\"idMatch\"\n @click=\"setvalue(idMatch)\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{\n idMatch }}\n </li>\n </ul>\n </div>\n </div>\n\n</template>\n<script setup>\nimport { ref, computed, onMounted } from 'vue';\nimport { useStore } from 'vuex';\nimport { getNode } from '@formkit/core'\nimport { onClickOutside } from '@vueuse/core'\nimport axios from 'axios'\nimport { useRuntimeEnv } from \"../../composables/useRuntimeEnv.ts\";\nimport {\n has,\n isNil,\n} from 'lodash-es';\nimport { FormKit } from '@formkit/vue';\n\nconst props = defineProps({\n context: Object\n})\n\n\nconst isDuplicate = computed(()=> localStorage.getItem('dpi_duplicate'))\nconst userCats = computed(() => store.getters['auth/getUserCatalogIds']);\nlet showList = ref()\nconst store = useStore()\nconst dropdownList = ref(null)\nconst isEditMode = ref()\nlet validationTrigger = ref(true)\nisEditMode.value = computed(() => store.getters['auth/getIsEditMode']);\nlet filteredCatalogs = ref([])\nlet env = useRuntimeEnv()\nlet catVal = ref()\n\ncatVal = getNode('dcat:catalog').value\n\nonClickOutside(dropdownList, event => showList.value = false)\n\nconst setvalue = async (e) => {\n \n validationTrigger = false\n if (e.id) {\n props.context.node.input(e.id)\n showList.value = !showList.value;\n getNode('dcat:catalog').value = e.id\n catVal = e.name\n } else {\n props.context.node.input(e)\n showList.value = !showList.value;\n getNode('dcat:catalog').value = e\n catVal = e\n }\n\n}\nlet filterCatList = async () => {\n let cache;\n await axios\n .get(env.api.baseUrl + 'search?filter=catalogue&limit=1000')\n .then(response => (cache = response))\n .catch((err) => {\n reject(err);\n });\n\n \n cache.data.result.results.forEach((e) => {\n if (has(e, 'title') && !isNil(e.title) && has(e, 'id') && !isNil(e.id)) filteredCatalogs.value.push({ title: Object.values(e.title)[0], id: e.id })\n });\n\n filteredCatalogs.value = await filteredCatalogs.value\n .filter(item => userCats.value.includes(item.id))\n .map(item => ({ id: item.id, name: item.title }));\n\n // Check if theres only one catalog and set it directly\n\n let clone = JSON.parse(JSON.stringify(filteredCatalogs.value))\n if (clone.length === 1) {\n catVal = clone[0].id\n }\n}\n\n\nonMounted(async () => {\n filterCatList();\n});\n\n</script>\n<style>\n.catSelectList {\n width: 97.3% !important;\n margin: 0 1rem;\n}\n\n.selectListFK {\n\n max-height: 20rem;\n overflow: overlay;\n overflow-x: hidden;\n}\n</style>"],"names":["props","__props","isDuplicate","computed","userCats","store","showList","ref","useStore","dropdownList","isEditMode","filteredCatalogs","env","useRuntimeEnv","catVal","getNode","onClickOutside","event","setvalue","e","filterCatList","cache","axios","response","err","has","isNil","item","clone","onMounted"],"mappings":";;;;;;;;;;;;;;;AAyCA,UAAMA,IAAQC,GAKRC,IAAcC,EAAS,MAAK,aAAa,QAAQ,eAAe,CAAC,GACjEC,IAAWD,EAAS,MAAME,EAAM,QAAQ,wBAAwB,CAAC;AACvE,QAAIC,IAAWC,EAAK;AACpB,UAAMF,IAAQG,EAAU,GAClBC,IAAeF,EAAI,IAAI,GACvBG,IAAaH,EAAK;AACA,IAAAA,EAAI,EAAI,GAChCG,EAAW,QAAQP,EAAS,MAAME,EAAM,QAAQ,oBAAoB,CAAC;AACrE,QAAIM,IAAmBJ,EAAI,EAAE,GACzBK,IAAMC,EAAe,GACrBC,IAASP,EAAK;AAElB,IAAAO,IAASC,EAAQ,cAAc,EAA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AAT;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SimpleSelect.vue.mjs","sources":["../../../lib/data-provider-interface/components/SimpleSelect.vue"],"sourcesContent":["<template>\n <div class=\"formkitProperty\">\n <h4>{{ props.context.label }}</h4>\n <div class=\"position-relative formkitCmpWrap\">\n <FormKit v-if=\"isEditMode.value && !isDuplicate\" class=\"autocompleteInputfield\" type=\"text\" readonly\n :placeholder=\"getNode('dcat:catalog').value\" :name=\"props.context.node.name\" />\n <FormKit v-else class=\"autocompleteInputfield\" v-model=\"catVal\"\n :placeholder=\"props.context.attrs.placeholder\" type=\"text\" @click=\"showList = !showList\"\n validation=\"required\" mandatory=\"true\" readonly :validation-messages=\"{\n required: 'The catalog is required',\n }\" :name=\"props.context.node.name\" />\n\n <ul ref=\"dropdownList\" v-show=\"showList\" class=\"autocompleteResultList selectListFK catSelectList\">\n\n <li v-for=\"match in filteredCatalogs\" :key=\"match\" @click=\"setvalue(match)\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{\n match.name }}\n </li>\n <li v-if=\"filteredCatalogs.length === 0\" v-for=\"idMatch in userCats\" :key=\"idMatch\"\n @click=\"setvalue(idMatch)\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{\n idMatch }}\n </li>\n </ul>\n </div>\n </div>\n\n</template>\n<script setup>\nimport { ref, computed, onMounted } from 'vue';\nimport { useStore } from 'vuex';\nimport { getNode } from '@formkit/core'\nimport { onClickOutside } from '@vueuse/core'\nimport axios from 'axios'\nimport { useRuntimeEnv } from \"../../composables/useRuntimeEnv.ts\";\nimport {\n has,\n isNil,\n} from 'lodash-es';\nimport { FormKit } from '@formkit/vue';\n\nconst props = defineProps({\n context: Object\n})\n\nconst isDuplicate = computed(()=> localStorage.getItem('dpi_duplicate'))\nconst userCats = computed(() => store.getters['auth/getUserCatalogIds']);\nlet showList = ref()\nconst store = useStore()\nconst dropdownList = ref(null)\nconst isEditMode = ref()\nlet validationTrigger = ref(true)\nisEditMode.value = computed(() => store.getters['auth/getIsEditMode']);\nlet filteredCatalogs = ref([])\nlet env = useRuntimeEnv()\nlet catVal = ref()\n\ncatVal = getNode('dcat:catalog').value\n\nonClickOutside(dropdownList, event => showList.value = false)\n\nconst setvalue = async (e) => {\n \n validationTrigger = false\n if (e.id) {\n props.context.node.input(e.id)\n showList.value = !showList.value;\n getNode('dcat:catalog').value = e.id\n catVal = e.name\n } else {\n props.context.node.input(e)\n showList.value = !showList.value;\n getNode('dcat:catalog').value = e\n catVal = e\n }\n\n}\nlet filterCatList = async () => {\n let cache;\n await axios\n .get(env.api.baseUrl + 'search?filter=catalogue&limit=1000')\n .then(response => (cache = response))\n .catch((err) => {\n reject(err);\n });\n\n \n cache.data.result.results.forEach((e) => {\n if (has(e, 'title') && !isNil(e.title) && has(e, 'id') && !isNil(e.id)) filteredCatalogs.value.push({ title: Object.values(e.title)[0], id: e.id })\n });\n\n filteredCatalogs.value = await filteredCatalogs.value\n .filter(item => userCats.value.includes(item.id))\n .map(item => ({ id: item.id, name: item.title }));\n\n // Check if theres only one catalog and set it directly\n\n let clone = JSON.parse(JSON.stringify(filteredCatalogs.value))\n if (clone.length === 1) {\n catVal = clone[0].id\n }\n}\n\n\nonMounted(async () => {\n filterCatList();\n});\n\n</script>\n<style>\n.catSelectList {\n width: 97.3% !important;\n margin: 0 1rem;\n}\n\n.selectListFK {\n\n max-height: 20rem;\n overflow: overlay;\n overflow-x: hidden;\n}\n</style>"],"names":["props","__props","isDuplicate","computed","userCats","store","showList","ref","useStore","dropdownList","isEditMode","filteredCatalogs","env","useRuntimeEnv","catVal","getNode","onClickOutside","event","setvalue","e","filterCatList","cache","axios","response","err","has","isNil","item","clone","onMounted"],"mappings":";;;;;;;;;;;;;;;AAyCA,UAAMA,IAAQC,GAIRC,IAAcC,EAAS,MAAK,aAAa,QAAQ,eA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AAK,GAEDA,EAAiB,QAAQ,MAAMA,EAAiB,MAC3C,OAAO,CAAAgB,MAAQvB,EAAS,MAAM,SAASuB,EAAK,EAAE,CAAC,EAC/C,IAAI,CAAAA,OAAS,EAAE,IAAIA,EAAK,IAAI,MAAMA,EAAK,MAAO,EAAC;AAIpD,UAAIC,IAAQ,KAAK,MAAM,KAAK,UAAUjB,EAAiB,KAAK,CAAC;AAC7D,MAAIiB,EAAM,WAAW,MACjBd,IAASc,EAAM,CAAC,EAAE;AAAA,IAE1B;AAGA,WAAAC,EAAU,YAAY;AAClB,MAAAT;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import { getCurrentInstance as D, ref as f, watch as _, onMounted as M, nextTick as P, reactive as j, openBlock as i, createElementBlock as l, unref as p, createElementVNode as c, toDisplayString as b, createTextVNode as d, withDirectives as L, vShow as q, createCommentVNode as h, Fragment as w, renderList as x, isRef as g, vModelText as B } from "vue";
1
+ import { getCurrentInstance as N, ref as f, watch as I, onMounted as D, nextTick as P, reactive as j, openBlock as s, createElementBlock as l, unref as p, createElementVNode as c, toDisplayString as _, createTextVNode as u, withDirectives as L, vShow as q, createCommentVNode as h, Fragment as x, renderList as w, isRef as b, vModelText as B } from "vue";
2
2
  import { useStore as J } from "vuex";
3
3
  import { getTranslationFor as $ } from "../../utils/helpers.mjs";
4
4
  import { onClickOutside as S } from "../../external/@vueuse/core/index";
@@ -8,79 +8,79 @@ import X from "../../_virtual/_plugin-vue_export-helper.mjs";
8
8
  const z = { class: "d-flex flex-column w-100 spatialWrap" }, H = {
9
9
  key: 0,
10
10
  class: "d-flex formkit-inner mx-3 mb-3"
11
- }, Q = { class: "autocompleteInputSingleValue" }, Y = { key: 1 }, Z = { class: "w-100 d-flex" }, ee = { class: "d-flex position-relative m-3 w-100" }, te = ["placeholder"], ae = {
11
+ }, Q = { class: "autocompleteInputSingleValue" }, Y = { key: 1 }, Z = { class: "w-100 d-flex" }, ee = { class: "d-flex position-relative m-3 w-100" }, te = {
12
12
  key: 0,
13
13
  class: "d-flex position-relative m-3 w-100"
14
- }, oe = { class: "w-100" }, se = {
14
+ }, ae = { class: "w-100" }, oe = {
15
15
  key: 1,
16
16
  class: "d-flex position-relative m-3 w-100"
17
- }, ie = { class: "w-100" }, le = ["onClick"], ne = {
17
+ }, ie = { class: "w-100" }, se = ["onClick"], le = {
18
18
  key: 0,
19
19
  class: "m-3"
20
- }, re = {
20
+ }, ne = {
21
21
  key: 0,
22
22
  class: "w-100"
23
- }, ce = ["placeholder"], de = ["onClick"], ue = {
23
+ }, re = ["placeholder"], ce = ["onClick"], ue = {
24
24
  data() {
25
25
  return {
26
26
  man: !1,
27
27
  vocSearch: !1
28
28
  };
29
29
  }
30
- }, pe = /* @__PURE__ */ Object.assign(ue, {
30
+ }, de = /* @__PURE__ */ Object.assign(ue, {
31
31
  __name: "SpatialInput",
32
32
  props: {
33
33
  context: Object
34
34
  },
35
35
  setup(E) {
36
- let C = D().appContext.app.config.globalProperties.$env, U = W();
36
+ let C = N().appContext.app.config.globalProperties.$env, U = W();
37
37
  const n = E;
38
- let y = f([]), s = f({}), v = f({}), k = f({}), I = f({});
38
+ let y = f([]), i = f({}), v = f({}), g = f({}), k = f({});
39
39
  const V = J();
40
- n.context.attrs.identifier === "politicalGeocodingURI" && y.value.push({ item: "Municipality Key", active: !1 }, { item: "Regional Key", active: !1 }, { item: "Municipal Association Key", active: !1 }, { item: "District Key", active: !1 }, { item: "Government District Key", active: !1 }, { item: "State Key", active: !1 }), n.context.attrs.identifier === "spatial" && y.value.push({ item: "Country", active: !1 }, { item: "Place", active: !1 }, { item: "Continent", active: !1 }), _(s, async () => {
40
+ n.context.attrs.identifier === "politicalGeocodingURI" && y.value.push({ item: "Municipality Key", active: !1 }, { item: "Regional Key", active: !1 }, { item: "Municipal Association Key", active: !1 }, { item: "District Key", active: !1 }, { item: "Government District Key", active: !1 }, { item: "State Key", active: !1 }), n.context.attrs.identifier === "spatial" && y.value.push({ item: "Country", active: !1 }, { item: "Place", active: !1 }, { item: "Continent", active: !1 }), I(i, async () => {
41
41
  K();
42
- }), _(v, async () => {
42
+ }), I(v, async () => {
43
43
  v.value = v.value.toLowerCase();
44
- }), _(I, async () => {
45
- n.context.node.input({ name: I, resource: I });
46
- }), M(async () => {
47
- k = [{ name: "--- Type in anything for a live search of the vocabulary ---", resource: "invalid" }], await P(), n.context.value.name === void 0 || n.context.value.name === "" ? o.activeValue = !1 : o.activeValue = !0;
44
+ }), I(k, async () => {
45
+ n.context.node.input({ name: k, resource: k });
46
+ }), D(async () => {
47
+ g = [{ name: "--- Type in anything for a live search of the vocabulary ---", resource: "invalid" }], await P(), n.context.value.name === void 0 || n.context.value.name === "" ? o.activeValue = !1 : o.activeValue = !0;
48
48
  });
49
49
  function G() {
50
- y.value.forEach((e) => {
51
- e.active = !1;
50
+ y.value.forEach((t) => {
51
+ t.active = !1;
52
52
  });
53
53
  }
54
- function O(e) {
54
+ function O(t) {
55
55
  o.activeValue = !1, n.context.node.input({});
56
56
  }
57
- function F(e) {
58
- let a = JSON.parse(localStorage.getItem(`dpi_${U.params.property}`)), t;
59
- n.context.attrs.identifier === "politicalGeocodingURI" ? t = a.Advised["dcatde:politicalGeocodingURI"] : t = a.Advised["dct:spatial"], t.forEach((r, u) => {
60
- Object.keys(r).length === 0 && t.splice(u, 1);
61
- }), t.push(n.context.node._value), n.context.attrs.identifier === "politicalGeocodingURI" ? a.Advised["dcatde:politicalGeocodingURI"] = t : a.Advised["dct:spatial"] = t, localStorage.setItem(`dpi_${U.params.property}`, JSON.stringify(a));
57
+ function F(t) {
58
+ let a = JSON.parse(localStorage.getItem(`dpi_${U.params.property}`)), e;
59
+ n.context.attrs.identifier === "politicalGeocodingURI" ? e = a.Advised["dcatde:politicalGeocodingURI"] : e = a.Advised["dct:spatial"], e.forEach((r, d) => {
60
+ Object.keys(r).length === 0 && e.splice(d, 1);
61
+ }), e.push(n.context.node._value), n.context.attrs.identifier === "politicalGeocodingURI" ? a.Advised["dcatde:politicalGeocodingURI"] = e : a.Advised["dct:spatial"] = e, localStorage.setItem(`dpi_${U.params.property}`, JSON.stringify(a));
62
62
  }
63
63
  const K = async () => {
64
- let e = v.value;
64
+ let t = v.value;
65
65
  if (n.context.attrs.identifier === "politicalGeocodingURI") {
66
- e = "political-geocoding-" + e.toLowerCase().replaceAll(" ", "-");
66
+ t = "political-geocoding-" + t.toLowerCase().replaceAll(" ", "-");
67
67
  try {
68
- let a = s.value;
69
- await V.dispatch("dpiStore/requestAutocompleteSuggestions", { voc: e, text: a, base: C.api.baseUrl }).then((t) => {
70
- k = t.data.result.results.map((u) => ({
71
- name: $(u.alt_label, "en", []) + " (" + u.id + ")",
72
- resource: u.resource
68
+ let a = i.value;
69
+ await V.dispatch("dpiStore/requestAutocompleteSuggestions", { voc: t, text: a, base: C.api.baseUrl }).then((e) => {
70
+ g = e.data.result.results.map((d) => ({
71
+ name: $(d.alt_label, "en", []) + " (" + d.id + ")",
72
+ resource: d.resource
73
73
  }));
74
74
  });
75
75
  } catch {
76
76
  }
77
77
  } else
78
78
  try {
79
- let a = s.value;
80
- await V.dispatch("dpiStore/requestAutocompleteSuggestions", { voc: e, text: a, base: C.api.baseUrl }).then((t) => {
81
- k = t.data.result.results.map((u) => ({
82
- name: $(u.pref_label, "en", []) + " (" + u.id + ")",
83
- resource: u.resource
79
+ let a = i.value;
80
+ await V.dispatch("dpiStore/requestAutocompleteSuggestions", { voc: t, text: a, base: C.api.baseUrl }).then((e) => {
81
+ g = e.data.result.results.map((d) => ({
82
+ name: $(d.pref_label, "en", []) + " (" + d.id + ")",
83
+ resource: d.resource
84
84
  }));
85
85
  });
86
86
  } catch {
@@ -93,22 +93,22 @@ const z = { class: "d-flex flex-column w-100 spatialWrap" }, H = {
93
93
  activeValue: !1
94
94
  });
95
95
  const T = f(null), A = f(null), R = f(null);
96
- S(T, (e) => o.first = !1), S(A, (e) => o.second = !1), S(R, (e) => o.third = !1);
97
- function m(e) {
98
- e === "showTable" && (o.first = !o.first), e === "showVocTable" && (o.second = !o.second), e === "showVocEntries" && (o.third === !0 || (o.third = !o.third));
96
+ S(T, (t) => o.first = !1), S(A, (t) => o.second = !1), S(R, (t) => o.third = !1);
97
+ function m(t) {
98
+ t === "showTable" && (o.first = !o.first), t === "showVocTable" && (o.second = !o.second), t === "showVocEntries" && (o.third === !0 || (o.third = !o.third));
99
99
  }
100
- function N(e) {
101
- n.context.node.input({ name: e.target.value, resource: e.target.value });
100
+ function M(t) {
101
+ n.context.node.input({ name: t.target.value, resource: t.target.value });
102
102
  }
103
- return (e, a) => (i(), l("div", z, [
104
- !n.context.attrs.multiple && p(o).activeValue ? (i(), l("div", H, [
105
- c("a", Q, b(n.context.value.name), 1),
106
- d(),
103
+ return (t, a) => (s(), l("div", z, [
104
+ !n.context.attrs.multiple && p(o).activeValue ? (s(), l("div", H, [
105
+ c("a", Q, _(n.context.value.name), 1),
106
+ u(),
107
107
  c("div", {
108
108
  class: "removeX",
109
109
  onClick: O
110
110
  })
111
- ])) : (i(), l("div", Y, [
111
+ ])) : (s(), l("div", Y, [
112
112
  c("div", Z, [
113
113
  c("div", ee, [
114
114
  c("input", {
@@ -116,49 +116,53 @@ const z = { class: "d-flex flex-column w-100 spatialWrap" }, H = {
116
116
  type: "text",
117
117
  class: "selectInputField formkit-inner",
118
118
  readonly: "readonly",
119
- placeholder: e.$t("message.dataupload.info.preferredInput"),
120
- onClick: a[0] || (a[0] = (t) => m("showTable"))
121
- }, null, 8, te),
122
- d(),
119
+ placeholder: "Select input method",
120
+ onClick: a[0] || (a[0] = (e) => m("showTable"))
121
+ }),
122
+ u(),
123
123
  L(c("ul", {
124
124
  ref_key: "I1",
125
125
  ref: T,
126
126
  class: "spatialListUpload"
127
127
  }, [
128
128
  c("li", {
129
- onClick: a[1] || (a[1] = (t) => {
130
- m("showTable"), e.man = !0, e.vocSearch && (e.vocSearch = !1);
129
+ onClick: a[1] || (a[1] = (e) => {
130
+ m("showTable"), t.man = !0, t.vocSearch && (t.vocSearch = !1);
131
131
  }),
132
132
  class: "p-2 border-b border-gray-200 choosableItemsAC"
133
- }, b(e.$t("message.dataupload.datasets.conditional.manually")), 1),
134
- d(),
133
+ }, `
134
+ Manually submit information
135
+ `),
136
+ u(),
135
137
  c("li", {
136
- onClick: a[2] || (a[2] = (t) => {
137
- m("showTable"), e.vocSearch = !0, e.man && (e.man = !1);
138
+ onClick: a[2] || (a[2] = (e) => {
139
+ m("showTable"), t.vocSearch = !0, t.man && (t.man = !1);
138
140
  }),
139
141
  class: "p-2 border-b border-gray-200 choosableItemsAC"
140
- }, b(e.$t("message.dataupload.datasets.conditional.vocabulary")), 1)
142
+ }, `
143
+ Choose from vocabulary
144
+ `)
141
145
  ], 512), [
142
146
  [q, p(o).first]
143
147
  ])
144
148
  ]),
145
- d(),
146
- e.man ? (i(), l("div", ae, [
147
- c("label", oe, [
148
- d(` Provide an URL
149
+ u(),
150
+ t.man ? (s(), l("div", te, [
151
+ c("label", ae, [
152
+ u(` Provide an URL
149
153
  `),
150
154
  c("input", {
151
155
  type: "URL",
152
156
  class: "selectInputField formkit-inner",
153
157
  placeholder: "URL",
154
- onInput: a[3] || (a[3] = (t) => N(t))
158
+ onInput: a[3] || (a[3] = (e) => M(e))
155
159
  }, null, 32)
156
160
  ])
157
161
  ])) : h("", !0),
158
- d(),
159
- e.vocSearch ? (i(), l("div", se, [
162
+ u(),
163
+ t.vocSearch ? (s(), l("div", oe, [
160
164
  c("label", ie, [
161
- d(` Choose type of vocabulary
165
+ u(` Choose type of vocabulary
162
166
  `),
163
167
  c("input", {
164
168
  id: "I2",
@@ -166,72 +170,72 @@ const z = { class: "d-flex flex-column w-100 spatialWrap" }, H = {
166
170
  class: "selectInputField formkit-inner",
167
171
  readonly: "readonly",
168
172
  placeholder: "Search the vocabulary",
169
- onClick: a[4] || (a[4] = (t) => {
173
+ onClick: a[4] || (a[4] = (e) => {
170
174
  m("showVocTable");
171
175
  })
172
176
  })
173
177
  ]),
174
- d(),
175
- p(o).second ? (i(), l("ul", {
178
+ u(),
179
+ p(o).second ? (s(), l("ul", {
176
180
  key: 0,
177
181
  ref_key: "I2",
178
182
  ref: A,
179
183
  class: "spatialListUpload"
180
184
  }, [
181
- (i(!0), l(w, null, x(p(y), (t) => (i(), l("li", {
182
- key: t,
185
+ (s(!0), l(x, null, w(p(y), (e) => (s(), l("li", {
186
+ key: e,
183
187
  class: "p-2 border-b border-gray-200 choosableItemsAC",
184
188
  onClick: (r) => {
185
- G(), t.active = !t.active, m("showVocTable"), g(s) ? s.value = "" : s = "", g(v) ? v.value = t.item : v = t.item;
189
+ G(), e.active = !e.active, m("showVocTable"), b(i) ? i.value = "" : i = "", b(v) ? v.value = e.item : v = e.item;
186
190
  }
187
- }, b(t.item), 9, le))), 128))
191
+ }, _(e.item), 9, se))), 128))
188
192
  ], 512)) : h("", !0)
189
193
  ])) : h("", !0)
190
194
  ]),
191
- d(),
192
- e.vocSearch ? (i(), l("div", ne, [
193
- (i(!0), l(w, null, x(p(y), (t) => (i(), l("div", {
194
- key: t,
195
+ u(),
196
+ t.vocSearch ? (s(), l("div", le, [
197
+ (s(!0), l(x, null, w(p(y), (e) => (s(), l("div", {
198
+ key: e,
195
199
  class: "position-relative"
196
200
  }, [
197
- t.active ? (i(), l("label", re, [
198
- d(" Search the vocabulary "),
201
+ e.active ? (s(), l("label", ne, [
202
+ u(" Search the vocabulary "),
199
203
  L(c("input", {
200
204
  id: "I3",
201
205
  type: "text",
202
- "onUpdate:modelValue": a[5] || (a[5] = (r) => g(s) ? s.value = r : s = r),
206
+ "onUpdate:modelValue": a[5] || (a[5] = (r) => b(i) ? i.value = r : i = r),
203
207
  class: "selectInputField formkit-inner",
204
- placeholder: t.item,
208
+ placeholder: e.item,
205
209
  onClick: a[6] || (a[6] = (r) => {
206
- m("showVocEntries"), g(s) ? s.value = "" : s = "";
210
+ m("showVocEntries"), b(i) ? i.value = "" : i = "";
207
211
  })
208
- }, null, 8, ce), [
209
- [B, p(s)]
212
+ }, null, 8, re), [
213
+ [B, p(i)]
210
214
  ])
211
215
  ])) : h("", !0),
212
- d(),
213
- p(o).third && t.active ? (i(), l("ul", {
216
+ u(),
217
+ p(o).third && e.active ? (s(), l("ul", {
214
218
  key: 1,
215
219
  ref_for: !0,
216
220
  ref_key: "I3",
217
221
  ref: R,
218
222
  class: "spatialListUpload"
219
223
  }, [
220
- (i(!0), l(w, null, x(p(k), (r) => (i(), l("li", {
224
+ (s(!0), l(x, null, w(p(g), (r) => (s(), l("li", {
221
225
  key: r,
222
226
  class: "p-2 border-b border-gray-200 choosableItemsAC",
223
- onClick: (u) => {
224
- n.context.node.input(r), g(s) ? s.value = r.name : s = r.name, m("showVocEntries"), p(o).third = !1, F();
227
+ onClick: (d) => {
228
+ n.context.node.input(r), b(i) ? i.value = r.name : i = r.name, m("showVocEntries"), p(o).third = !1, F();
225
229
  }
226
- }, b(r.name), 9, de))), 128))
230
+ }, _(r.name), 9, ce))), 128))
227
231
  ], 512)) : h("", !0)
228
232
  ]))), 128))
229
233
  ])) : h("", !0)
230
234
  ]))
231
235
  ]));
232
236
  }
233
- }), ke = /* @__PURE__ */ X(pe, [["__scopeId", "data-v-0e6763cf"]]);
237
+ }), ge = /* @__PURE__ */ X(de, [["__scopeId", "data-v-87799d8f"]]);
234
238
  export {
235
- ke as default
239
+ ge as default
236
240
  };
237
241
  //# 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';\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();\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 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, 'en', []) + \" (\" + 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, 'en', []) + \" (\" + 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 <input id=\"I1\" type=\"text\" class=\"selectInputField formkit-inner\" readonly=\"readonly\"\n :placeholder=\"$t('message.dataupload.info.preferredInput')\"\n @click=\"activeInput('showTable')\" />\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\"> 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 <label class=\"w-100\"> Choose type of vocabulary\n <input id=\"I2\" type=\"text\" class=\"selectInputField formkit-inner\" readonly=\"readonly\"\n placeholder=\"Search the 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 {{ 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\"> Search the vocabulary <input id=\"I3\" type=\"text\"\n v-model=\"inputText\" class=\"selectInputField formkit-inner\" :placeholder=\"el.item\"\n @click=\"activeInput('showVocEntries'); inputText = ''\">\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","watch","getAutocompleteSuggestions","onMounted","nextTick","showTable","closeAll","element","removeProperty","saveToLocal","el","pathToLocalStorage","arr","index","vocCache","text","response","r","getTranslationFor","reactive","I1","I2","I3","onClickOutside","event","activeInput","manURLInput"],"mappings":";;;;;;;;;;;;;;;;;;;;;;2CAuNAA,KAAe;AAAA,EACX,OAAO;AACH,WAAO;AAAA,MACH,KAAK;AAAA,MACL,WAAW;AAAA,IACd;AAAA,EACJ;AAEL;;;;;;AAtNA,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,EA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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';\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();\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}\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 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, 'en', []) + \" (\" + 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, 'en', []) + \" (\" + 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 <input id=\"I1\" type=\"text\"\n class=\"selectInputField formkit-inner\" readonly=\"readonly\" placeholder=\"Select input method\"\n @click=\"activeInput('showTable')\"/>\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 Manually submit information\n </li>\n <li @click=\"activeInput('showTable'); vocSearch = true; if (man) { man = false }\"\n class=\"p-2 border-b border-gray-200 choosableItemsAC\">\n Choose from 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\"> 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 <label class=\"w-100\"> Choose type of vocabulary\n <input id=\"I2\" type=\"text\" class=\"selectInputField formkit-inner\" readonly=\"readonly\"\n placeholder=\"Search the 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 {{ 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\"> Search the vocabulary <input id=\"I3\" type=\"text\"\n v-model=\"inputText\" class=\"selectInputField formkit-inner\" :placeholder=\"el.item\"\n @click=\"activeInput('showVocEntries'); inputText = ''\">\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","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":";;;;;;;;;;;;;;;;;;;;;;2CAwNAA,K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EnBA,EAAU,QAAQ,CAACA,EAAU;AAAA,IAE1C;AACA,aAASsB,EAAYlB,GAAG;AACpB,MAAAlB,EAAM,QAAQ,KAAK,MAAM,EAAE,MAAQkB,EAAE,OAAO,OAAO,UAAYA,EAAE,OAAO,MAAK,CAAE;AAAA,IACnF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
- const e = "";
1
+ const _ = "";
2
2
  export {
3
- e as default
3
+ _ as default
4
4
  };
5
5
  //# sourceMappingURL=SpatialInput.vue2.mjs.map
@@ -1,43 +1,32 @@
1
- import { getCurrentInstance as g, ref as u, onMounted as I, watchEffect as h, resolveComponent as D, openBlock as i, createElementBlock as q, createElementVNode as _, toDisplayString as $, createTextVNode as b, createBlock as n, unref as y } from "vue";
2
- import { isNil as k } from "lodash-es";
3
- import E from "axios";
4
- import { useStore as U } from "vuex";
5
- import { useI18n as C } from "vue-i18n";
6
- const M = { class: "formkitProperty DSid" }, N = {
1
+ import { getCurrentInstance as v, ref as d, resolveComponent as h, openBlock as s, createElementBlock as I, createElementVNode as g, toDisplayString as D, createTextVNode as _, createBlock as n } from "vue";
2
+ import { isNil as y } from "lodash-es";
3
+ import $ from "axios";
4
+ import { useStore as b } from "vuex";
5
+ const q = { class: "formkitProperty DSid" }, k = {
7
6
  props: ["context"]
8
- }, V = /* @__PURE__ */ Object.assign(N, {
7
+ }, B = /* @__PURE__ */ Object.assign(k, {
9
8
  __name: "UniqueIdentifierInput",
10
- setup(S) {
11
- let p = g().appContext.app.config.globalProperties.$env;
12
- const d = U(), l = u(), o = u();
13
- o.value = localStorage.getItem("dpi_duplicate"), l.value = d.getters["auth/getIsEditMode"];
14
- const { t: s, locale: B } = C();
15
- let r = {
16
- idformatvalid: "",
17
- idunique: "",
18
- required: ""
9
+ setup(U) {
10
+ let r = v().appContext.app.config.globalProperties.$env;
11
+ const i = b(), l = d(), o = d();
12
+ o.value = localStorage.getItem("dpi_duplicate"), l.value = i.getters["auth/getIsEditMode"];
13
+ const u = {
14
+ idformatvalid: "Dataset ID must only contain lower case letters, numbers and single dashes (-). Please choose a different ID.",
15
+ idunique: "This ID is already in use, please choose a different one."
19
16
  };
20
- I(() => {
21
- r = {
22
- idformatvalid: s("message.dataupload.datasets.datasetID.invalidFormat"),
23
- idunique: s("message.dataupload.datasets.datasetID.duplicate"),
24
- required: s("message.dataupload.datasets.datasetID.required")
25
- };
26
- }), h(() => {
27
- });
28
- async function m(e) {
29
- let t = !0, a = p.api.hubUrl;
30
- const f = d.getters["auth/getUserDraftIds"];
17
+ async function p(e) {
18
+ let t = !0, a = r.api.hubUrl;
19
+ const m = i.getters["auth/getUserDraftIds"];
31
20
  return new Promise(() => {
32
- if (k(e.value) || e.value === "" || e.value === void 0)
21
+ if (y(e.value) || e.value === "" || e.value === void 0)
33
22
  t = !0;
34
- else if (f.includes(e.value))
23
+ else if (m.includes(e.value))
35
24
  t = !1;
36
25
  else {
37
- const v = `${a}datasets/${e.value}?useNormalizedId=true`;
38
- E.head(v).then(() => {
26
+ const f = `${a}datasets/${e.value}?useNormalizedId=true`;
27
+ $.head(f).then(() => {
39
28
  t = !1;
40
- }).catch((F) => {
29
+ }).catch((C) => {
41
30
  t = !0;
42
31
  });
43
32
  }
@@ -47,11 +36,11 @@ const M = { class: "formkitProperty DSid" }, N = {
47
36
  return /^[a-z0-9-]*$/.test(e.value);
48
37
  }
49
38
  return (e, t) => {
50
- const a = D("FormKit");
51
- return i(), q("div", M, [
52
- _("h4", null, $(e.$t("message.dataupload.datasets.datasetID.label")), 1),
53
- b(),
54
- !l.value || o.value ? (i(), n(a, {
39
+ const a = h("FormKit");
40
+ return s(), I("div", q, [
41
+ g("h4", null, D(e.$t("message.dataupload.datasets.datasetID.label")), 1),
42
+ _(),
43
+ !l.value || o.value ? (s(), n(a, {
55
44
  key: 0,
56
45
  type: "text",
57
46
  name: "datasetID",
@@ -59,12 +48,12 @@ const M = { class: "formkitProperty DSid" }, N = {
59
48
  placeholder: e.$t("message.dataupload.datasets.datasetID.label"),
60
49
  info: e.$t("message.dataupload.datasets.datasetID.info"),
61
50
  help: e.$t("message.dataupload.datasets.datasetID.help"),
62
- "validation-rules": { idformatvalid: c, idunique: m },
51
+ "validation-rules": { idformatvalid: c, idunique: p },
63
52
  validation: "idformatvalid|idunique|required",
64
53
  "validation-visibility": "live",
65
- "validation-messages": y(r),
54
+ "validation-messages": u,
66
55
  "outer-class": "formkitCmpWrap p-3"
67
- }, null, 8, ["placeholder", "info", "help", "validation-rules", "validation-messages"])) : (i(), n(a, {
56
+ }, null, 8, ["placeholder", "info", "help", "validation-rules"])) : (s(), n(a, {
68
57
  key: 1,
69
58
  type: "text",
70
59
  name: "datasetID",
@@ -78,6 +67,6 @@ const M = { class: "formkitProperty DSid" }, N = {
78
67
  }
79
68
  });
80
69
  export {
81
- V as default
70
+ B as default
82
71
  };
83
72
  //# sourceMappingURL=UniqueIdentifierInput.vue.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"UniqueIdentifierInput.vue.mjs","sources":["../../../lib/data-provider-interface/components/UniqueIdentifierInput.vue"],"sourcesContent":["<script setup>\nimport { ref, onMounted, watchEffect } from 'vue'\nimport { isNil } from 'lodash';\nimport axios from 'axios';\nimport { useStore } from 'vuex';\nimport { getCurrentInstance } from \"vue\";\nimport { useI18n } from 'vue-i18n';\nlet env = getCurrentInstance().appContext.app.config.globalProperties.$env;\n\nconst store = useStore();\nconst isEditMode = ref();\nconst isDuplicate = ref();\nisDuplicate.value = localStorage.getItem('dpi_duplicate');\nisEditMode.value = store.getters['auth/getIsEditMode'];\nconst { t, locale } = useI18n();\n\nlet validationMessages = {\n idformatvalid: \"\",\n idunique: \"\",\n required: \"\"\n\n};\n\nonMounted(() => {\n // This is kind of buggy, its taking the strings from the wrong json (de and en is switched)\n validationMessages = {\n idformatvalid: t('message.dataupload.datasets.datasetID.invalidFormat'),\n idunique: t('message.dataupload.datasets.datasetID.duplicate'),\n required: t('message.dataupload.datasets.datasetID.required')\n };\n\n});\n\n\nwatchEffect(() => {\n\n\n});\n\n\n\nasync function idunique(node) {\n let isUniqueID = true;\n let hubUrl = env.api.hubUrl;\n const draftIDs = store.getters['auth/getUserDraftIds'];\n\n new Promise(() => {\n if (isNil(node.value) || node.value === '' || node.value === undefined) isUniqueID = true;\n else if (draftIDs.includes(node.value)) isUniqueID = false;\n else {\n const request = `${hubUrl}datasets/${node.value}?useNormalizedId=true`;\n axios.head(request)\n .then(() => {\n isUniqueID = false;\n })\n .catch((e) => {\n isUniqueID = true;\n });\n }\n });\n return isUniqueID;\n}\n\nfunction idformatvalid(node) {\n return /^[a-z0-9-]*$/.test(node.value);\n}\n\n</script>\n\n<template>\n <div class=\"formkitProperty DSid\">\n <h4>{{ $t(`message.dataupload.datasets.datasetID.label`) }}</h4>\n <FormKit v-if=\"!isEditMode || isDuplicate\" type=\"text\" name=\"datasetID\" id=\"datasetID\"\n :placeholder=\"$t(`message.dataupload.datasets.datasetID.label`)\"\n :info=\"$t(`message.dataupload.datasets.datasetID.info`)\" :help=\"$t(`message.dataupload.datasets.datasetID.help`)\"\n :validation-rules=\"{ idformatvalid, idunique }\" validation=\"idformatvalid|idunique|required\"\n validation-visibility=\"live\" :validation-messages=\"validationMessages\" outer-class=\"formkitCmpWrap p-3\">\n </FormKit>\n <FormKit v-else type=\"text\" name=\"datasetID\" id=\"datasetID\" :disabled=\"true\"\n :info=\"$t(`message.dataupload.datasets.datasetID.info`)\" :help=\"$t(`message.dataupload.datasets.datasetID.help`)\">\n </FormKit>\n </div>\n</template>\n\n<script>\nexport default {\n props: ['context']\n}\n</script>\n\n<style></style>\n"],"names":["__default__","env","getCurrentInstance","store","useStore","isEditMode","ref","isDuplicate","t","locale","useI18n","validationMessages","onMounted","watchEffect","idunique","node","isUniqueID","hub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AcR,GAAM;AAC3B,aAAO,eAAe,KAAKA,EAAK,KAAK;AAAA,IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"UniqueIdentifierInput.vue.mjs","sources":["../../../lib/data-provider-interface/components/UniqueIdentifierInput.vue"],"sourcesContent":["<script setup>\nimport { ref, onMounted, watchEffect } from 'vue'\nimport { isNil } from 'lodash';\nimport axios from 'axios';\nimport { useStore } from 'vuex';\nimport { getCurrentInstance } from \"vue\";\n\nlet env = getCurrentInstance().appContext.app.config.globalProperties.$env;\n\nconst store = useStore();\nconst isEditMode = ref();\nconst isDuplicate =ref();\nisDuplicate.value = localStorage.getItem('dpi_duplicate');\nisEditMode.value = store.getters['auth/getIsEditMode'];\n\nconst validationMessages = {\n idformatvalid: \"Dataset ID must only contain lower case letters, numbers and single dashes (-). Please choose a different ID.\",\n idunique: \"This ID is already in use, please choose a different one.\"\n};\n\nasync function idunique(node) {\n let isUniqueID = true;\n let hubUrl = env.api.hubUrl;\n const draftIDs = store.getters['auth/getUserDraftIds'];\n\n new Promise(() => {\n if (isNil(node.value) || node.value === '' || node.value === undefined) isUniqueID = true;\n else if (draftIDs.includes(node.value)) isUniqueID = false;\n else {\n const request = `${hubUrl}datasets/${node.value}?useNormalizedId=true`;\n axios.head(request)\n .then(() => {\n isUniqueID = false;\n })\n .catch((e) => {\n isUniqueID = true;\n });\n }\n });\n return isUniqueID;\n}\n\nfunction idformatvalid(node) {\n return /^[a-z0-9-]*$/.test(node.value);\n}\n\n</script>\n\n<template>\n <div class=\"formkitProperty DSid\">\n <h4>{{ $t(`message.dataupload.datasets.datasetID.label`) }}</h4>\n <FormKit v-if=\"!isEditMode || isDuplicate\" type=\"text\" name=\"datasetID\" id=\"datasetID\"\n :placeholder=\"$t(`message.dataupload.datasets.datasetID.label`)\"\n :info=\"$t(`message.dataupload.datasets.datasetID.info`)\" :help=\"$t(`message.dataupload.datasets.datasetID.help`)\"\n :validation-rules=\"{ idformatvalid, idunique }\" validation=\"idformatvalid|idunique|required\"\n validation-visibility=\"live\" :validation-messages=\"validationMessages\" outer-class=\"formkitCmpWrap p-3\">\n </FormKit>\n <FormKit v-else type=\"text\" name=\"datasetID\" id=\"datasetID\" :disabled=\"true\"\n :info=\"$t(`message.dataupload.datasets.datasetID.info`)\" :help=\"$t(`message.dataupload.datasets.datasetID.help`)\">\n </FormKit>\n </div>\n</template>\n\n<script>\nexport default {\n props: ['context']\n}\n</script>\n\n<style></style>\n"],"names":["__default__","env","getCurrentInstance","store","useStore","isEditMode","ref","isDuplicate","validationMessages","idunique","node","isUniqueID","hubUrl","draftIDs","isNil","request","axios","e","idformatvalid"],"mappings":";;;;6CAgEAA,IAAe;AAAA,EACb,OAAO,CAAC,SAAS;AACnB;;;AA3DA,QAAIC,IAAMC,EAAkB,EAAG,WAAW,IAAI,OAAO,iBAAiB;AAEtE,UAAMC,IAAQC,EAAQ,GAChBC,IAAaC,EAAG,GAChBC,IAAaD,EAAG;AACtB,IAAAC,EAAY,QAAQ,aAAa,QAAQ,eAAe,GACxDF,EAAW,QAAQF,EAAM,QAAQ,oBAAoB;AAErD,UAAMK,IAAqB;AAAA,MACzB,eAAe;AAAA,MACf,UAAU;AAAA,IACZ;AAEA,mBAAeC,EAASC,GAAM;AAC5B,UAAIC,IAAa,IACbC,IAASX,EAAI,IAAI;AACrB,YAAMY,IAAWV,EAAM,QAAQ,sBAAsB;AAErD,iBAAI,QAAQ,MAAM;AAChB,YAAIW,EAAMJ,EAAK,KAAK,KAAKA,EAAK,UAAU,MAAMA,EAAK,UAAU;AAAW,UAAAC,IAAa;AAAA,iBAC5EE,EAAS,SAASH,EAAK,KAAK;AAAG,UAAAC,IAAa;AAAA,aAChD;AACH,gBAAMI,IAAU,GAAGH,CAAM,YAAYF,EAAK,KAAK;AAC/C,UAAAM,EAAM,KAAKD,CAAO,EACf,KAAK,MAAM;AACV,YAAAJ,IAAa;AAAA,UACvB,CAAS,EACA,MAAM,CAACM,MAAM;AACZ,YAAAN,IAAa;AAAA,UACvB,CAAS;AAAA,QACJ;AAAA,MACL,CAAG,GACMA;AAAA,IACT;AAEA,aAASO,EAAcR,GAAM;AAC3B,aAAO,eAAe,KAAKA,EAAK,KAAK;AAAA,IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}