@piveau/piveau-hub-ui-modules 4.1.7 → 4.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +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\n <div class=\"position-relative formkitCmpWrap\">\n <FormKit v-if=\"isEditMode.value\" 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 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","userCats","computed","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":";;;;;;;;;;;;;;;AA0CA,UAAMA,IAAQC,GAIRC,IAAWC,EAAS,MAAMC,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,QAAQN,EAAS,MAAMC,EAAM,QAAQ,oBAAoB,CAAC;AACrE,QAAIM,IAAmBJ,EAAI,EAAE,GACzBK,IAAMC,EAAe,GACrBC,IAASP,EAAK;AAElB,IAAAO,IAASC,EAAQ,cAAc,EAAE,OAEjCC,EAAeP,GAAc,CAAAQ,MAASX,EAAS,QAAQ,EAAK;AAE5D,UAAMY,IAAW,OAAOC,MAAM;AAG1B,MAAIA,EAAE,MACFlB,EAAM,QAAQ,KAAK,MAAMkB,EAAE,EAAE,GAC7Bb,EAAS,QAAQ,CAACA,EAAS,OAC3BS,EAAQ,cAAc,EAAE,QAAQI,EAAE,IAClCL,IAASK,EAAE,SAEXlB,EAAM,QAAQ,KAAK,MAAMkB,CAAC,GAC1Bb,EAAS,QAAQ,CAACA,EAAS,OAC3BS,EAAQ,cAAc,EAAE,QAAQI,GAChCL,IAASK;AAAA,IAGjB;AACA,QAAIC,IAAgB,YAAY;AAC5B,UAAIC;AACJ,YAAMC,EACD,IAAIV,EAAI,IAAI,UAAU,oCAAoC,EAC1D,KAAK,CAAAW,MAAaF,IAAQE,CAAS,EACnC,MAAM,CAACC,MAAQ;AACZ,eAAOA,CAAG;AAAA,MACtB,CAAS,GAGLH,EAAM,KAAK,OAAO,QAAQ,QAAQ,CAAC,MAAM;AACrC,QAAII,EAAI,GAAG,OAAO,KAAK,CAACC,EAAM,EAAE,KAAK,KAAKD,EAAI,GAAG,IAAI,KAAK,CAACC,EAAM,EAAE,EAAE,KAAGf,EAAiB,MAAM,KAAK,EAAE,OAAO,OAAO,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,GAAE,CAAE;AAAA,MAC1J,CAAK,GAEDA,EAAiB,QAAQ,MAAMA,EAAiB,MAC3C,OAAO,CAAAgB,MAAQxB,EAAS,MAAM,SAASwB,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
+ {"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,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,EAAE,OAEjCC,EAAeP,GAAc,CAAAQ,MAASX,EAAS,QAAQ,EAAK;AAE5D,UAAMY,IAAW,OAAOC,MAAM;AAG1B,MAAIA,EAAE,MACFnB,EAAM,QAAQ,KAAK,MAAMmB,EAAE,EAAE,GAC7Bb,EAAS,QAAQ,CAACA,EAAS,OAC3BS,EAAQ,cAAc,EAAE,QAAQI,EAAE,IAClCL,IAASK,EAAE,SAEXnB,EAAM,QAAQ,KAAK,MAAMmB,CAAC,GAC1Bb,EAAS,QAAQ,CAACA,EAAS,OAC3BS,EAAQ,cAAc,EAAE,QAAQI,GAChCL,IAASK;AAAA,IAGjB;AACA,QAAIC,IAAgB,YAAY;AAC5B,UAAIC;AACJ,YAAMC,EACD,IAAIV,EAAI,IAAI,UAAU,oCAAoC,EAC1D,KAAK,CAAAW,MAAaF,IAAQE,CAAS,EACnC,MAAM,CAACC,MAAQ;AACZ,eAAOA,CAAG;AAAA,MACtB,CAAS,GAGLH,EAAM,KAAK,OAAO,QAAQ,QAAQ,CAAC,MAAM;AACrC,QAAII,EAAI,GAAG,OAAO,KAAK,CAACC,EAAM,EAAE,KAAK,KAAKD,EAAI,GAAG,IAAI,KAAK,CAACC,EAAM,EAAE,EAAE,KAAGf,EAAiB,MAAM,KAAK,EAAE,OAAO,OAAO,OAAO,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,GAAE,CAAE;AAAA,MAC1J,CAAK,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,54 +1,46 @@
1
- import { getCurrentInstance as f, ref as c, resolveComponent as v, openBlock as s, createElementBlock as h, createElementVNode as I, toDisplayString as D, createTextVNode as g, createBlock as o } from "vue";
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
2
  import { isNil as y } from "lodash-es";
3
- import _ from "axios";
4
- import { useStore as $ } from "vuex";
5
- const b = { class: "formkitProperty DSid" }, q = {
3
+ import $ from "axios";
4
+ import { useStore as b } from "vuex";
5
+ const q = { class: "formkitProperty DSid" }, k = {
6
6
  props: ["context"]
7
- }, B = /* @__PURE__ */ Object.assign(q, {
7
+ }, B = /* @__PURE__ */ Object.assign(k, {
8
8
  __name: "UniqueIdentifierInput",
9
- setup(k) {
10
- let d = f().appContext.app.config.globalProperties.$env;
11
- const i = $(), l = c();
12
- l.value = i.getters["auth/getIsEditMode"];
13
- const n = {
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
14
  idformatvalid: "Dataset ID must only contain lower case letters, numbers and single dashes (-). Please choose a different ID.",
15
15
  idunique: "This ID is already in use, please choose a different one."
16
16
  };
17
- async function r(e) {
18
- let t = !0, a = d.api.hubUrl;
19
- const p = i.getters["auth/getUserDraftIds"];
17
+ async function p(e) {
18
+ let t = !0, a = r.api.hubUrl;
19
+ const m = i.getters["auth/getUserDraftIds"];
20
20
  return new Promise(() => {
21
21
  if (y(e.value) || e.value === "" || e.value === void 0)
22
22
  t = !0;
23
- else if (p.includes(e.value))
23
+ else if (m.includes(e.value))
24
24
  t = !1;
25
25
  else {
26
- const m = `${a}datasets/${e.value}?useNormalizedId=true`;
27
- _.head(m).then(() => {
26
+ const f = `${a}datasets/${e.value}?useNormalizedId=true`;
27
+ $.head(f).then(() => {
28
28
  t = !1;
29
- }).catch((U) => {
29
+ }).catch((C) => {
30
30
  t = !0;
31
31
  });
32
32
  }
33
33
  }), t;
34
34
  }
35
- function u(e) {
35
+ function c(e) {
36
36
  return /^[a-z0-9-]*$/.test(e.value);
37
37
  }
38
38
  return (e, t) => {
39
- const a = v("FormKit");
40
- return s(), h("div", b, [
41
- I("h4", null, D(e.$t("message.dataupload.datasets.datasetID.label")), 1),
42
- g(),
43
- l.value ? (s(), o(a, {
44
- key: 1,
45
- type: "text",
46
- name: "datasetID",
47
- id: "datasetID",
48
- disabled: !0,
49
- info: e.$t("message.dataupload.datasets.datasetID.info"),
50
- help: e.$t("message.dataupload.datasets.datasetID.help")
51
- }, null, 8, ["info", "help"])) : (s(), o(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, {
52
44
  key: 0,
53
45
  type: "text",
54
46
  name: "datasetID",
@@ -56,12 +48,20 @@ const b = { class: "formkitProperty DSid" }, q = {
56
48
  placeholder: e.$t("message.dataupload.datasets.datasetID.label"),
57
49
  info: e.$t("message.dataupload.datasets.datasetID.info"),
58
50
  help: e.$t("message.dataupload.datasets.datasetID.help"),
59
- "validation-rules": { idformatvalid: u, idunique: r },
51
+ "validation-rules": { idformatvalid: c, idunique: p },
60
52
  validation: "idformatvalid|idunique|required",
61
53
  "validation-visibility": "live",
62
- "validation-messages": n,
54
+ "validation-messages": u,
63
55
  "outer-class": "formkitCmpWrap p-3"
64
- }, null, 8, ["placeholder", "info", "help", "validation-rules"]))
56
+ }, null, 8, ["placeholder", "info", "help", "validation-rules"])) : (s(), n(a, {
57
+ key: 1,
58
+ type: "text",
59
+ name: "datasetID",
60
+ id: "datasetID",
61
+ disabled: !0,
62
+ info: e.$t("message.dataupload.datasets.datasetID.info"),
63
+ help: e.$t("message.dataupload.datasets.datasetID.help")
64
+ }, null, 8, ["info", "help"]))
65
65
  ]);
66
66
  };
67
67
  }
@@ -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\";\n\nlet env = getCurrentInstance().appContext.app.config.globalProperties.$env;\n\nconst store = useStore();\nconst isEditMode = ref();\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\n <FormKit v-if=\"!isEditMode\" 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","validationMessages","idunique","node","isUniqueID","hubUrl","draftIDs","isNil","request","axios","e","idformatvalid"],"mappings":";;;;6CA+DAA,IAAe;AAAA,EACb,OAAO,CAAC,SAAS;AACnB;;;AA1DA,QAAIC,IAAMC,EAAkB,EAAG,WAAW,IAAI,OAAO,iBAAiB;AAEtE,UAAMC,IAAQC,EAAQ,GAChBC,IAAaC,EAAG;AACtB,IAAAD,EAAW,QAAQF,EAAM,QAAQ,oBAAoB;AAErD,UAAMI,IAAqB;AAAA,MACzB,eAAe;AAAA,MACf,UAAU;AAAA,IACZ;AAEA,mBAAeC,EAASC,GAAM;AAC5B,UAAIC,IAAa,IACbC,IAASV,EAAI,IAAI;AACrB,YAAMW,IAAWT,EAAM,QAAQ,sBAAsB;AAErD,iBAAI,QAAQ,MAAM;AAChB,YAAIU,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,324 @@
1
1
  declare const _default: import('vue').DefineComponent<Readonly<{}>, any, {
2
+ env: {
3
+ metadata: {
4
+ title: string;
5
+ description: string;
6
+ keywords: string;
7
+ };
8
+ api: {
9
+ baseUrl: string;
10
+ hubUrl: string;
11
+ qualityBaseUrl: string;
12
+ similarityBaseUrl: string;
13
+ similarityEndpoint: string;
14
+ fileUploadUrl: string;
15
+ sparqlUrl: string;
16
+ gazetteerBaseUrl: string;
17
+ corsproxyApiUrl: string;
18
+ };
19
+ authentication: {
20
+ useService: boolean;
21
+ login: {
22
+ useLogin: boolean;
23
+ loginTitle: string;
24
+ loginURL: string;
25
+ loginRedirectUri: string;
26
+ logoutTitle: string;
27
+ logoutURL: string;
28
+ logoutRedirectUri: string;
29
+ };
30
+ keycloak: {
31
+ realm: string;
32
+ clientId: string;
33
+ 'ssl-required': string;
34
+ 'public-client': boolean;
35
+ 'verify-token-audience': boolean;
36
+ 'use-resource-role-mappings': boolean;
37
+ 'confidential-port': number;
38
+ url?: string | undefined;
39
+ };
40
+ keycloakInit: {
41
+ onLoad: "check-sso" | "login-required";
42
+ pkceMethod: string;
43
+ useNone: boolean;
44
+ adapter: string;
45
+ checkLoginIframe: boolean;
46
+ checkLoginIframeInterval: number;
47
+ responseMode: "query" | "fragment" | "form_post";
48
+ flow: "standard" | "implicit" | "hybrid";
49
+ scope: string;
50
+ token?: string | undefined;
51
+ refreshToken?: string | undefined;
52
+ idToken?: string | undefined;
53
+ timeSkew?: number | undefined;
54
+ redirectUri?: string | undefined;
55
+ silentCheckSsoRedirectUri?: string | undefined;
56
+ } & {
57
+ [k: string]: unknown;
58
+ };
59
+ rtp: {
60
+ grand_type: string;
61
+ audience: string;
62
+ };
63
+ authToken: string;
64
+ authMiddleware: {
65
+ baseUrl: string;
66
+ enable: boolean;
67
+ loginRedirectUrl: string;
68
+ logoutRedirectUrl: string;
69
+ };
70
+ } & {
71
+ [k: string]: unknown;
72
+ };
73
+ routing: {
74
+ routerOptions: {
75
+ base: string;
76
+ mode: string;
77
+ };
78
+ navigation: {
79
+ showSparql: boolean;
80
+ };
81
+ pagination: {
82
+ usePagination: boolean;
83
+ usePaginationArrows: boolean;
84
+ useItemsPerPage: boolean;
85
+ defaultItemsPerPage: number;
86
+ defaultItemsPerPageOptions: number[];
87
+ };
88
+ };
89
+ content: {
90
+ datasetDetails: {
91
+ embed: {
92
+ enable: boolean;
93
+ defaultWidth: number;
94
+ defaultHeight: number;
95
+ minRange: number;
96
+ maxRange: number;
97
+ };
98
+ header: {
99
+ navigation: string;
100
+ hidePublisher: boolean;
101
+ hideDate: boolean;
102
+ };
103
+ description: {
104
+ enableMarkdownInterpretation: boolean;
105
+ };
106
+ keywords: {
107
+ showTitle: boolean;
108
+ isVisible: boolean;
109
+ collapsed: boolean;
110
+ };
111
+ dataServices: {
112
+ isVisible: boolean;
113
+ displayAll: boolean;
114
+ displayCount: number;
115
+ incrementSteps: number[];
116
+ descriptionMaxLines: number;
117
+ descriptionMaxChars: number;
118
+ };
119
+ properties: string;
120
+ distributions: {
121
+ displayAll: boolean;
122
+ displayCount: number;
123
+ incrementSteps: number[];
124
+ descriptionMaxLines: number;
125
+ descriptionMaxChars: number;
126
+ showValidationButton: boolean;
127
+ };
128
+ downloadAs: {
129
+ url: string;
130
+ enable: boolean;
131
+ proxyUrl: string;
132
+ conversionFormats: {
133
+ sourceFileFormat: string;
134
+ targetFileFormat: string[];
135
+ }[];
136
+ };
137
+ similarDatasets: {
138
+ breakpoints: {
139
+ verySimilar: {
140
+ start: number;
141
+ end: number;
142
+ };
143
+ similar: {
144
+ start: number;
145
+ end: number;
146
+ };
147
+ lessSimilar: {
148
+ start: number;
149
+ end: number;
150
+ };
151
+ };
152
+ };
153
+ pages: {
154
+ isVisible: boolean;
155
+ displayAll: boolean;
156
+ displayCount: number;
157
+ incrementSteps: number[];
158
+ descriptionMaxLines: number;
159
+ descriptionMaxChars: number;
160
+ };
161
+ visualisations: {
162
+ isVisible: boolean;
163
+ displayAll: boolean;
164
+ displayCount: number;
165
+ incrementSteps: number[];
166
+ descriptionMaxLines: number;
167
+ descriptionMaxChars: number;
168
+ };
169
+ isUsedBy: {
170
+ isVisible: boolean;
171
+ };
172
+ relatedResources: {
173
+ isVisible: boolean;
174
+ };
175
+ bulkDownload: {
176
+ buttonPosition: string;
177
+ MAX_FILE_TITLE_LENGTH: number;
178
+ MAX_REQUESTS_COUNT: number;
179
+ INTERVAL_MS: number;
180
+ TIMEOUT_MS: number;
181
+ };
182
+ quality: {
183
+ displayAll: boolean;
184
+ numberOfDisplayedQualityDistributions: number;
185
+ csvLinter: {
186
+ enable: boolean;
187
+ displayAll: boolean;
188
+ numberOfDisplayedValidationResults: number;
189
+ };
190
+ };
191
+ };
192
+ datasets: {
193
+ useSort: boolean;
194
+ useFeed: boolean;
195
+ useCatalogs: boolean;
196
+ followKeywordLinks: string;
197
+ maxKeywordLength: number;
198
+ facets: {
199
+ useDatasetFacets: boolean;
200
+ useDatasetFacetsMap: boolean;
201
+ showClearButton: boolean;
202
+ showFacetsTitle: boolean;
203
+ cutoff: number;
204
+ MIN_FACET_LIMIT: number;
205
+ MAX_FACET_LIMIT: number;
206
+ FACET_OPERATORS: {
207
+ or: string;
208
+ and: string;
209
+ };
210
+ FACET_GROUP_OPERATORS: {
211
+ or: string;
212
+ and: string;
213
+ };
214
+ defaultFacetOrder: string[];
215
+ scoringFacets: {
216
+ useScoringFacets: boolean;
217
+ defaultScoringFacets: Record<string, {
218
+ title: string;
219
+ id: string;
220
+ count: number;
221
+ minScoring: number;
222
+ maxScoring: number;
223
+ }>;
224
+ };
225
+ };
226
+ };
227
+ catalogs: {
228
+ useSort: boolean;
229
+ facets: {
230
+ useDatasetFacetsMap: boolean;
231
+ showClearButton: boolean;
232
+ showFacetsTitle: boolean;
233
+ cutoff: number;
234
+ MIN_FACET_LIMIT: number;
235
+ MAX_FACET_LIMIT: number;
236
+ FACET_OPERATORS: {
237
+ or: string;
238
+ and: string;
239
+ };
240
+ FACET_GROUP_OPERATORS: {
241
+ or: string;
242
+ and: string;
243
+ };
244
+ defaultFacetOrder: string[];
245
+ useCatalogFacets: boolean;
246
+ };
247
+ useCatalogCountries: boolean;
248
+ defaultCatalogImagePath: string;
249
+ defaultCatalogCountryID: string;
250
+ defaultCatalogID: string;
251
+ };
252
+ maps: {
253
+ options: {
254
+ id: string;
255
+ accessToken: string;
256
+ attribution: string;
257
+ };
258
+ mapVisible: boolean;
259
+ useAnimation: boolean;
260
+ location: [number[], number];
261
+ spatialType: "Point" | "Polygon";
262
+ height: string;
263
+ width: string;
264
+ mapContainerId: string;
265
+ urlTemplate: string;
266
+ geoBoundsId: string;
267
+ sender: {
268
+ height: string;
269
+ width: string;
270
+ mapContainerId: string;
271
+ startBounds: [[number, number], [number, number]];
272
+ };
273
+ receiver: {
274
+ height: string;
275
+ width: string;
276
+ mapContainerId: string;
277
+ startBounds: [[number, number], [number, number]];
278
+ attributionPosition: "topleft" | "topright" | "bottomleft" | "bottomright";
279
+ };
280
+ mapStyle: {
281
+ color: string;
282
+ fillColor: string;
283
+ fillOpacity: number;
284
+ weight: number;
285
+ radius: number;
286
+ };
287
+ };
288
+ dataProviderInterface: {
289
+ useService: boolean;
290
+ uploadFileTypes: string[];
291
+ enableFileUploadReplace: boolean;
292
+ basePath: string;
293
+ specification: "dcatap" | "dcatapde";
294
+ annifIntegration: boolean;
295
+ annifLinkTheme: string;
296
+ annifLinkSubject: string;
297
+ buttons: {
298
+ Dataset: boolean;
299
+ Catalogue: boolean;
300
+ };
301
+ doiRegistrationService: {
302
+ persistentIdentifierType: string;
303
+ };
304
+ };
305
+ };
306
+ languages: {
307
+ useLanguageSelector: boolean;
308
+ locale: string;
309
+ fallbackLocale: string;
310
+ };
311
+ themes: {
312
+ header: string;
313
+ };
314
+ tracker: {
315
+ isPiwikPro: boolean;
316
+ siteId: string;
317
+ trackerUrl: string;
318
+ };
319
+ };
2
320
  values: {};
3
- isDuplication: boolean;
321
+ isDuplication: string | null;
4
322
  duplicatedID: string;
5
323
  modalProps: {
6
324
  loading: boolean;