@piveau/piveau-hub-ui-modules 4.3.12 → 4.3.13
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/data-provider-interface/DPIMenu.vue.d.ts +2 -2
- package/dist/data-provider-interface/DataProviderInterface.vue.d.ts +29 -7
- package/dist/data-provider-interface/DataProviderInterface.vue.mjs +12 -69
- package/dist/data-provider-interface/DataProviderInterface.vue.mjs.map +1 -1
- package/dist/data-provider-interface/DataProviderInterface.vue2.mjs +91 -2
- package/dist/data-provider-interface/DataProviderInterface.vue2.mjs.map +1 -1
- package/dist/data-provider-interface/DataProviderInterface.vue3.mjs +5 -0
- package/dist/data-provider-interface/DataProviderInterface.vue3.mjs.map +1 -0
- package/dist/data-provider-interface/components/AutocompleteInput.vue.mjs +30 -37
- package/dist/data-provider-interface/components/AutocompleteInput.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/DataFetchingComponent.vue.d.ts +1 -1
- package/dist/data-provider-interface/components/DataFetchingComponent.vue.mjs +23 -18
- package/dist/data-provider-interface/components/DataFetchingComponent.vue.mjs.map +1 -1
- package/dist/data-provider-interface/components/FileUpload.vue.d.ts +1 -1
- package/dist/data-provider-interface/components/Navigation.vue.d.ts +4 -4
- package/dist/data-provider-interface/composables/index.d.ts +2 -0
- package/dist/data-provider-interface/composables/useDpiContext.d.ts +17 -0
- package/dist/data-provider-interface/composables/useDpiContext.mjs +19 -0
- package/dist/data-provider-interface/composables/useDpiContext.mjs.map +1 -0
- package/dist/data-provider-interface/composables/useDpiEditMode.d.ts +16 -0
- package/dist/data-provider-interface/composables/useDpiEditMode.mjs +39 -0
- package/dist/data-provider-interface/composables/useDpiEditMode.mjs.map +1 -0
- package/dist/data-provider-interface/config/dpi-spec-config.mjs +1 -0
- package/dist/data-provider-interface/config/dpi-spec-config.mjs.map +1 -1
- package/dist/data-provider-interface/index.d.ts +2 -0
- package/dist/data-provider-interface/index.mjs +11 -0
- package/dist/data-provider-interface/index.mjs.map +1 -0
- package/dist/data-provider-interface/store/dpiStore.d.ts +31 -15
- package/dist/data-provider-interface/store/dpiStore.mjs +30 -13
- package/dist/data-provider-interface/store/dpiStore.mjs.map +1 -1
- package/dist/data-provider-interface/store/modules/autocompleteStore.d.ts +3 -1
- package/dist/data-provider-interface/store/modules/autocompleteStore.mjs +28 -29
- package/dist/data-provider-interface/store/modules/autocompleteStore.mjs.map +1 -1
- package/dist/data-provider-interface/store/modules/conversionStore.d.ts +6 -6
- package/dist/data-provider-interface/store/modules/conversionStore.mjs +21 -22
- package/dist/data-provider-interface/store/modules/conversionStore.mjs.map +1 -1
- package/dist/data-provider-interface/store/modules/formSchemaStore.d.ts +5 -3
- package/dist/data-provider-interface/store/modules/formSchemaStore.mjs +29 -29
- package/dist/data-provider-interface/store/modules/formSchemaStore.mjs.map +1 -1
- package/dist/data-provider-interface/store/modules/navigationStore.d.ts +1 -1
- package/dist/data-provider-interface/store/modules/navigationStore.mjs +13 -14
- package/dist/data-provider-interface/store/modules/navigationStore.mjs.map +1 -1
- package/dist/data-provider-interface/utils/RDFconverter.mjs +63 -60
- package/dist/data-provider-interface/utils/RDFconverter.mjs.map +1 -1
- package/dist/data-provider-interface/views/DraftsPage.vue.d.ts +1 -1
- package/dist/data-provider-interface/views/InputPage.vue.d.ts +3 -3
- package/dist/data-provider-interface/views/OverviewPage/Properties/URIProp.vue.mjs +1 -1
- package/dist/data-provider-interface/views/OverviewPage.vue.d.ts +1 -1
- package/dist/datasetDetails/DatasetDetails.vue.d.ts +1 -1
- package/dist/datasetDetails/DatasetDetailsDescription.vue.d.ts +1 -1
- package/dist/datasetDetails/distributions/DistributionFormat.vue.d.ts +3 -3
- package/dist/datasetDetails/distributions/DownloadAllDistributions.vue.d.ts +2 -2
- package/dist/datasetDetails/distributions/distributionActions/DistributionDownload.vue.d.ts +3 -3
- package/dist/datasetDetails/header/DatasetDetailsHeaderTitle.vue.d.ts +1 -1
- package/dist/datasetDetails/navigation/DatasetDetailsNavigation.vue.d.ts +1 -1
- package/dist/datasetDetails/navigation/DatasetDetailsNavigationLinks.vue.d.ts +1 -1
- package/dist/embed/EmbedDataset.vue.d.ts +1 -1
- package/dist/embed/EmbedDatasetSnippet.vue.d.ts +2 -2
- package/dist/external/@vueuse/core/index +129 -80
- package/dist/external/@vueuse/core/index.map +1 -1
- package/dist/external/@vueuse/shared/index +121 -17
- package/dist/external/@vueuse/shared/index.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +250 -248
- package/dist/index.mjs.map +1 -1
- package/dist/piveau-hub-ui-modules.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AutocompleteInput.vue.mjs","sources":["../../../lib/data-provider-interface/components/AutocompleteInput.vue"],"sourcesContent":["<template>\n <div class=\"formkitProperty\">\n\n <!-- need to make a condition for the licence property of the distribution - otherwise the dropdown doesnt work-->\n\n <h4 class=\"formkitHeader\" v-if=\"inDis\">\n {{ $t('message.dataupload.distributions.' + props.context.attrs.identifier + '.label') }}\n </h4>\n <h4 v-if=\"props.context.attrs.identifier != 'licence' && !inDis\">{{ $t('message.dataupload.datasets.' +\n props.context.attrs.identifier + '.label') }}</h4>\n\n <div class=\"formkitCmpWrap\">\n\n <div class=\"formkit-outer\">\n <div class=\"d-flex formkit-inner\" v-if=\"!props.context.attrs.multiple && props.context.value.name\">\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=\"d-flex align-items-center justify-content-center formkit-inner mb-2\">\n <!-- <div class=\"infoI\">\n <div class=\"tooltipFormkit\">{{ props.context.attrs.info }}</div>\n </div> -->\n <input class=\"autocompleteInputfield\" :placeholder=\"props.context.attrs.placeholder\" v-model=\"inputText\"\n type=\"text\" v-on:keyup=\"getAutocompleteSuggestions($event)\" @click=\"activeList = !activeList\">\n </div>\n <ul ref=\"dropdownList\" v-show=\"activeList\" class=\"autocompleteResultList\">\n <li v-for=\"match in matches\" :key=\"match\" @click=\"setValue(match); activeList = !activeList\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{ match.name }}\n </li>\n </ul>\n <div v-if=\"instance.content.dataProviderInterface.annifIntegration && props.context.attrs.annifTheme\"\n class=\"d-flex flex-wrap\">\n <div v-for=\"item in listOfValues\" :key=\"item\">\n <div class=\"activeResultsAutocompleteWrapper\">\n <div class=\"d-flex\" @click=\"item.activeValue = !item.activeValue;\">\n <span>{{ item.name }}</span>\n <div class=\"removeX\" @click=\"removeMultipleProperty(item)\"></div>\n </div>\n </div>\n </div>\n <div class=\"w-100 mt-4\">\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <h3>{{ $t('message.dataupload.info.suggestions') }}</h3>\n <span>{{ $t('message.dataupload.info.suggestionText') }}</span>\n <button class=\"navlikeButton\" type=\"button\"\n @click=\"fillAnnifsuggestions(); annifTrigger.value = true\">{{ $t('message.dataupload.info.tryIt')\n }}</button>\n </div>\n <div class=\"annifresultContainer\" v-if=\"annifTrigger.value\">\n <div v-for=\"item in annifSelectionList\" :key=\"item\" class=\"d-flex \">\n <div class=\"activeResultsAutocompleteWrapper annifResults\"\n :class=\"{ loadMore: item.resource === 'invalid' }\"\n @click=\"item.activeValue = !item.activeValue; updateAnnifselection(item)\">\n <div class=\"d-flex\">\n <span>{{ item.name }}</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div v-else class=\"d-flex flex-wrap\">\n <div class=\"activeResultsAutocompleteWrapper\" v-for=\"item in props.context.value\" :key=\"item\">\n <span>{{ item.name }}</span>\n <div class=\"removeX\" @click=\"removeMultipleProperty(item)\"></div>\n </div>\n </div>\n <div class=\"formkit-wrapper\">\n <div v-html=\"props.context.help\" class=\"formkit-help\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script setup>\nimport { ref, watch, computed, onMounted, watchEffect } from 'vue';\nimport { useStore } from 'vuex';\nimport { getTranslationFor } from \"../../utils/helpers\";\nimport { getCurrentInstance } from \"vue\";\nimport { getNode } from '@formkit/core'\nimport { onClickOutside } from '@vueuse/core'\nimport { useI18n } from 'vue-i18n';\n\nimport qs from 'qs';\nimport axios from 'axios';\n\nlet instance = getCurrentInstance().appContext.app.config.globalProperties.$env\n\nconst props = defineProps({\n context: Object\n})\nconst store = useStore();\nconst { t,locale } = useI18n();\n\nlet listOfValues = computed(() => {\n return props.context.value;\n})\n\nlet selection;\nlet voc = props.context.attrs.voc;\n\nlet matchesSearchstring = computed(() => {\n return t('message.dataupload.info.searchVocabulary')\n})\nlet matchesNothingFound = computed(() => {\n return t('message.dataupload.info.matchesNothingFound')\n})\nlet matches = ref({\n value: { name: matchesSearchstring }\n})\nlet activeList = ref()\nlet dropdownList = ref(null)\nlet inputText = ref({})\nlet cacheList = [];\nlet annifList = [];\nlet annifTrigger = ref({\n value: false\n});\nlet initialValues = ref();\nlet annifSelectionList = ref({})\n\nonMounted(async () => {\n inputText.value = \"\"\n});\nlet inDis = computed(() => {\n try {\n if (props.context.attrs.class.includes(\"inDistribution\")) {\n return true\n }\n } catch (error) {\n\n }\n\n\n});\nwatch(matches, async () => { })\nwatch(annifSelectionList, async () => { })\n\nconst requestURIname = async (res) => {\n\n if (res != undefined) {\n let vocMatch =\n voc === \"iana-media-types\" ||\n voc === \"spdx-checksum-algorithm\";\n\n let name;\n\n await store.dispatch('dpiStore/requestResourceName', { voc: voc, uri: res, envs: instance }).then(\n (response) => {\n if (props.context.attrs.property === 'dcatde:politicalGeocodingURI') {\n if (response != undefined) {\n let result = vocMatch\n ? response.data.result.results\n .filter((dataset) => dataset.resource === res)\n .map((dataset) => dataset.alt_label)[0].en\n : getTranslationFor(response.data.result.alt_label, 'en', []);\n name = result;\n }\n } else {\n\n if (response != undefined) {\n let result = vocMatch\n ? response.data.result.results\n .filter((dataset) => dataset.resource === res)\n .map((dataset) => dataset.pref_label)[0].en\n : getTranslationFor(response.data.result.pref_label, 'en', []);\n name = result;\n\n }\n }\n }\n );\n return name\n }\n\n}\n\nwatchEffect(async () => {\n const values = listOfValues.value;\n\n // single URI's\n if (values.hasOwnProperty('name')) {\n if (values.name === values.resource) {\n let uriName;\n if (!props.context.attrs.multiple) {\n uriName = requestURIname(values.resource)\n props.context.node.input({ name: await uriName, resource: values.resource })\n\n }\n }\n }\n // multiple URI's\n if (values.length >= 1) {\n let uriNameList = [];\n for (let index = 0; index < values.length; index++) {\n if (values[index].name === values[index].resource) {\n uriNameList.push({ name: await requestURIname(values[index].resource), resource: values[index].resource })\n props.context.node.input(uriNameList)\n }\n }\n }\n});\nfunction findPropertyToUpdate(trigger) {\n\n let finalPath = { step: '', prop: props.context.node.name }\n let pathToLocalStorage = JSON.parse(localStorage.getItem('dpi_datasets'));\n\n for (let index = 0; index < Object.keys(pathToLocalStorage).length; index++) {\n for (let innerIndex = 0; innerIndex < Object.keys(pathToLocalStorage)[index].length; innerIndex++) {\n let ntry = Object.entries((pathToLocalStorage))\n try {\n Object.keys(ntry[index][innerIndex]).filter(e => {\n if (e === props.context.node.name) {\n finalPath.step = ntry[index][0]\n\n if (trigger === 'erase') {\n\n selection = {}\n pathToLocalStorage[finalPath.step][finalPath.prop] = selection\n }\n if (typeof selection === 'object') {\n\n pathToLocalStorage[finalPath.step][finalPath.prop] = selection\n }\n else pathToLocalStorage[finalPath.step][finalPath.prop] = selection\n localStorage.setItem('dpi_datasets', JSON.stringify(pathToLocalStorage))\n }\n });\n } catch (error) {\n }\n }\n }\n\n window.removeEventListener(\"click\", onClickOutside);\n}\nonClickOutside(dropdownList, event => activeList.value = false)\nlet annifHandlerTheme = async (input, limit) => {\n\n let finalLimit = 10;\n if (limit != undefined) {\n finalLimit = finalLimit + 10\n }\n\n let query = qs.stringify({\n 'text': input,\n 'limit': finalLimit\n });\n\n\n var config = {\n method: 'post',\n url: voc == \"eurovoc\"\n ? instance.content.dataProviderInterface.annifLinkSubject\n : instance.content.dataProviderInterface.annifLinkTheme,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Accept': 'application/json'\n },\n data: query\n };\n\n let list = []\n\n axios(config)\n .then(async (response) => {\n\n for (let i = 0; i < response.data.results.length; i++) {\n\n\n annifList[i] = { \"name\": response.data.results[i].label, \"resource\": response.data.results[i].uri, \"activeValue\": false }\n }\n let annifCacheList = []\n if (listOfValues.value.length > 0) {\n listOfValues.value.forEach(element => {\n annifCacheList.push({ \"name\": element.name, \"resource\": element.resource, \"activeValue\": true })\n });\n }\n if (response.data.results.length > 9) {\n annifList[annifList.length + 1] = { \"name\": \"...\", \"resource\": \"invalid\", \"activeValue\": false }\n }\n\n annifSelectionList.value = eraseDuplicates(annifCacheList, annifList)\n\n })\n .catch(function (error) {\n console.log(error);\n });\n}\nasync function updateAnnifselection(item) {\n\n if (item.resource === 'invalid') {\n fillAnnifsuggestions(5);\n }\n else {\n setValue({ name: item.name, resource: item.resource })\n fillAnnifsuggestions()\n }\n}\nfunction eraseDuplicates(array1, array2) {\n\n let mergedArray = array1.concat(array2);\n let filteredArray = [];\n let resourceSet = new Set();\n\n mergedArray.forEach(obj => {\n if (!resourceSet.has(obj.resource)) {\n resourceSet.add(obj.resource);\n if (!obj.activeValue) {\n filteredArray.push(obj);\n }\n }\n });\n\n\n return filteredArray;\n}\nconst fillAnnifsuggestions = async (limitChange) => {\n\n let arr = getNode('Mandatory').value['dct:description']\n for (let i = 0; i < arr.length; i++) {\n if (arr[i]['@language'] === 'en') {\n if (limitChange != undefined) {\n await annifHandlerTheme(arr[i]['@value'], 5)\n }\n else await annifHandlerTheme(arr[i]['@value'])\n }\n }\n\n}\n\n// Need to append the classes to the formkit-outer element\nprops.context.classes.outer += ' autocompleteInput ' + props.context.attrs.identifier\n\nconst setValue = async (e) => {\n if (Object.keys(e).length === 1) {\n return\n }\n if (listOfValues.value.length > 0) {\n\n cacheList = listOfValues.value\n }\n\n // when its a multi input\n if (props.context.attrs.multiple) {\n // check for doubled values\n if (cacheList.length != 0) {\n let filteredProperty = { name: e.name, resource: e.resource };\n let filteredList = cacheList.filter((element) => element.name != e.name);\n filteredList.push(filteredProperty)\n selection = filteredList;\n await props.context.node.input(selection);\n\n }\n else {\n cacheList.push({ name: e.name, resource: e.resource })\n selection = cacheList\n await props.context.node.input(selection);\n }\n\n }\n else if (e.resource === \"invalid\") return\n else if (e === \"erase\") { await props.context.node.input({}); findPropertyToUpdate(e) }\n else {\n selection = { name: e.name, resource: e.resource };\n await props.context.node.input(selection);\n }\n findPropertyToUpdate();\n}\n\nconst getAutocompleteSuggestions = async (e) => {\n let innerText = e.target.value\nconsole.log(locale);\n\n\n await store.dispatch('dpiStore/requestAutocompleteSuggestions', { voc: voc, text: innerText, 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 if (results.length === 0) {\n matches.value = { value: { name: matchesNothingFound } }\n }\n else matches.value = results;\n });\n}\n\nfunction removeProperty(e) {\n props.context.node.input({})\n setValue('erase');\n}\nfunction removeMultipleProperty(e) {\n\n if (instance.content.dataProviderInterface.annifIntegration) {\n fillAnnifsuggestions()\n }\n if (listOfValues.value.length > 0) {\n cacheList = listOfValues.value\n }\n // Get Index in the array where all values of the Span are stored and cut it out of the list of Values\n cacheList.splice(cacheList.findIndex((element) => element.name == e.name), 1)\n selection = cacheList;\n props.context.node.input(selection);\n findPropertyToUpdate();\n}\n</script>\n"],"names":["instance","getCurrentInstance","props","__props","store","useStore","t","locale","useI18n","listOfValues","computed","selection","voc","matchesSearchstring","matchesNothingFound","matches","ref","activeList","dropdownList","inputText","cacheList","annifList","annifTrigger","annifSelectionList","onMounted","inDis","watch","requestURIname","res","vocMatch","name","response","dataset","getTranslationFor","watchEffect","values","uriName","uriNameList","index","findPropertyToUpdate","trigger","finalPath","pathToLocalStorage","innerIndex","ntry","e","onClickOutside","event","annifHandlerTheme","input","limit","finalLimit","query","qs","config","axios","i","annifCacheList","element","eraseDuplicates","error","updateAnnifselection","item","fillAnnifsuggestions","setValue","array1","array2","mergedArray","filteredArray","resourceSet","obj","limitChange","arr","getNode","filteredProperty","filteredList","getAutocompleteSuggestions","innerText","results","r","removeProperty","removeMultipleProperty"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4FA,QAAIA,IAAWC,GAAkB,EAAG,WAAW,IAAI,OAAO,iBAAiB;AAE3E,UAAMC,IAAQC,GAGRC,IAAQC,GAAQ,GAChB,EAAE,GAAAC,GAAE,QAAAC,MAAWC;AAErB,QAAIC,IAAeC,EAAS,MACnBR,EAAM,QAAQ,KACtB,GAEGS,GACAC,IAAMV,EAAM,QAAQ,MAAM,KAE1BW,IAAsBH,EAAS,MAC1BJ,EAAE,0CAA0C,CACpD,GACGQ,IAAsBJ,EAAS,MAC1BJ,EAAE,6CAA6C,CACvD,GACGS,IAAUC,EAAI;AAAA,MAChB,OAAO,EAAE,MAAMH,EAAqB;AAAA,IACtC,CAAC,GACGI,IAAaD,EAAK,GAClBE,IAAeF,EAAI,IAAI,GACvBG,IAAYH,EAAI,EAAE,GAClBI,IAAY,CAAA,GACZC,IAAY,CAAA,GACZC,IAAeN,EAAI;AAAA,MACrB,OAAO;AAAA,IACT,CAAC;AACmB,IAAAA,EAAM;AAC1B,QAAIO,IAAqBP,EAAI,EAAE;AAE/B,IAAAQ,GAAU,YAAY;AACpB,MAAAL,EAAU,QAAQ;AAAA,IACpB,CAAC;AACD,QAAIM,IAAQf,EAAS,MAAM;AACzB,UAAI;AACF,YAAIR,EAAM,QAAQ,MAAM,MAAM,SAAS,gBAAgB;AACrD,iBAAO;AAAA,MAEV,QAAe;AAAA,MAEf;AAAA,IAGH,CAAC;AACD,IAAAwB,EAAMX,GAAS,YAAY;AAAA,KAAG,GAC9BW,EAAMH,GAAoB,YAAY;AAAA,KAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"AutocompleteInput.vue.mjs","sources":["../../../lib/data-provider-interface/components/AutocompleteInput.vue"],"sourcesContent":["<template>\n <div class=\"formkitProperty\">\n\n <!-- need to make a condition for the licence property of the distribution - otherwise the dropdown doesnt work-->\n\n <h4 class=\"formkitHeader\" v-if=\"inDis\">\n {{ $t('message.dataupload.distributions.' + props.context.attrs.identifier + '.label') }}\n </h4>\n <h4 v-if=\"props.context.attrs.identifier != 'licence' && !inDis\">{{ $t('message.dataupload.datasets.' +\n props.context.attrs.identifier + '.label') }}</h4>\n\n <div class=\"formkitCmpWrap\">\n\n <div class=\"formkit-outer\">\n <div class=\"d-flex formkit-inner\" v-if=\"!props.context.attrs.multiple && props.context.value.name\">\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=\"d-flex align-items-center justify-content-center formkit-inner mb-2\">\n <!-- <div class=\"infoI\">\n <div class=\"tooltipFormkit\">{{ props.context.attrs.info }}</div>\n </div> -->\n <input class=\"autocompleteInputfield\" :placeholder=\"props.context.attrs.placeholder\" v-model=\"inputText\"\n type=\"text\" v-on:keyup=\"getAutocompleteSuggestions($event)\" @click=\"activeList = !activeList\">\n </div>\n <ul ref=\"dropdownList\" v-show=\"activeList\" class=\"autocompleteResultList\">\n <li v-for=\"match in matches\" :key=\"match\" @click=\"setValue(match); activeList = !activeList\"\n class=\"p-2 border-b border-gray-200 data-[selected=true]:bg-blue-100 choosableItemsAC\">{{ match.name }}\n </li>\n </ul>\n <div v-if=\"instance.content.dataProviderInterface.annifIntegration && props.context.attrs.annifTheme\"\n class=\"d-flex flex-wrap\">\n <div v-for=\"item in listOfValues\" :key=\"item\">\n <div class=\"activeResultsAutocompleteWrapper\">\n <div class=\"d-flex\" @click=\"item.activeValue = !item.activeValue;\">\n <span>{{ item.name }}</span>\n <div class=\"removeX\" @click=\"removeMultipleProperty(item)\"></div>\n </div>\n </div>\n </div>\n <div class=\"w-100 mt-4\">\n <div class=\"d-flex justify-content-between align-items-center flex-wrap\">\n <h3>{{ $t('message.dataupload.info.suggestions') }}</h3>\n <span>{{ $t('message.dataupload.info.suggestionText') }}</span>\n <button class=\"navlikeButton\" type=\"button\"\n @click=\"fillAnnifsuggestions(); annifTrigger.value = true\">{{ $t('message.dataupload.info.tryIt')\n }}</button>\n </div>\n <div class=\"annifresultContainer\" v-if=\"annifTrigger.value\">\n <div v-for=\"item in annifSelectionList\" :key=\"item\" class=\"d-flex \">\n <div class=\"activeResultsAutocompleteWrapper annifResults\"\n :class=\"{ loadMore: item.resource === 'invalid' }\"\n @click=\"item.activeValue = !item.activeValue; updateAnnifselection(item)\">\n <div class=\"d-flex\">\n <span>{{ item.name }}</span>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n </div>\n <div v-else class=\"d-flex flex-wrap\">\n <div class=\"activeResultsAutocompleteWrapper\" v-for=\"item in props.context.value\" :key=\"item\">\n <span>{{ item.name }}</span>\n <div class=\"removeX\" @click=\"removeMultipleProperty(item)\"></div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n</template>\n<script setup>\nimport { ref, watch, computed, onMounted, watchEffect } from 'vue';\nimport { useStore } from 'vuex';\nimport { getTranslationFor } from \"../../utils/helpers\";\nimport { getCurrentInstance } from \"vue\";\nimport { getNode } from '@formkit/core'\nimport { onClickOutside } from '@vueuse/core'\nimport { useI18n } from 'vue-i18n';\n\nimport qs from 'qs';\nimport axios from 'axios';\n\nlet instance = getCurrentInstance().appContext.app.config.globalProperties.$env\n\nconst props = defineProps({\n context: Object\n})\nconst store = useStore();\nconst { t,locale } = useI18n();\n\nlet listOfValues = computed(() => {\n return props.context.value;\n})\n\nlet selection;\nlet voc = props.context.attrs.voc;\n\nlet matchesSearchstring = computed(() => {\n return t('message.dataupload.info.searchVocabulary')\n})\nlet matchesNothingFound = computed(() => {\n return t('message.dataupload.info.matchesNothingFound')\n})\nlet matches = ref({\n value: { name: matchesSearchstring }\n})\nlet activeList = ref()\nlet dropdownList = ref(null)\nlet inputText = ref({})\nlet cacheList = [];\nlet annifList = [];\nlet annifTrigger = ref({\n value: false\n});\nlet initialValues = ref();\nlet annifSelectionList = ref({})\n\nonMounted(async () => {\n inputText.value = \"\"\n});\nlet inDis = computed(() => {\n try {\n if (props.context.attrs.class.includes(\"inDistribution\")) {\n return true\n }\n } catch (error) {\n\n }\n\n\n});\nwatch(matches, async () => { })\nwatch(annifSelectionList, async () => { })\n\nconst requestURIname = async (res) => {\n\n if (res != undefined) {\n let vocMatch =\n voc === \"iana-media-types\" ||\n voc === \"spdx-checksum-algorithm\";\n\n let name;\n\n await store.dispatch('dpiStore/requestResourceName', { voc: voc, uri: res, envs: instance }).then(\n (response) => {\n if (props.context.attrs.property === 'dcatde:politicalGeocodingURI') {\n if (response != undefined) {\n let result = vocMatch\n ? response.data.result.results\n .filter((dataset) => dataset.resource === res)\n .map((dataset) => dataset.alt_label)[0].en\n : getTranslationFor(response.data.result.alt_label, 'en', []);\n name = result;\n }\n } else {\n\n if (response != undefined) {\n let result = vocMatch\n ? response.data.result.results\n .filter((dataset) => dataset.resource === res)\n .map((dataset) => dataset.pref_label)[0].en\n : getTranslationFor(response.data.result.pref_label, 'en', []);\n name = result;\n\n }\n }\n }\n );\n return name\n }\n\n}\n\nwatchEffect(async () => {\n const values = listOfValues.value;\n\n // single URI's\n if (values.hasOwnProperty('name')) {\n if (values.name === values.resource) {\n let uriName;\n if (!props.context.attrs.multiple) {\n uriName = requestURIname(values.resource)\n props.context.node.input({ name: await uriName, resource: values.resource })\n\n }\n }\n }\n // multiple URI's\n if (values.length >= 1) {\n let uriNameList = [];\n for (let index = 0; index < values.length; index++) {\n if (values[index].name === values[index].resource) {\n uriNameList.push({ name: await requestURIname(values[index].resource), resource: values[index].resource })\n props.context.node.input(uriNameList)\n }\n }\n }\n});\nfunction findPropertyToUpdate(trigger) {\n\n let finalPath = { step: '', prop: props.context.node.name }\n let pathToLocalStorage = JSON.parse(localStorage.getItem('dpi_datasets'));\n\n for (let index = 0; index < Object.keys(pathToLocalStorage).length; index++) {\n for (let innerIndex = 0; innerIndex < Object.keys(pathToLocalStorage)[index].length; innerIndex++) {\n let ntry = Object.entries((pathToLocalStorage))\n try {\n Object.keys(ntry[index][innerIndex]).filter(e => {\n if (e === props.context.node.name) {\n finalPath.step = ntry[index][0]\n\n if (trigger === 'erase') {\n\n selection = {}\n pathToLocalStorage[finalPath.step][finalPath.prop] = selection\n }\n if (typeof selection === 'object') {\n\n pathToLocalStorage[finalPath.step][finalPath.prop] = selection\n }\n else pathToLocalStorage[finalPath.step][finalPath.prop] = selection\n localStorage.setItem('dpi_datasets', JSON.stringify(pathToLocalStorage))\n }\n });\n } catch (error) {\n }\n }\n }\n\n window.removeEventListener(\"click\", onClickOutside);\n}\nonClickOutside(dropdownList, event => activeList.value = false)\nlet annifHandlerTheme = async (input, limit) => {\n\n let finalLimit = 10;\n if (limit != undefined) {\n finalLimit = finalLimit + 10\n }\n\n let query = qs.stringify({\n 'text': input,\n 'limit': finalLimit\n });\n\n\n var config = {\n method: 'post',\n url: voc == \"eurovoc\"\n ? instance.content.dataProviderInterface.annifLinkSubject\n : instance.content.dataProviderInterface.annifLinkTheme,\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n 'Accept': 'application/json'\n },\n data: query\n };\n\n let list = []\n\n axios(config)\n .then(async (response) => {\n\n for (let i = 0; i < response.data.results.length; i++) {\n\n\n annifList[i] = { \"name\": response.data.results[i].label, \"resource\": response.data.results[i].uri, \"activeValue\": false }\n }\n let annifCacheList = []\n if (listOfValues.value.length > 0) {\n listOfValues.value.forEach(element => {\n annifCacheList.push({ \"name\": element.name, \"resource\": element.resource, \"activeValue\": true })\n });\n }\n if (response.data.results.length > 9) {\n annifList[annifList.length + 1] = { \"name\": \"...\", \"resource\": \"invalid\", \"activeValue\": false }\n }\n\n annifSelectionList.value = eraseDuplicates(annifCacheList, annifList)\n\n })\n .catch(function (error) {\n console.log(error);\n });\n}\nasync function updateAnnifselection(item) {\n\n if (item.resource === 'invalid') {\n fillAnnifsuggestions(5);\n }\n else {\n setValue({ name: item.name, resource: item.resource })\n fillAnnifsuggestions()\n }\n}\nfunction eraseDuplicates(array1, array2) {\n\n let mergedArray = array1.concat(array2);\n let filteredArray = [];\n let resourceSet = new Set();\n\n mergedArray.forEach(obj => {\n if (!resourceSet.has(obj.resource)) {\n resourceSet.add(obj.resource);\n if (!obj.activeValue) {\n filteredArray.push(obj);\n }\n }\n });\n\n\n return filteredArray;\n}\nconst fillAnnifsuggestions = async (limitChange) => {\n\n let arr = getNode('Mandatory').value['dct:description']\n for (let i = 0; i < arr.length; i++) {\n if (arr[i]['@language'] === 'en') {\n if (limitChange != undefined) {\n await annifHandlerTheme(arr[i]['@value'], 5)\n }\n else await annifHandlerTheme(arr[i]['@value'])\n }\n }\n\n}\n\n// Need to append the classes to the formkit-outer element\nprops.context.classes.outer += ' autocompleteInput ' + props.context.attrs.identifier\n\nconst setValue = async (e) => {\n if (Object.keys(e).length === 1) {\n return\n }\n if (listOfValues.value.length > 0) {\n\n cacheList = listOfValues.value\n }\n\n // when its a multi input\n if (props.context.attrs.multiple) {\n // check for doubled values\n if (cacheList.length != 0) {\n let filteredProperty = { name: e.name, resource: e.resource };\n let filteredList = cacheList.filter((element) => element.name != e.name);\n filteredList.push(filteredProperty)\n selection = filteredList;\n await props.context.node.input(selection);\n\n }\n else {\n cacheList.push({ name: e.name, resource: e.resource })\n selection = cacheList\n await props.context.node.input(selection);\n }\n\n }\n else if (e.resource === \"invalid\") return\n else if (e === \"erase\") { await props.context.node.input({}); findPropertyToUpdate(e) }\n else {\n selection = { name: e.name, resource: e.resource };\n await props.context.node.input(selection);\n }\n findPropertyToUpdate();\n}\n\nconst getAutocompleteSuggestions = async (e) => {\n let innerText = e.target.value\nconsole.log(locale);\n\n\n await store.dispatch('dpiStore/requestAutocompleteSuggestions', { voc: voc, text: innerText, 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 if (results.length === 0) {\n matches.value = { value: { name: matchesNothingFound } }\n }\n else matches.value = results;\n });\n}\n\nfunction removeProperty(e) {\n props.context.node.input({})\n setValue('erase');\n}\nfunction removeMultipleProperty(e) {\n\n if (instance.content.dataProviderInterface.annifIntegration) {\n fillAnnifsuggestions()\n }\n if (listOfValues.value.length > 0) {\n cacheList = listOfValues.value\n }\n // Get Index in the array where all values of the Span are stored and cut it out of the list of Values\n cacheList.splice(cacheList.findIndex((element) => element.name == e.name), 1)\n selection = cacheList;\n props.context.node.input(selection);\n findPropertyToUpdate();\n}\n</script>\n"],"names":["instance","getCurrentInstance","props","__props","store","useStore","t","locale","useI18n","listOfValues","computed","selection","voc","matchesSearchstring","matchesNothingFound","matches","ref","activeList","dropdownList","inputText","cacheList","annifList","annifTrigger","annifSelectionList","onMounted","inDis","watch","requestURIname","res","vocMatch","name","response","dataset","getTranslationFor","watchEffect","values","uriName","uriNameList","index","findPropertyToUpdate","trigger","finalPath","pathToLocalStorage","innerIndex","ntry","e","onClickOutside","event","annifHandlerTheme","input","limit","finalLimit","query","qs","config","axios","i","annifCacheList","element","eraseDuplicates","error","updateAnnifselection","item","fillAnnifsuggestions","setValue","array1","array2","mergedArray","filteredArray","resourceSet","obj","limitChange","arr","getNode","filteredProperty","filteredList","getAutocompleteSuggestions","innerText","results","r","removeProperty","removeMultipleProperty"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyFA,QAAIA,IAAWC,GAAkB,EAAG,WAAW,IAAI,OAAO,iBA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GAGhB,MAAMH,EAAM,SAAS,2CAA2C,EAAE,KAAKQ,GAAK,MAAMiE,GAAW,MAAM7E,EAAS,IAAI,QAAS,CAAA,EAAE,KAAK,CAAC+B,MAAa;AAC5I,cAAM+C,IAAU/C,EAAS,KAAK,OAAO,QAAQ,IAAI,CAACgD,OAAO;AAAA,UACvD,MAAM9C,EAAkB8C,EAAE,YAAYxE,EAAO,OAAO,CAAA,CAAE,IAAI,OAAOwE,EAAE,KAAK;AAAA,UACxE,UAAUA,EAAE;AAAA,QACb,EAAC;AACF,QAAID,EAAQ,WAAW,IACrB/D,EAAQ,QAAQ,EAAE,OAAO,EAAE,MAAMD,EAAmB,EAAI,IAErDC,EAAQ,QAAQ+D;AAAA,MACzB,CAAG;AAAA,IACH;AAEA,aAASE,EAAenC,GAAG;AACzB,MAAA3C,EAAM,QAAQ,KAAK,MAAM,CAAA,CAAE,GAC3B8D,EAAS,OAAO;AAAA,IAClB;AACA,aAASiB,EAAuBpC,GAAG;AAEjC,MAAI7C,EAAS,QAAQ,sBAAsB,oBACzC+D,EAAsB,GAEpBtD,EAAa,MAAM,SAAS,MAC9BW,IAAYX,EAAa,QAG3BW,EAAU,OAAOA,EAAU,UAAU,CAACsC,MAAYA,EAAQ,QAAQb,EAAE,IAAI,GAAG,CAAC,GAC5ElC,IAAYS,GACZlB,EAAM,QAAQ,KAAK,MAAMS,CAAS,GAClC4B;IACF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -5,8 +5,8 @@ declare const _default: import('vue').DefineComponent<Readonly<{
|
|
|
5
5
|
}>, any, {}, {
|
|
6
6
|
token(): any;
|
|
7
7
|
redirectUri(): string;
|
|
8
|
-
getUserData: import('vuex').Computed;
|
|
9
8
|
getIsDraft: import('vuex').Computed;
|
|
9
|
+
getUserData: import('vuex').Computed;
|
|
10
10
|
}, {
|
|
11
11
|
setupEditPage(): Promise<void>;
|
|
12
12
|
convertToInput: import('vuex').ActionMethod;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { mapGetters as
|
|
2
|
-
import { openBlock as
|
|
1
|
+
import { mapGetters as s, mapActions as o } from "vuex";
|
|
2
|
+
import { openBlock as i, createElementBlock as n, createElementVNode as c } from "vue";
|
|
3
3
|
import p from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
4
|
-
const
|
|
4
|
+
const d = {
|
|
5
5
|
props: ["id", "property", "catalog"],
|
|
6
6
|
data() {
|
|
7
7
|
return {};
|
|
8
8
|
},
|
|
9
9
|
computed: {
|
|
10
|
-
...
|
|
10
|
+
...s("auth", [
|
|
11
11
|
"getIsDraft",
|
|
12
12
|
"getUserData"
|
|
13
13
|
]),
|
|
@@ -19,34 +19,39 @@ const h = {
|
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
methods: {
|
|
22
|
-
...
|
|
22
|
+
...o("auth", [
|
|
23
23
|
"setIsEditMode",
|
|
24
24
|
"setIsDraft"
|
|
25
25
|
]),
|
|
26
|
-
...
|
|
26
|
+
...o("dpiStore", [
|
|
27
27
|
"convertToInput"
|
|
28
28
|
]),
|
|
29
29
|
async setupEditPage() {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
this.$router.push({
|
|
31
|
+
name: "DataProviderInterface-Input",
|
|
32
|
+
params: { property: this.property },
|
|
33
|
+
query: {
|
|
34
|
+
locale: this.$route.query.locale,
|
|
35
|
+
edit: !this.getIsDraft && this.property === "catalogues" ? this.catalog : this.id,
|
|
36
|
+
catalog: this.catalog,
|
|
37
|
+
fromDraft: this.getIsDraft ? "true" : void 0
|
|
38
|
+
}
|
|
34
39
|
});
|
|
35
40
|
}
|
|
36
41
|
},
|
|
37
|
-
beforeRouteEnter(
|
|
38
|
-
|
|
39
|
-
e.fullPath.startsWith(
|
|
42
|
+
beforeRouteEnter(a, e, r) {
|
|
43
|
+
r((t) => {
|
|
44
|
+
e.fullPath.startsWith(t.redirectUri) ? t.$router.go(-1) : t.setupEditPage();
|
|
40
45
|
});
|
|
41
46
|
}
|
|
42
|
-
},
|
|
47
|
+
}, h = { style: { height: "370px" } }, u = /* @__PURE__ */ c("div", { class: "spinner" }, null, -1), l = [
|
|
43
48
|
u
|
|
44
49
|
];
|
|
45
|
-
function f(
|
|
46
|
-
return
|
|
50
|
+
function f(a, e, r, t, g, m) {
|
|
51
|
+
return i(), n("div", h, l);
|
|
47
52
|
}
|
|
48
|
-
const
|
|
53
|
+
const D = /* @__PURE__ */ p(d, [["render", f]]);
|
|
49
54
|
export {
|
|
50
|
-
|
|
55
|
+
D as default
|
|
51
56
|
};
|
|
52
57
|
//# sourceMappingURL=DataFetchingComponent.vue.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataFetchingComponent.vue.mjs","sources":["../../../lib/data-provider-interface/components/DataFetchingComponent.vue"],"sourcesContent":["<template>\n <div style=\"height:370px;\">\n <div class=\"spinner\"></div>\n </div>\n</template>\n\n<script>\nimport { mapActions, mapGetters } from 'vuex';\n\nexport default {\n props: ['id', 'property', 'catalog'],\n data() {\n return {};\n },\n computed: {\n ...mapGetters('auth', [\n 'getIsDraft',\n 'getUserData',\n ]),\n token() {\n return this.getUserData.rtpToken;\n },\n redirectUri() {\n return `${this.$env.content.dataProviderInterface.basePath}/${this.property}?locale=${this.$i18n.locale}`;\n },\n },\n methods: {\n ...mapActions('auth', [\n 'setIsEditMode',\n 'setIsDraft',\n ]),\n ...mapActions('dpiStore', [\n 'convertToInput',\n ]),\n async setupEditPage() {\n let endpoint;\n this.setIsEditMode(true);\n const specification = this.$env.content.dataProviderInterface.specification;\n\n if (this.getIsDraft) {\n this.setIsDraft(true);\n endpoint = `${this.$env.api.hubUrl}drafts/datasets/${this.id}.nt?catalogue=${this.catalog}`;\n await this.convertToInput({endpoint, token: this.token, property: this.property, id: this.id, specification: specification });\n } else {\n this.setIsDraft(false);\n if (this.property === 'catalogues') {\n endpoint = `${this.$env.api.hubUrl}catalogues/${this.catalog}.nt`;\n await this.convertToInput({endpoint, token: this.token, property: this.property, id: this.catalog, specification: specification });\n } else {\n endpoint = `${this.$env.api.hubUrl}datasets/${this.id}.nt?useNormalizedId=true`;\n await this.convertToInput({endpoint, token: this.token, property: this.property, id: this.id, specification: specification });\n } \n }\n\n this.$router.push(this.redirectUri).catch(() => {});\n },\n },\n beforeRouteEnter(to, from, next) {\n next(vm => {\n if (from.fullPath.startsWith(vm.redirectUri)) {\n vm.$router.go(-1);\n } else vm.setupEditPage();\n });\n },\n};\n</script>\n"],"names":["_sfc_main","mapGetters","mapActions","
|
|
1
|
+
{"version":3,"file":"DataFetchingComponent.vue.mjs","sources":["../../../lib/data-provider-interface/components/DataFetchingComponent.vue"],"sourcesContent":["<template>\n <div style=\"height:370px;\">\n <div class=\"spinner\"></div>\n </div>\n</template>\n\n<script>\nimport { mapActions, mapGetters } from 'vuex';\n\nexport default {\n props: ['id', 'property', 'catalog'],\n data() {\n return {};\n },\n computed: {\n ...mapGetters('auth', [\n 'getIsDraft',\n 'getUserData',\n ]),\n token() {\n return this.getUserData.rtpToken;\n },\n redirectUri() {\n return `${this.$env.content.dataProviderInterface.basePath}/${this.property}?locale=${this.$i18n.locale}`;\n },\n },\n methods: {\n ...mapActions('auth', [\n 'setIsEditMode',\n 'setIsDraft',\n ]),\n ...mapActions('dpiStore', [\n 'convertToInput',\n ]),\n async setupEditPage() {\n this.$router.push({\n name: 'DataProviderInterface-Input',\n params: { property: this.property },\n query: { \n locale: this.$route.query.locale,\n edit: !this.getIsDraft && this.property === 'catalogues'\n ? this.catalog\n : this.id,\n catalog: this.catalog,\n fromDraft: this.getIsDraft ? 'true' : undefined,\n },\n })\n\n return;\n\n let endpoint;\n this.setIsEditMode(true);\n const specification = this.$env.content.dataProviderInterface.specification;\n\n if (this.getIsDraft) {\n this.setIsDraft(true);\n endpoint = `${this.$env.api.hubUrl}drafts/datasets/${this.id}.nt?catalogue=${this.catalog}`;\n await this.convertToInput({endpoint, token: this.token, property: this.property, id: this.id, specification: specification });\n } else {\n this.setIsDraft(false);\n if (this.property === 'catalogues') {\n endpoint = `${this.$env.api.hubUrl}catalogues/${this.catalog}.nt`;\n await this.convertToInput({endpoint, token: this.token, property: this.property, id: this.catalog, specification: specification });\n } else {\n endpoint = `${this.$env.api.hubUrl}datasets/${this.id}.nt?useNormalizedId=true`;\n await this.convertToInput({endpoint, token: this.token, property: this.property, id: this.id, specification: specification });\n } \n }\n\n this.$router.push(this.redirectUri).catch(() => {});\n },\n },\n beforeRouteEnter(to, from, next) {\n next(vm => {\n if (from.fullPath.startsWith(vm.redirectUri)) {\n vm.$router.go(-1);\n } else vm.setupEditPage();\n });\n },\n};\n</script>\n"],"names":["_sfc_main","mapGetters","mapActions","to","from","next","vm","_hoisted_1","_createElementVNode","_hoisted_2","_createElementBlock","_hoisted_3"],"mappings":";;;AASA,MAAKA,IAAU;AAAA,EACb,OAAO,CAAC,MAAM,YAAY,SAAS;AAAA,EACnC,OAAO;AACL,WAAO;EACR;AAAA,EACD,UAAU;AAAA,IACR,GAAGC,EAAW,QAAQ;AAAA,MACpB;AAAA,MACA;AAAA,IACF,CAAC;AAAA,IACD,QAAQ;AACN,aAAO,KAAK,YAAY;AAAA,IACzB;AAAA,IACD,cAAc;AACZ,aAAO,GAAG,KAAK,KAAK,QAAQ,sBAAsB,QAAQ,IAAI,KAAK,QAAQ,WAAW,KAAK,MAAM,MAAM;AAAA,IACxG;AAAA,EACF;AAAA,EACD,SAAS;AAAA,IACP,GAAGC,EAAW,QAAQ;AAAA,MACpB;AAAA,MACA;AAAA,IACF,CAAC;AAAA,IACD,GAAGA,EAAW,YAAY;AAAA,MACxB;AAAA,IACF,CAAC;AAAA,IACD,MAAM,gBAAgB;AACpB,WAAK,QAAQ,KAAK;AAAA,QAChB,MAAM;AAAA,QACN,QAAQ,EAAE,UAAU,KAAK,SAAU;AAAA,QACnC,OAAO;AAAA,UACL,QAAQ,KAAK,OAAO,MAAM;AAAA,UAC1B,MAAM,CAAC,KAAK,cAAc,KAAK,aAAa,eACxC,KAAK,UACL,KAAK;AAAA,UACT,SAAS,KAAK;AAAA,UACd,WAAW,KAAK,aAAa,SAAS;AAAA,QACvC;AAAA,OACF;AAAA,IAwBF;AAAA,EACF;AAAA,EACD,iBAAiBC,GAAIC,GAAMC,GAAM;AAC/B,IAAAA,EAAK,CAAAC,MAAM;AACT,MAAIF,EAAK,SAAS,WAAWE,EAAG,WAAW,IACzCA,EAAG,QAAQ,GAAG,EAAE,IACXA,EAAG;IACZ,CAAC;AAAA,EACF;AACH,GA9EOC,IAAA,EAAA,OAAA,EAAqB,QAAA,QAAA,EAAA,OACxBC,gBAAAA,EAA2B,OAAA,EAAtB,OAAM,aAAS,MAAA,EAAA;EAApBC;;;cADFC,EAEM,OAFNH,GADFI,CAAA;;;"}
|
|
@@ -29,8 +29,8 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
29
29
|
}, {
|
|
30
30
|
getCatalogue(): unknown;
|
|
31
31
|
getData: import('vuex').Computed;
|
|
32
|
-
getUserData: import('vuex').Computed;
|
|
33
32
|
getIsEditMode: import('vuex').Computed;
|
|
33
|
+
getUserData: import('vuex').Computed;
|
|
34
34
|
}, {
|
|
35
35
|
toggleUploadUrl(): void;
|
|
36
36
|
toggleUploadFileSwitch(): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const _default: import('vue').DefineComponent<Readonly<{
|
|
2
2
|
steps?: any;
|
|
3
|
-
previousStep?: any;
|
|
4
3
|
nextStep?: any;
|
|
4
|
+
previousStep?: any;
|
|
5
5
|
goToNextStep?: any;
|
|
6
6
|
goToPreviousStep?: any;
|
|
7
7
|
}>, {
|
|
@@ -352,9 +352,9 @@ declare const _default: import('vue').DefineComponent<Readonly<{
|
|
|
352
352
|
}, {
|
|
353
353
|
formErrorCount(): boolean;
|
|
354
354
|
getData: import('vuex').Computed;
|
|
355
|
-
getUserData: import('vuex').Computed;
|
|
356
355
|
getIsEditMode: import('vuex').Computed;
|
|
357
356
|
getIsDraft: import('vuex').Computed;
|
|
357
|
+
getUserData: import('vuex').Computed;
|
|
358
358
|
}, {
|
|
359
359
|
closeModal(): void;
|
|
360
360
|
handleIDError(): void;
|
|
@@ -372,14 +372,14 @@ declare const _default: import('vue').DefineComponent<Readonly<{
|
|
|
372
372
|
setIsDraft: import('vuex').ActionMethod;
|
|
373
373
|
}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<Readonly<{
|
|
374
374
|
steps?: any;
|
|
375
|
-
previousStep?: any;
|
|
376
375
|
nextStep?: any;
|
|
376
|
+
previousStep?: any;
|
|
377
377
|
goToNextStep?: any;
|
|
378
378
|
goToPreviousStep?: any;
|
|
379
379
|
}>>>, {
|
|
380
380
|
readonly steps?: any;
|
|
381
|
-
readonly previousStep?: any;
|
|
382
381
|
readonly nextStep?: any;
|
|
382
|
+
readonly previousStep?: any;
|
|
383
383
|
readonly goToNextStep?: any;
|
|
384
384
|
readonly goToPreviousStep?: any;
|
|
385
385
|
}, {}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComputedRef, InjectionKey, MaybeRefOrGetter } from 'vue';
|
|
2
|
+
|
|
3
|
+
export interface DpiSpecification {
|
|
4
|
+
pageConent?: object;
|
|
5
|
+
inputDefinition: object;
|
|
6
|
+
prefixes: object;
|
|
7
|
+
formatTypes: object;
|
|
8
|
+
vocabPrefixes: object;
|
|
9
|
+
}
|
|
10
|
+
export interface DpiContext {
|
|
11
|
+
specification: DpiSpecification;
|
|
12
|
+
specificationName: string;
|
|
13
|
+
}
|
|
14
|
+
export type ComputedDpiContext = ComputedRef<DpiContext>;
|
|
15
|
+
export declare const dpiContextKey: InjectionKey<ComputedDpiContext>;
|
|
16
|
+
export declare function useDpiContext(): ComputedDpiContext;
|
|
17
|
+
export declare function setupDpiContext(context: MaybeRefOrGetter<DpiContext>): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getCurrentInstance as n, inject as i, provide as r, computed as u, toValue as p } from "vue";
|
|
2
|
+
const o = Symbol("dpiContext");
|
|
3
|
+
function c() {
|
|
4
|
+
if (!n())
|
|
5
|
+
throw new Error("[useDpiContext] useDpiContext must be used inside a setup function");
|
|
6
|
+
const e = i(o);
|
|
7
|
+
if (!e)
|
|
8
|
+
throw new Error("[useDpiContext] DPI Context not found. Did you forget to inject it?");
|
|
9
|
+
return e;
|
|
10
|
+
}
|
|
11
|
+
function x(t) {
|
|
12
|
+
r(o, u(() => p(t)));
|
|
13
|
+
}
|
|
14
|
+
export {
|
|
15
|
+
o as dpiContextKey,
|
|
16
|
+
x as setupDpiContext,
|
|
17
|
+
c as useDpiContext
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=useDpiContext.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDpiContext.mjs","sources":["../../../lib/data-provider-interface/composables/useDpiContext.ts"],"sourcesContent":["import { FormKitLibrary } from \"@formkit/core\"\nimport { computed, ComputedRef, getCurrentInstance, inject, InjectionKey, MaybeRefOrGetter, provide, toValue } from \"vue\"\n\nexport interface DpiSpecification {\n pageConent?: object\n inputDefinition: object\n prefixes: object\n formatTypes: object\n vocabPrefixes: object\n}\n\nexport interface DpiContext {\n specification: DpiSpecification\n specificationName: string\n}\n\nexport type ComputedDpiContext = ComputedRef<DpiContext>\n\nexport const dpiContextKey: InjectionKey<ComputedDpiContext> = Symbol('dpiContext')\n\nexport function useDpiContext(): ComputedDpiContext {\n const vm = getCurrentInstance();\n if (!vm) throw new Error('[useDpiContext] useDpiContext must be used inside a setup function')\n\n const dpiContext = inject(dpiContextKey)\n\n if (!dpiContext) {\n throw new Error('[useDpiContext] DPI Context not found. Did you forget to inject it?')\n }\n\n return dpiContext\n}\n\nexport function setupDpiContext(context: MaybeRefOrGetter<DpiContext>) {\n provide(dpiContextKey, computed(() => toValue(context)))\n}"],"names":["dpiContextKey","useDpiContext","getCurrentInstance","dpiContext","inject","setupDpiContext","context","provide","computed","toValue"],"mappings":";AAkBa,MAAAA,IAAkD,OAAO,YAAY;AAE3E,SAASC,IAAoC;AAElD,MAAI,CADOC;AACI,UAAA,IAAI,MAAM,oEAAoE;AAEvF,QAAAC,IAAaC,EAAOJ,CAAa;AAEvC,MAAI,CAACG;AACG,UAAA,IAAI,MAAM,qEAAqE;AAGhF,SAAAA;AACT;AAEO,SAASE,EAAgBC,GAAuC;AACrE,EAAAC,EAAQP,GAAeQ,EAAS,MAAMC,EAAQH,CAAO,CAAC,CAAC;AACzD;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DpiContext } from './useDpiContext';
|
|
2
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Use this composable in the DataProviderInterface to fetch a dataset from the Hub API and
|
|
6
|
+
* convert it to a form input via localStorage. This composable is used when the user navigates to a dataset
|
|
7
|
+
* by clicking on the "Edit" on the DatasetDetails page or in DraftsPage
|
|
8
|
+
*
|
|
9
|
+
*
|
|
10
|
+
* @param dpiContext - The DPI context as returned by `useDpiContext`.
|
|
11
|
+
* @returns The computed properties described above.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useDpiEditMode(dpiContext: MaybeRefOrGetter<DpiContext>): {
|
|
14
|
+
isReady: import('vue').ComputedRef<boolean>;
|
|
15
|
+
error: import('vue').Ref<unknown>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useRoute as l } from "vue-router";
|
|
2
|
+
import { computed as a } from "vue";
|
|
3
|
+
import { useStore as y } from "vuex";
|
|
4
|
+
import { useRuntimeEnv as g } from "../../composables/useRuntimeEnv.mjs";
|
|
5
|
+
import { useAsyncState as D } from "../../external/@vueuse/core/index";
|
|
6
|
+
import { watchOnce as v } from "../../external/@vueuse/shared/index";
|
|
7
|
+
function M(I) {
|
|
8
|
+
const t = l(), e = y(), o = g(), u = a(() => t.query.edit), s = a(() => t.query.fromDraft || e.getters["auth/getIsDraft"]), n = a(() => {
|
|
9
|
+
var i;
|
|
10
|
+
const r = s.value, m = (i = e.getters["auth/getUserData"]) == null ? void 0 : i.rtpToken, f = t.params.property, h = t.params.id;
|
|
11
|
+
return e.dispatch("auth/setIsEditMode", !0), e.dispatch("auth/setIsDraft", r), { endpoint: r ? `${o.api.hubUrl}drafts/datasets/${t.query.edit}.nt?catalogue=${t.query.catalog}` : t.params.property === "catalogues" ? `${o.api.hubUrl}catalogues/${t.query.catalog}.nt` : `${o.api.hubUrl}datasets/${t.query.edit}.nt?useNormalizedId=true`, token: m, property: f, id: h };
|
|
12
|
+
}), { execute: d, isLoading: c, error: p } = D(
|
|
13
|
+
async () => await e.dispatch(
|
|
14
|
+
"dpiStore/convertToInput",
|
|
15
|
+
n.value
|
|
16
|
+
),
|
|
17
|
+
void 0,
|
|
18
|
+
{
|
|
19
|
+
immediate: !1
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
return v(
|
|
23
|
+
u,
|
|
24
|
+
() => {
|
|
25
|
+
const r = s.value;
|
|
26
|
+
e.dispatch("auth/setIsEditMode", !0), e.dispatch("auth/setIsDraft", r), d();
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
immediate: !0
|
|
30
|
+
}
|
|
31
|
+
), {
|
|
32
|
+
isReady: a(() => !!e.getters["dpiStore/getSpecificationName"] && !c.value),
|
|
33
|
+
error: p
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
M as useDpiEditMode
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=useDpiEditMode.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDpiEditMode.mjs","sources":["../../../lib/data-provider-interface/composables/useDpiEditMode.ts"],"sourcesContent":["import { useRoute } from \"vue-router\";\nimport { type DpiContext } from \"./useDpiContext\";\nimport { computed, MaybeRefOrGetter } from \"vue\";\nimport { useStore } from \"vuex\";\nimport { useRuntimeEnv } from \"../../composables/useRuntimeEnv\";\nimport { useAsyncState, watchOnce } from \"@vueuse/core\";\n\n /**\n * Use this composable in the DataProviderInterface to fetch a dataset from the Hub API and\n * convert it to a form input via localStorage. This composable is used when the user navigates to a dataset\n * by clicking on the \"Edit\" on the DatasetDetails page or in DraftsPage\n *\n *\n * @param dpiContext - The DPI context as returned by `useDpiContext`.\n * @returns The computed properties described above.\n */\nexport function useDpiEditMode(dpiContext: MaybeRefOrGetter<DpiContext>) {\n const route = useRoute();\n const store = useStore();\n const env = useRuntimeEnv();\n\n const editIdQuery = computed(() => {\n return route.query.edit;\n });\n\n const editFromDraft = computed(() => {\n return route.query.fromDraft || store.getters[\"auth/getIsDraft\"];\n });\n\n const requestParams = computed(() => {\n const isDraft = editFromDraft.value;\n const token = store.getters[\"auth/getUserData\"]?.rtpToken;\n const property = route.params.property;\n const id = route.params.id;\n\n store.dispatch(\"auth/setIsEditMode\", true);\n store.dispatch(\"auth/setIsDraft\", isDraft);\n\n const endpoint = isDraft\n ? `${env.api.hubUrl}drafts/datasets/${route.query.edit}.nt?catalogue=${route.query.catalog}`\n : route.params.property === \"catalogues\"\n ? `${env.api.hubUrl}catalogues/${route.query.catalog}.nt`\n : `${env.api.hubUrl}datasets/${route.query.edit}.nt?useNormalizedId=true`;\n return { endpoint, token, property, id };\n });\n\n const { execute, isLoading, error } = useAsyncState(\n async () => {\n return await store.dispatch(\n \"dpiStore/convertToInput\",\n requestParams.value\n );\n },\n undefined,\n {\n immediate: false,\n }\n );\n\n watchOnce(\n editIdQuery,\n () => {\n const isDraft = editFromDraft.value;\n store.dispatch(\"auth/setIsEditMode\", true);\n store.dispatch(\"auth/setIsDraft\", isDraft);\n execute();\n },\n {\n immediate: true,\n }\n );\n\n // Ensure dpiStore contains a specification before rendering the input page.\n // Maybe it's not needed but better safe than sorry.\n const isReady = computed(() => {\n return !!store.getters[\"dpiStore/getSpecificationName\"] && !isLoading.value;\n });\n\n return {\n isReady,\n error,\n }\n}\n"],"names":["useDpiEditMode","dpiContext","route","useRoute","store","useStore","env","useRuntimeEnv","editIdQuery","computed","editFromDraft","requestParams","isDraft","token","_a","property","id","execute","isLoading","error","useAsyncState","watchOnce"],"mappings":";;;;;;AAgBO,SAASA,EAAeC,GAA0C;AACvE,QAAMC,IAAQC,KACRC,IAAQC,KACRC,IAAMC,KAENC,IAAcC,EAAS,MACpBP,EAAM,MAAM,IACpB,GAEKQ,IAAgBD,EAAS,MACtBP,EAAM,MAAM,aAAaE,EAAM,QAAQ,iBAAiB,CAChE,GAEKO,IAAgBF,EAAS,MAAM;;AACnC,UAAMG,IAAUF,EAAc,OACxBG,KAAQC,IAAAV,EAAM,QAAQ,kBAAkB,MAAhC,gBAAAU,EAAmC,UAC3CC,IAAWb,EAAM,OAAO,UACxBc,IAAKd,EAAM,OAAO;AAElB,WAAAE,EAAA,SAAS,sBAAsB,EAAI,GACnCA,EAAA,SAAS,mBAAmBQ,CAAO,GAOlC,EAAE,UALQA,IACb,GAAGN,EAAI,IAAI,MAAM,mBAAmBJ,EAAM,MAAM,IAAI,iBAAiBA,EAAM,MAAM,OAAO,KACxFA,EAAM,OAAO,aAAa,eAC1B,GAAGI,EAAI,IAAI,MAAM,cAAcJ,EAAM,MAAM,OAAO,QAClD,GAAGI,EAAI,IAAI,MAAM,YAAYJ,EAAM,MAAM,IAAI,4BAC9B,OAAAW,GAAO,UAAAE,GAAU,IAAAC,EAAG;AAAA,EAAA,CACxC,GAEK,EAAE,SAAAC,GAAS,WAAAC,GAAW,OAAAC,EAAU,IAAAC;AAAA,IACpC,YACS,MAAMhB,EAAM;AAAA,MACjB;AAAA,MACAO,EAAc;AAAA,IAAA;AAAA,IAGlB;AAAA,IACA;AAAA,MACE,WAAW;AAAA,IACb;AAAA,EAAA;AAGF,SAAAU;AAAA,IACEb;AAAA,IACA,MAAM;AACJ,YAAMI,IAAUF,EAAc;AACxB,MAAAN,EAAA,SAAS,sBAAsB,EAAI,GACnCA,EAAA,SAAS,mBAAmBQ,CAAO,GACjCK;IACV;AAAA,IACA;AAAA,MACE,WAAW;AAAA,IACb;AAAA,EAAA,GASK;AAAA,IACL,SALcR,EAAS,MAChB,CAAC,CAACL,EAAM,QAAQ,+BAA+B,KAAK,CAACc,EAAU,KACvE;AAAA,IAIC,OAAAC;AAAA,EAAA;AAEJ;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dpi-spec-config.mjs","sources":["../../../lib/data-provider-interface/config/dpi-spec-config.js"],"sourcesContent":["// @ts-nocheck\n// dynamic imports are somehow diffcult so we need to import everything :(\n\n// import for DCAT-AP\nimport pageContent from './dcatap/page-content-config';\nimport inputDefinition from './dcatap/input-definition';\nimport prefixes from './dcatap/prefixes';\nimport formatTypes from './dcatap/format-types';\nimport vocabPrefixes from './dcatap/vocab-prefixes';\n\n// import DCAT-AP.de\nimport pageContentDCATAPDE from './dcatapde/page-content-config';\nimport inputDefinitionDCATAPDE from './dcatapde/input-definition';\nimport prefixesDCATAPDE from './dcatapde/prefixes';\nimport formatTypesDCATAPDE from './dcatapde/format-types';\nimport vocabPrefixesDCATAPDE from './dcatapde/vocab-prefixes';\n\n// import DCAT-AP.de for ODB\nimport pageContentDCATAPDEODB from './dcatapdeODB/page-content-config';\nimport inputDefinitionDCATAPDEODB from './dcatapdeODB/input-definition';\nimport prefixesDCATAPDEODB from './dcatapdeODB/prefixes';\nimport formatTypesDCATAPDEODB from './dcatapdeODB/format-types';\nimport vocabPrefixesDCATAPDEODB from './dcatapdeODB/vocab-prefixes';\n\n\
|
|
1
|
+
{"version":3,"file":"dpi-spec-config.mjs","sources":["../../../lib/data-provider-interface/config/dpi-spec-config.js"],"sourcesContent":["// @ts-nocheck\n// dynamic imports are somehow diffcult so we need to import everything :(\n\n// import for DCAT-AP\nimport pageContent from './dcatap/page-content-config';\nimport inputDefinition from './dcatap/input-definition';\nimport prefixes from './dcatap/prefixes';\nimport formatTypes from './dcatap/format-types';\nimport vocabPrefixes from './dcatap/vocab-prefixes';\n\n// import DCAT-AP.de\nimport pageContentDCATAPDE from './dcatapde/page-content-config';\nimport inputDefinitionDCATAPDE from './dcatapde/input-definition';\nimport prefixesDCATAPDE from './dcatapde/prefixes';\nimport formatTypesDCATAPDE from './dcatapde/format-types';\nimport vocabPrefixesDCATAPDE from './dcatapde/vocab-prefixes';\n\n// import DCAT-AP.de for ODB\nimport pageContentDCATAPDEODB from './dcatapdeODB/page-content-config';\nimport inputDefinitionDCATAPDEODB from './dcatapdeODB/input-definition';\nimport prefixesDCATAPDEODB from './dcatapdeODB/prefixes';\nimport formatTypesDCATAPDEODB from './dcatapdeODB/format-types';\nimport vocabPrefixesDCATAPDEODB from './dcatapdeODB/vocab-prefixes';\n\n\nexport const config = {\n dcatap: {\n pageConent: pageContent,\n inputDefinition: inputDefinition,\n formatTypes: formatTypes,\n prefixes: prefixes,\n vocabPrefixes: vocabPrefixes,\n },\n dcatapde: {\n pageConent: pageContentDCATAPDE,\n inputDefinition: inputDefinitionDCATAPDE,\n formatTypes: formatTypesDCATAPDE,\n prefixes: prefixesDCATAPDE,\n vocabPrefixes: vocabPrefixesDCATAPDE,\n },\n dcatapdeODB: {\n pageConent: pageContentDCATAPDEODB,\n inputDefinition: inputDefinitionDCATAPDEODB,\n formatTypes: formatTypesDCATAPDEODB,\n prefixes: prefixesDCATAPDEODB,\n vocabPrefixes: vocabPrefixesDCATAPDEODB,\n }\n\n};\n\nexport default config;"],"names":["config","pageContent","inputDefinition","formatTypes","prefixes","vocabPrefixes","pageContentDCATAPDE","inputDefinitionDCATAPDE","formatTypesDCATAPDE","prefixesDCATAPDE","vocabPrefixesDCATAPDE","pageContentDCATAPDEODB","inputDefinitionDCATAPDEODB","formatTypesDCATAPDEODB","prefixesDCATAPDEODB","vocabPrefixesDCATAPDEODB"],"mappings":";;;;;;;;;;;;;;;AAyBY,MAACA,IAAS;AAAA,EAClB,QAAQ;AAAA,IACJ,YAAYC;AAAAA,IACZ,iBAAiBC;AAAAA,IACjB,aAAaC;AAAA,IACb,UAAUC;AAAA,IACV,eAAeC;AAAA,EAClB;AAAA,EACD,UAAU;AAAA,IACN,YAAYC;AAAAA,IACZ,iBAAiBC;AAAAA,IACjB,aAAaC;AAAA,IACb,UAAUC;AAAAA,IACV,eAAeC;AAAA,EAClB;AAAA,EACD,aAAa;AAAA,IACT,YAAYC;AAAAA,IACZ,iBAAiBC;AAAAA,IACjB,aAAaC;AAAAA,IACb,UAAUC;AAAAA,IACV,eAAeC;AAAAA,EAClB;AAEL;"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { dpiContextKey as o, setupDpiContext as t, useDpiContext as i } from "./composables/useDpiContext.mjs";
|
|
2
|
+
import { useDpiStepper as x } from "./composables/useDpiStepper.mjs";
|
|
3
|
+
import { config as n } from "./config/dpi-spec-config.mjs";
|
|
4
|
+
export {
|
|
5
|
+
o as dpiContextKey,
|
|
6
|
+
n as dpiSpecConfig,
|
|
7
|
+
t as setupDpiContext,
|
|
8
|
+
i as useDpiContext,
|
|
9
|
+
x as useDpiStepper
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
declare const module: {
|
|
2
2
|
namespaced: boolean;
|
|
3
|
-
state: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
state: {
|
|
4
|
+
specification: {};
|
|
5
|
+
specificationName: string;
|
|
6
|
+
};
|
|
7
|
+
actions: {
|
|
8
|
+
setSpecification: (context: any, specification: any) => void;
|
|
9
|
+
setSpecificationname: (context: any, specificationName: any) => void;
|
|
10
|
+
};
|
|
11
|
+
mutations: {
|
|
12
|
+
setSpecification: (state: any, specification: any) => any;
|
|
13
|
+
setSpecificationName: (state: any, specificationName: any) => any;
|
|
14
|
+
};
|
|
15
|
+
getters: {
|
|
16
|
+
getSpecification: (state: any) => any;
|
|
17
|
+
getSpecificationName: (state: any) => any;
|
|
18
|
+
};
|
|
7
19
|
modules: {
|
|
8
20
|
formModule: {
|
|
9
21
|
state: {
|
|
@@ -12,17 +24,19 @@ declare const module: {
|
|
|
12
24
|
distributions: {};
|
|
13
25
|
catalogues: {};
|
|
14
26
|
};
|
|
27
|
+
usersCatalogs: {};
|
|
15
28
|
};
|
|
16
29
|
getters: {
|
|
17
30
|
getSchema: (state: any) => (property: any) => any;
|
|
18
31
|
};
|
|
19
32
|
actions: {
|
|
20
|
-
createSchema({ commit }: {
|
|
33
|
+
createSchema({ commit, state, rootGetters }: {
|
|
21
34
|
commit: any;
|
|
22
|
-
|
|
35
|
+
state: any;
|
|
36
|
+
rootGetters: any;
|
|
37
|
+
}, { property, page }: {
|
|
23
38
|
property: any;
|
|
24
39
|
page: any;
|
|
25
|
-
specification: any;
|
|
26
40
|
}): void;
|
|
27
41
|
translateSchema({ commit }: {
|
|
28
42
|
commit: any;
|
|
@@ -68,8 +82,10 @@ declare const module: {
|
|
|
68
82
|
text: any;
|
|
69
83
|
base: any;
|
|
70
84
|
}): Promise<unknown>;
|
|
71
|
-
requestResourceName({ commit }: {
|
|
85
|
+
requestResourceName({ commit, state, rootGetters }: {
|
|
72
86
|
commit: any;
|
|
87
|
+
state: any;
|
|
88
|
+
rootGetters: any;
|
|
73
89
|
}, { voc, uri, envs }: {
|
|
74
90
|
voc: any;
|
|
75
91
|
uri: any;
|
|
@@ -101,19 +117,19 @@ declare const module: {
|
|
|
101
117
|
saveLocalstorageValues({ commit }: {
|
|
102
118
|
commit: any;
|
|
103
119
|
}, property: any): void;
|
|
104
|
-
convertToInput({ commit }: {
|
|
120
|
+
convertToInput({ commit, rootGetters }: {
|
|
105
121
|
commit: any;
|
|
106
|
-
|
|
122
|
+
rootGetters: any;
|
|
123
|
+
}, { endpoint, token, property }: {
|
|
107
124
|
endpoint: any;
|
|
108
125
|
token: any;
|
|
109
126
|
property: any;
|
|
110
|
-
specification: any;
|
|
111
127
|
}): Promise<void>;
|
|
112
|
-
convertToRDF({ state }: {
|
|
128
|
+
convertToRDF({ state, rootGetters }: {
|
|
113
129
|
state: any;
|
|
114
|
-
|
|
130
|
+
rootGetters: any;
|
|
131
|
+
}, { property }: {
|
|
115
132
|
property: any;
|
|
116
|
-
specification: any;
|
|
117
133
|
}): undefined;
|
|
118
134
|
clearAll({ commit }: {
|
|
119
135
|
commit: any;
|
|
@@ -142,7 +158,7 @@ declare const module: {
|
|
|
142
158
|
};
|
|
143
159
|
};
|
|
144
160
|
getters: {
|
|
145
|
-
getNavSteps: (state: any) => (specification: any) => any;
|
|
161
|
+
getNavSteps: (state: any, _getters: any, _rootState: any, rootGetters: any) => (specification: any) => any;
|
|
146
162
|
};
|
|
147
163
|
actions: {};
|
|
148
164
|
mutations: {};
|
|
@@ -1,18 +1,35 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
const
|
|
1
|
+
import t from "./modules/formSchemaStore.mjs";
|
|
2
|
+
import o from "./modules/autocompleteStore.mjs";
|
|
3
|
+
import c from "./modules/conversionStore.mjs";
|
|
4
|
+
import a from "./modules/navigationStore.mjs";
|
|
5
|
+
const n = {
|
|
6
|
+
// DPI specification as root state to be shared between all modules
|
|
7
|
+
specification: {},
|
|
8
|
+
specificationName: ""
|
|
9
|
+
}, m = {
|
|
10
|
+
getSpecification: (i) => i.specification,
|
|
11
|
+
getSpecificationName: (i) => i.specificationName
|
|
12
|
+
}, s = {
|
|
13
|
+
setSpecification: (i, e) => {
|
|
14
|
+
i.commit("setSpecification", e);
|
|
15
|
+
},
|
|
16
|
+
setSpecificationname: (i, e) => {
|
|
17
|
+
i.commit("setSpecificationName", e);
|
|
18
|
+
}
|
|
19
|
+
}, p = {
|
|
20
|
+
setSpecification: (i, e) => i.specification = e,
|
|
21
|
+
setSpecificationName: (i, e) => i.specificationName = e
|
|
22
|
+
}, l = {
|
|
6
23
|
namespaced: !0,
|
|
7
|
-
state:
|
|
8
|
-
actions:
|
|
9
|
-
mutations:
|
|
10
|
-
getters:
|
|
24
|
+
state: n,
|
|
25
|
+
actions: s,
|
|
26
|
+
mutations: p,
|
|
27
|
+
getters: m,
|
|
11
28
|
modules: {
|
|
12
|
-
formModule:
|
|
13
|
-
autocompleteModule:
|
|
14
|
-
conversionModule:
|
|
15
|
-
navigationModule:
|
|
29
|
+
formModule: t,
|
|
30
|
+
autocompleteModule: o,
|
|
31
|
+
conversionModule: c,
|
|
32
|
+
navigationModule: a
|
|
16
33
|
}
|
|
17
34
|
};
|
|
18
35
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dpiStore.mjs","sources":["../../../lib/data-provider-interface/store/dpiStore.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable no-param-reassign, no-shadow, no-console */\nimport formModule from './modules/formSchemaStore';\nimport autocompleteModule from './modules/autocompleteStore';\nimport conversionModule from './modules/conversionStore';\nimport navigationModule from './modules/navigationStore';\n\nconst state = {};\nconst getters = {};\nconst actions = {};\nconst mutations = {};\n\nconst module = {\n namespaced: true,\n state,\n actions,\n mutations,\n getters,\n modules: {\n formModule,\n autocompleteModule,\n conversionModule,\n navigationModule\n }\n};\n\nexport default module;\n"],"names":["state","getters","actions","mutations","module","formModule","autocompleteModule","conversionModule","navigationModule"],"mappings":";;;;AAOA,MAAMA,IAAQ,
|
|
1
|
+
{"version":3,"file":"dpiStore.mjs","sources":["../../../lib/data-provider-interface/store/dpiStore.ts"],"sourcesContent":["// @ts-nocheck\n/* eslint-disable no-param-reassign, no-shadow, no-console */\nimport formModule from './modules/formSchemaStore';\nimport autocompleteModule from './modules/autocompleteStore';\nimport conversionModule from './modules/conversionStore';\nimport navigationModule from './modules/navigationStore';\n\nconst state = {\n // DPI specification as root state to be shared between all modules\n specification: {},\n specificationName: '',\n};\nconst getters = {\n getSpecification: state => state.specification,\n getSpecificationName: state => state.specificationName\n};\nconst actions = {\n setSpecification: (context, specification) => {\n context.commit('setSpecification', specification);\n },\n setSpecificationname: (context, specificationName) => {\n context.commit('setSpecificationName', specificationName);\n }\n};\nconst mutations = {\n setSpecification: (state, specification) => (state.specification = specification),\n setSpecificationName: (state, specificationName) => (state.specificationName = specificationName)\n};\n\nconst module = {\n namespaced: true,\n state,\n actions,\n mutations,\n getters,\n modules: {\n formModule,\n autocompleteModule,\n conversionModule,\n navigationModule\n }\n};\n\nexport default module;\n"],"names":["state","getters","actions","context","specification","specificationName","mutations","module","formModule","autocompleteModule","conversionModule","navigationModule"],"mappings":";;;;AAOA,MAAMA,IAAQ;AAAA;AAAA,EAEZ,eAAe,CAAC;AAAA,EAChB,mBAAmB;AACrB,GACMC,IAAU;AAAA,EACd,kBAAkB,CAAAD,MAASA,EAAM;AAAA,EACjC,sBAAsB,CAAAA,MAASA,EAAM;AACvC,GACME,IAAU;AAAA,EACd,kBAAkB,CAACC,GAASC,MAAkB;AACpC,IAAAD,EAAA,OAAO,oBAAoBC,CAAa;AAAA,EAClD;AAAA,EACA,sBAAsB,CAACD,GAASE,MAAsB;AAC5C,IAAAF,EAAA,OAAO,wBAAwBE,CAAiB;AAAA,EAC1D;AACF,GACMC,IAAY;AAAA,EAChB,kBAAkB,CAACN,GAAOI,MAAmBJ,EAAM,gBAAgBI;AAAA,EACnE,sBAAsB,CAACJ,GAAOK,MAAuBL,EAAM,oBAAoBK;AACjF,GAEME,IAAS;AAAA,EACb,YAAY;AAAA,EACZ,OAAAP;AAAA,EACA,SAAAE;AAAA,EACA,WAAAI;AAAA,EACA,SAAAL;AAAA,EACA,SAAS;AAAA,IACP,YAAAO;AAAA,IACA,oBAAAC;AAAA,IACA,kBAAAC;AAAA,IACA,kBAAAC;AAAA,EACF;AACF;"}
|
|
@@ -12,8 +12,10 @@ declare const autocompleteModule: {
|
|
|
12
12
|
text: any;
|
|
13
13
|
base: any;
|
|
14
14
|
}): Promise<unknown>;
|
|
15
|
-
requestResourceName({ commit }: {
|
|
15
|
+
requestResourceName({ commit, state, rootGetters }: {
|
|
16
16
|
commit: any;
|
|
17
|
+
state: any;
|
|
18
|
+
rootGetters: any;
|
|
17
19
|
}, { voc, uri, envs }: {
|
|
18
20
|
voc: any;
|
|
19
21
|
uri: any;
|