@piveau/piveau-hub-ui-modules 4.5.13 → 4.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/dist/data-provider-interface/DPIMenu.vue.mjs +5 -5
  2. package/dist/data-provider-interface/DataProviderInterface.vue.d.ts +9 -4
  3. package/dist/data-provider-interface/components/Navigation.vue.mjs +57 -56
  4. package/dist/data-provider-interface/components/Navigation.vue.mjs.map +1 -1
  5. package/dist/data-provider-interface/components/SpatialInput.vue.mjs +23 -22
  6. package/dist/data-provider-interface/components/SpatialInput.vue.mjs.map +1 -1
  7. package/dist/data-provider-interface/components/UniqueIdentifierInput.vue.mjs +13 -13
  8. package/dist/data-provider-interface/components/UniqueIdentifierInput.vue.mjs.map +1 -1
  9. package/dist/data-provider-interface/composables/index.d.ts +1 -0
  10. package/dist/data-provider-interface/composables/useDpiEditMode.mjs +15 -16
  11. package/dist/data-provider-interface/composables/useDpiEditMode.mjs.map +1 -1
  12. package/dist/data-provider-interface/composables/useFormSchema.d.ts +13 -0
  13. package/dist/data-provider-interface/composables/useFormSchema.mjs +59 -0
  14. package/dist/data-provider-interface/composables/useFormSchema.mjs.map +1 -0
  15. package/dist/data-provider-interface/index.d.ts +33 -0
  16. package/dist/data-provider-interface/utils/translation-helper.mjs +23 -23
  17. package/dist/data-provider-interface/utils/translation-helper.mjs.map +1 -1
  18. package/dist/data-provider-interface/views/DistributionOverview.vue.d.ts +1 -1
  19. package/dist/data-provider-interface/views/InputPage.vue.d.ts +9 -4
  20. package/dist/data-provider-interface/views/InputPage.vue.mjs +110 -110
  21. package/dist/data-provider-interface/views/InputPage.vue.mjs.map +1 -1
  22. package/dist/dataProviderInterface.d.ts +1 -0
  23. package/dist/dataProviderInterface.mjs +71 -0
  24. package/dist/dataProviderInterface.mjs.map +1 -0
  25. package/dist/datasetDetails/distributions/distributionDetails/DistributionContent.vue.mjs +48 -48
  26. package/dist/datasetDetails/distributions/distributionDetails/DistributionContent.vue.mjs.map +1 -1
  27. package/dist/external/@vueuse/core/index +31 -31
  28. package/dist/external/@vueuse/shared/index +66 -63
  29. package/dist/external/@vueuse/shared/index.map +1 -1
  30. package/dist/form/FormKitGroup.vue.mjs.map +1 -1
  31. package/dist/index.mjs +54 -54
  32. package/dist/piveau-hub-ui-modules.css +1 -1
  33. package/dist/services/datasetService.mjs +1 -1
  34. package/dist/services/datasetService.mjs.map +1 -1
  35. package/package.json +17 -1
  36. package/dist/data-provider-interface/index.mjs +0 -15
  37. package/dist/data-provider-interface/index.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"SpatialInput.vue.mjs","sources":["../../../lib/data-provider-interface/components/SpatialInput.vue"],"sourcesContent":["<script setup>\n\nimport { ref, reactive, watch, computed, onBeforeMount, onMounted, nextTick, watchEffect } from 'vue';\nimport { useStore } from 'vuex';\nimport { getTranslationFor } from \"../../utils/helpers\";\nimport { onClickOutside, whenever } from '@vueuse/core'\nimport { getCurrentInstance } from \"vue\";\nimport { useRoute } from 'vue-router';\nimport { useI18n } from 'vue-i18n';\nimport { useTed } from '../../composables/useTed';\nimport { useAutocomplete } from '../composables/aucotomplete';\nimport { useRequestUriName } from '../composables/useRequestUriName';\nimport { useDpiContext } from '../composables';\n\n\nlet instance = getCurrentInstance().appContext.app.config.globalProperties.$env\nlet route = useRoute();\nconst dpiContext = useDpiContext();\n\nconst props = defineProps({\n context: Object,\n})\n\nconst { requestAutocompleteSuggestions } = useAutocomplete()\n\n// let listOfVoc: [{ item: 'Country', active: false }, { item: 'Place', active: false }, { item: 'Continent', active: false }],\nlet listOfVoc = ref([])\nconst typeText = ref('')\nlet inputText = ref({})\nlet voc = ref({})\nlet matches = ref({})\nlet manURL = ref({})\nconst store = useStore();\nconst { t, locale } = useI18n({ inheritLocale: true, useScope: 'global' });\nconst ted = useTed();\n\nconst man = ref(false)\nconst vocSearch = ref(false)\n\nconst isEdit = computed(() => !!dpiContext.value.edit?.enabled)\nconst resourceNameWhenEditing = computed(() => !!isEdit.value && props.context.value.resource)\n// e.g. extract \"municipalityKey\" (second to last) out of resourceName\nconst keyFromResourceName = computed(() => {\n if (resourceNameWhenEditing.value) {\n return resourceNameWhenEditing.value.split('/')[resourceNameWhenEditing.value.split('/').length - 2]\n }\n return ''\n})\nconst spatialVocabName = computed(() => {\n if (!keyFromResourceName.value) {\n return ''\n }\n\n const maybePrefix = props.context.attrs.identifier === 'politicalGeocodingURI'\n ? 'political-geocoding-'\n // todo: extend this for other vocabularies\n : ''\n\n // transform key from camelCase to kebab-case\n const vocabKey = keyFromResourceName.value.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()\n return `${maybePrefix}${vocabKey}`\n})\n\nconst translatedResourceName = computed(() => {\n // transform key 'districtKey' to 'District Key'\n const vocabKey = keyFromResourceName.value.replace(/([a-z])([A-Z])/g, '$1 $2').toLowerCase()\n // make first letters of each word uppercase\n const vocabKeyUpper = vocabKey.split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ')\n return t(`message.dataupload.datasets.conditional.${vocabKeyUpper}`)\n})\n\nconst { execute, state, isLoading } = useRequestUriName({\n voc: spatialVocabName,\n res: computed(() => props.context.value.resource),\n // property: 'dcatde:politicalGeocodingURI',\n property: computed(() => props.context.attrs.identifier === 'politicalGeocodingURI' ? 'dcatde:politicalGeocodingURI' : 'dct:spatial'), \n locale,\n})\n\nconst restoredValueFromEditMode = computed(() => {\n if (isEdit.value && !isLoading.value && resourceNameWhenEditing.value && state.value) {\n return `${translatedResourceName.value}: ${state.value} (${resourceNameWhenEditing.value.split('/').pop()})`\n }\n\n return ''\n})\n\nconst once = ref(false)\nwatchEffect(() => {\n if (once.value) return;\n\n if (!!resourceNameWhenEditing.value) {\n once.value = true\n execute()\n }\n}, { immediate: true })\n\nwhenever(restoredValueFromEditMode, () => {\n const v = { name: restoredValueFromEditMode.value, resource: resourceNameWhenEditing.value }\n props.context.node.input(v)\n})\n\n// If true, then:\n// - hides the select input for manual and vocabulary\n// - pre-selects the vocabulary option\n// When using formkit schema, enable this option by setting vocabularyOnly to true\n// {\n// $formkit: 'spatialinput',\n// name: 'dcatde:politicalGeocodingURI',\n// identifier: 'politicalGeocodingURI',\n// vocabularyOnly: true,\n// }\nconst vocabularyOnly = computed(() => !!props.context?.attrs?.vocabularyOnly)\n\nif (props.context.attrs.identifier === 'politicalGeocodingURI') {\n listOfVoc.value.push(\n { item: 'Municipality Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Municipality Key', 'Municipality Key') },\n { item: 'Regional Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Regional Key', 'Regional Key') },\n { item: 'Municipal Association Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Municipal Association Key', 'Municipal Association Key') },\n { item: 'District Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.District Key', 'District Key') },\n { item: 'Government District Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Government District Key', 'Government District Key') },\n { item: 'State Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.State Key', 'State Key') },\n )\n\n}\nif (props.context.attrs.identifier === 'spatial') {\n listOfVoc.value.push(\n { item: 'Country', active: false, placeholder: ted('message.dataupload.datasets.conditional.Country', 'Country') },\n { item: 'Place', active: false, placeholder: ted('message.dataupload.datasets.conditional.Place', 'Place') },\n { item: 'Continent', active: false, placeholder: ted('message.dataupload.datasets.conditional.Continent', 'Continent') },\n )\n}\n\nwatch(inputText, async () => {\n getAutocompleteSuggestions();\n})\nwatch(voc, async (newValue, oldValue) => {\n if (newValue === oldValue) { return }\n voc.value = voc.value.toLowerCase();\n})\nwatch(manURL, async () => {\n props.context.node.input({ 'name': manURL, 'resource': manURL })\n})\nonMounted(async () => {\n matches = [{ name: ted('message.dataupload.info.searchVocabulary', '--- Type in anything for a live search of the vocabulary ---').value, resource: 'invalid' }]\n\n await nextTick()\n // DOM loaded\n if (props.context.value.name === undefined || props.context.value.name === \"\") {\n showTable.activeValue = false\n } else showTable.activeValue = true\n // console.log(showTable.activeValue);\n\n if (vocabularyOnly.value) {\n activeInput('showTable'); vocSearch.value = true; if (man.value) { man.value = false }\n }\n\n});\n\nfunction closeAll() {\n listOfVoc.value.forEach(element => {\n element.active = false;\n });\n}\nfunction removeProperty(e) {\n // props.context.value = {}\n showTable.activeValue = false\n props.context.node.input({})\n}\nfunction saveToLocal(el) {\n\n let pathToLocalStorage = JSON.parse(localStorage.getItem(`dpi_${route.params.property}`));\n let arr\n if (props.context.attrs.identifier === 'politicalGeocodingURI') {\n arr = pathToLocalStorage.Advised['dcatde:politicalGeocodingURI'];\n }\n else arr = pathToLocalStorage.Advised['dct:spatial'];\n\n arr.forEach((element, index) => {\n if (Object.keys(element).length === 0) {\n arr.splice(index, 1)\n }\n })\n arr.push(props.context.node._value)\n if (props.context.attrs.identifier === 'politicalGeocodingURI') {\n pathToLocalStorage.Advised['dcatde:politicalGeocodingURI'] = arr\n }\n else pathToLocalStorage.Advised['dct:spatial'] = arr\n\n localStorage.setItem(`dpi_${route.params.property}`, JSON.stringify(pathToLocalStorage))\n}\nconst getAutocompleteSuggestions = async () => {\n\n let vocCache = voc.value?.toLowerCase()\n\n if (props.context.attrs.identifier === 'politicalGeocodingURI') {\n\n vocCache = 'political-geocoding-' + vocCache.toLowerCase().replaceAll(\" \", '-')\n\n try {\n let text = inputText.value;\n await requestAutocompleteSuggestions({ voc: vocCache, text: text, base: instance.api.baseUrl }).then((response) => {\n const results = response.data.result.results.map((r) => ({\n name: getTranslationFor(r.alt_label, locale.value, []) + \" (\" + r.id + \")\",\n resource: r.resource,\n }));\n matches = results;\n });\n } catch (error) {\n }\n }\n else {\n try {\n let text = inputText.value;\n await requestAutocompleteSuggestions({ voc: vocCache, text: text, base: instance.api.baseUrl }).then((response) => {\n const results = response.data.result.results.map((r) => ({\n name: getTranslationFor(r.pref_label, locale.value, []) + \" (\" + r.id + \")\",\n resource: r.resource,\n }));\n matches = results;\n });\n } catch (error) {\n }\n }\n\n}\n\nvar showTable = reactive({\n first: false,\n second: false,\n third: false,\n activeValue: false\n})\n\nconst I1 = ref(null);\nconst I2 = ref(null);\nconst I3 = ref(null);\n\nonClickOutside(I1, event => showTable.first = false)\nonClickOutside(I2, event => showTable.second = false)\nonClickOutside(I3, event => showTable.third = false)\nfunction activeInput(e) {\n\n // console.log('in', showTable);\n if (e === \"showTable\") showTable.first = !showTable.first;\n if (e === \"showVocTable\") showTable.second = !showTable.second;\n if (e === \"showVocEntries\") {\n if (showTable.third === true) {\n }\n else showTable.third = !showTable.third;\n }\n}\nfunction manURLInput(e) {\n props.context.node.input({ 'name': e.target.value, 'resource': e.target.value })\n}\n\nfunction handleSpatielListClick(el) {\n props.context.node.input(el);\n inputText.value = el.name;\n activeInput('showVocEntries');\n showTable.third = false;\n saveToLocal(el)\n}\n\nfunction submitType() {\n activeInput('showVocTable');\n\n}\n// console.log(voc);\n</script>\n\n<template>\n <div class=\"d-flex flex-column w-100 spatialWrap\">\n <div class=\"d-flex formkit-inner mx-3 mb-3\" v-if=\"!props.context.attrs.multiple && showTable.activeValue\">\n <!-- <div class=\"infoI\">\n <div class=\"tooltipFormkit\">{{ props.context.attrs.info }}</div>\n </div> -->\n <a class=\"autocompleteInputSingleValue \">{{ restoredValueFromEditMode }}</a>\n <div class=\"removeX\" @click=\"removeProperty\"></div>\n </div>\n <div v-else>\n <div class=\" w-100 d-flex\">\n <div v-if=\"!vocabularyOnly\" class=\"d-flex position-relative m-3 w-100\">\n <label class=\"w-100\"> {{ $t('message.dataupload.info.preferredInput') }}\n <input id=\"I1\" type=\"text\" class=\"selectInputField formkit-inner\" readonly=\"readonly\"\n :placeholder=\"$t('message.dataupload.info.preferredInput')\"\n @click=\"activeInput('showTable')\" />\n </label>\n\n <ul ref=\"I1\" v-show=\"showTable.first\" class=\"spatialListUpload\">\n <li @click=\"activeInput('showTable'); man = true; if (vocSearch) { vocSearch = false; };\"\n class=\"p-2 border-b border-gray-200 choosableItemsAC\">\n {{ $t('message.dataupload.datasets.conditional.manually') }}\n </li>\n <li @click=\"activeInput('showTable'); vocSearch = true; if (man) { man = false }\"\n class=\"p-2 border-b border-gray-200 choosableItemsAC\">\n {{ $t('message.dataupload.datasets.conditional.vocabulary') }}\n </li>\n </ul>\n </div>\n <div v-if=\"man\" class=\"d-flex position-relative m-3 w-100\">\n <label class=\"w-100\">\n <!-- todo: I borrowed this from another input. Maybe refactor? -->\n {{ $te('message.dataupload.datasets.isReferencedByUrl.placeholder') ? $t('message.dataupload.datasets.isReferencedByUrl.placeholder') : 'Provide an URL' }}\n <input type=\"URL\" class=\"selectInputField formkit-inner\" placeholder=\"URL\"\n @input=\"manURLInput($event)\">\n </label>\n </div>\n <div v-if=\"vocSearch\" class=\"d-flex position-relative m-3 w-100\">\n <!-- todo: I borrowed this from another input. Maybe refactor? -->\n <label class=\"w-100\"> {{ $te('message.dataupload.datasets.contributorType.placeholder') ? $t('message.dataupload.datasets.contributorType.placeholder') : 'Choose type of vocabulary' }} \n <input id=\"I2\" type=\"text\" class=\"selectInputField formkit-inner\" readonly=\"readonly\" v-model=\"typeText\"\n :placeholder=\"$te('message.dataupload.datasets.accessRights.placeholder') ? $t('message.dataupload.datasets.accessRights.placeholder') : 'Choose type of vocabulary'\" @click=\"activeInput('showVocTable');\">\n </label>\n <ul ref=\"I2\" v-if=\"showTable.second\" class=\"spatialListUpload\">\n <li v-for=\"el in listOfVoc\" :key=\"el\" class=\"p-2 border-b border-gray-200 choosableItemsAC\"\n @click=\" closeAll(); el.active = !el.active; activeInput('showVocTable'); inputText = ''; voc = el.item; typeText = el.placeholder\">\n {{ $t('message.dataupload.datasets.conditional.' + el.item) }}</li>\n </ul>\n </div>\n </div>\n <div class=\"m-3\" v-if=\"vocSearch\">\n <div v-for=\"el in listOfVoc\" :key=\"el\" class=\"position-relative\">\n <label class=\"w-100\" v-if=\"el.active\">\n <!-- todo: I borrowed this from another input. Maybe refactor? -->\n <!-- {{ $te('message.dataupload.datasets.accessRights.placeholder') ? $t('message.dataupload.datasets.accessRights.placeholder') : 'Choose type of vocabulary' }} -->\n {{ el.placeholder ? el.placeholder : $t('message.dataupload.datasets.conditional.' + el.item) }}\n <input id=\"I3\" type=\"text\"\n v-model=\"inputText\" class=\"selectInputField formkit-inner\" :placeholder=\"$te('message.dataupload.datasets.accessRights.placeholder') ? $t('message.dataupload.datasets.accessRights.placeholder') : 'Choose type of vocabulary'\"\n @click=\"activeInput('showVocEntries'); inputText = ''\"\n >\n </label>\n <ul ref=\"I3\" v-if=\"showTable.third && el.active\" class=\"spatialListUpload\">\n <li v-for=\"el in matches\" :key=\"el\" class=\"p-2 border-b border-gray-200 choosableItemsAC\"\n @click=\"handleSpatielListClick(el)\">\n {{ el.name }}</li>\n </ul>\n </div>\n\n </div>\n\n </div>\n </div>\n</template>\n\n<script>\n\n</script>\n\n<style lang=\"scss\" scoped>\n.spatialWrap label {\n font-family: var(--fk-font-family-label);\n font-size: var(--fk-font-size-label);\n font-weight: var(--fk-font-weight-label);\n line-height: var(--fk-line-height-label);\n}\n\n.spatialWrap {\n .spatialListUpload {\n width: 100%;\n left: 0;\n top: 78px;\n }\n}\n</style>\n"],"names":["instance","getCurrentInstance","route","useRoute","dpiContext","useDpiContext","props","__props","requestAutocompleteSuggestions","useAutocomplete","listOfVoc","ref","typeText","inputText","voc","matches","manURL","useStore","t","locale","useI18n","ted","useTed","man","vocSearch","isEdit","computed","_a","resourceNameWhenEditing","keyFromResourceName","spatialVocabName","maybePrefix","vocabKey","translatedResourceName","vocabKeyUpper","word","execute","state","isLoading","useRequestUriName","restoredValueFromEditMode","once","watchEffect","whenever","v","vocabularyOnly","_b","watch","getAutocompleteSuggestions","newValue","oldValue","onMounted","nextTick","showTable","activeInput","closeAll","element","removeProperty","e","saveToLocal","el","pathToLocalStorage","arr","index","vocCache","text","response","r","getTranslationFor","reactive","I1","I2","I3","onClickOutside","event","manURLInput","handleSpatielListClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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ACpDK,MAAM,qBACFL,EAAU,UAAU,OAEnBA,EAAU,QAAQ,CAACA,EAAU;AAAA,IAE1C;AACA,aAASsB,GAAYjB,GAAG;AACpB,MAAApD,EAAM,QAAQ,KAAK,MAAM,EAAE,MAAQoD,EAAE,OAAO,OAAO,UAAYA,EAAE,OAAO,MAAK,CAAE;AAAA,IACnF;AAEA,aAASkB,GAAuBhB,GAAI;AAClC,MAAAtD,EAAM,QAAQ,KAAK,MAAMsD,CAAE,GAC3B/C,EAAU,QAAQ+C,EAAG,MACrBN,EAAY,gBAAgB,GAC5BD,EAAU,QAAQ,IAClBM,GAAc;AAAA,IAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"SpatialInput.vue.mjs","sources":["../../../lib/data-provider-interface/components/SpatialInput.vue"],"sourcesContent":["<script setup>\n\nimport { ref, reactive, watch, computed, onBeforeMount, onMounted, nextTick, watchEffect } from 'vue';\nimport { useStore } from 'vuex';\nimport { getTranslationFor } from \"../../utils/helpers\";\nimport { onClickOutside, whenever } from '@vueuse/core'\nimport { getCurrentInstance } from \"vue\";\nimport { useRoute } from 'vue-router';\nimport { useI18n } from 'vue-i18n';\nimport { useTed } from '../../composables/useTed';\nimport { useAutocomplete } from '../composables/aucotomplete';\nimport { useRequestUriName } from '../composables/useRequestUriName';\nimport { useDpiContext } from '../composables';\n\n\nlet instance = getCurrentInstance().appContext.app.config.globalProperties.$env\nlet route = useRoute();\nconst dpiContext = useDpiContext();\n\nconst props = defineProps({\n context: Object,\n})\n\nconst { requestAutocompleteSuggestions } = useAutocomplete()\n\n// let listOfVoc: [{ item: 'Country', active: false }, { item: 'Place', active: false }, { item: 'Continent', active: false }],\nlet listOfVoc = ref([])\nconst typeText = ref('')\nlet inputText = ref({})\nlet voc = ref({})\nlet matches = ref({})\nlet manURL = ref({})\nconst store = useStore();\nconst { t, locale } = useI18n({ inheritLocale: true, useScope: 'global' });\nconst ted = useTed();\n\nconst man = ref(false)\nconst vocSearch = ref(false)\n\nconst isEdit = computed(() => !!dpiContext.value.edit?.enabled)\nconst resourceNameWhenEditing = computed(() => !!isEdit.value && props.context.value.resource)\n// e.g. extract \"municipalityKey\" (second to last) out of resourceName\nconst keyFromResourceName = computed(() => {\n if (resourceNameWhenEditing.value) {\n return resourceNameWhenEditing.value.split('/')[resourceNameWhenEditing.value.split('/').length - 2]\n }\n return ''\n})\nconst spatialVocabName = computed(() => {\n if (!keyFromResourceName.value) {\n return ''\n }\n\n const maybePrefix = props.context.attrs.identifier === 'politicalGeocodingURI'\n ? 'political-geocoding-'\n // todo: extend this for other vocabularies\n : ''\n\n // transform key from camelCase to kebab-case\n const vocabKey = keyFromResourceName.value.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase()\n return `${maybePrefix}${vocabKey}`\n})\n\nconst translatedResourceName = computed(() => {\n // transform key 'districtKey' to 'District Key'\n const vocabKey = keyFromResourceName.value.replace(/([a-z])([A-Z])/g, '$1 $2').toLowerCase()\n // make first letters of each word uppercase\n const vocabKeyUpper = vocabKey.split(' ').map(word => word.charAt(0).toUpperCase() + word.slice(1)).join(' ')\n return t(`message.dataupload.datasets.conditional.${vocabKeyUpper}`)\n})\n\nconst { execute, state, isLoading } = useRequestUriName({\n voc: spatialVocabName,\n res: computed(() => props.context.value.resource),\n // property: 'dcatde:politicalGeocodingURI',\n property: computed(() => props.context.attrs.identifier === 'politicalGeocodingURI' ? 'dcatde:politicalGeocodingURI' : 'dct:spatial'), \n locale,\n})\n\nconst restoredValueFromEditMode = computed(() => {\n if (isEdit.value && !isLoading.value && resourceNameWhenEditing.value && state.value) {\n return `${translatedResourceName.value}: ${state.value} (${resourceNameWhenEditing.value.split('/').pop()})`\n }\n\n return ''\n})\n\nconst once = ref(false)\nwatchEffect(() => {\n if (once.value) return;\n\n if (!!resourceNameWhenEditing.value) {\n once.value = true\n execute()\n }\n}, { immediate: true })\n\nwhenever(restoredValueFromEditMode, () => {\n const v = { name: restoredValueFromEditMode.value, resource: resourceNameWhenEditing.value }\n props.context.node.input(v)\n})\n\n// If true, then:\n// - hides the select input for manual and vocabulary\n// - pre-selects the vocabulary option\n// When using formkit schema, enable this option by setting vocabularyOnly to true\n// {\n// $formkit: 'spatialinput',\n// name: 'dcatde:politicalGeocodingURI',\n// identifier: 'politicalGeocodingURI',\n// vocabularyOnly: true,\n// }\nconst vocabularyOnly = computed(() => !!props.context?.attrs?.vocabularyOnly)\n\nif (props.context.attrs.identifier === 'politicalGeocodingURI') {\n listOfVoc.value.push(\n { item: 'Municipality Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Municipality Key', 'Municipality Key') },\n { item: 'Regional Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Regional Key', 'Regional Key') },\n { item: 'Municipal Association Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Municipal Association Key', 'Municipal Association Key') },\n { item: 'District Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.District Key', 'District Key') },\n { item: 'Government District Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.Government District Key', 'Government District Key') },\n { item: 'State Key', active: false, placeholder: ted('message.dataupload.datasets.conditional.State Key', 'State Key') },\n )\n\n}\nif (props.context.attrs.identifier === 'spatial') {\n listOfVoc.value.push(\n { item: 'Country', active: false, placeholder: ted('message.dataupload.datasets.conditional.Country', 'Country') },\n { item: 'Place', active: false, placeholder: ted('message.dataupload.datasets.conditional.Place', 'Place') },\n { item: 'Continent', active: false, placeholder: ted('message.dataupload.datasets.conditional.Continent', 'Continent') },\n )\n}\n\nwatch(inputText, async () => {\n getAutocompleteSuggestions();\n})\nwatch(voc, async (newValue, oldValue) => {\n if (newValue === oldValue) { return }\n voc.value = voc.value.toLowerCase();\n})\nwatch(manURL, async () => {\n props.context.node.input({ 'name': manURL, 'resource': manURL })\n})\nonMounted(async () => {\n matches = [{ name: ted('message.dataupload.info.searchVocabulary', '--- Type in anything for a live search of the vocabulary ---').value, resource: 'invalid' }]\n\n await nextTick()\n // DOM loaded\n if (props.context.value.name === undefined || props.context.value.name === \"\") {\n showTable.activeValue = false\n } else showTable.activeValue = true\n // console.log(showTable.activeValue);\n\n if (vocabularyOnly.value) {\n activeInput('showTable'); vocSearch.value = true; if (man.value) { man.value = false }\n }\n\n});\n\nfunction closeAll() {\n listOfVoc.value.forEach(element => {\n element.active = false;\n });\n}\nfunction removeProperty(e) {\n // props.context.value = {}\n showTable.activeValue = false\n props.context.node.input({})\n}\nfunction saveToLocal(el) {\n\n let pathToLocalStorage = JSON.parse(localStorage.getItem(`dpi_${route.params.property}`));\n let arr\n if (props.context.attrs.identifier === 'politicalGeocodingURI') {\n arr = pathToLocalStorage.Advised['dcatde:politicalGeocodingURI'];\n }\n else arr = pathToLocalStorage.Advised['dct:spatial'];\n\n arr.forEach((element, index) => {\n if (Object.keys(element).length === 0) {\n arr.splice(index, 1)\n }\n })\n arr.push(props.context.node._value)\n if (props.context.attrs.identifier === 'politicalGeocodingURI') {\n pathToLocalStorage.Advised['dcatde:politicalGeocodingURI'] = arr\n }\n else pathToLocalStorage.Advised['dct:spatial'] = arr\n\n localStorage.setItem(`dpi_${route.params.property}`, JSON.stringify(pathToLocalStorage))\n}\nconst getAutocompleteSuggestions = async () => {\n\n let vocCache = voc.value?.toLowerCase()\n\n if (props.context.attrs.identifier === 'politicalGeocodingURI') {\n\n vocCache = 'political-geocoding-' + vocCache.toLowerCase().replaceAll(\" \", '-')\n\n try {\n let text = inputText.value;\n await requestAutocompleteSuggestions({ voc: vocCache, text: text, base: instance.api.baseUrl }).then((response) => {\n const results = response.data.result.results.map((r) => ({\n name: getTranslationFor(r.alt_label, locale.value, []) + \" (\" + r.id + \")\",\n resource: r.resource,\n }));\n matches = results;\n });\n } catch (error) {\n }\n }\n else {\n try {\n let text = inputText.value;\n await requestAutocompleteSuggestions({ voc: vocCache, text: text, base: instance.api.baseUrl }).then((response) => {\n const results = response.data.result.results.map((r) => ({\n name: getTranslationFor(r.pref_label, locale.value, []) + \" (\" + r.id + \")\",\n resource: r.resource,\n }));\n matches = results;\n });\n } catch (error) {\n }\n }\n\n}\n\nvar showTable = reactive({\n first: false,\n second: false,\n third: false,\n activeValue: false\n})\n\nconst I1 = ref(null);\nconst I2 = ref(null);\nconst I3 = ref(null);\n\nonClickOutside(I1, event => showTable.first = false)\nonClickOutside(I2, event => showTable.second = false)\nonClickOutside(I3, event => showTable.third = false)\nfunction activeInput(e) {\n\n // console.log('in', showTable);\n if (e === \"showTable\") showTable.first = !showTable.first;\n if (e === \"showVocTable\") showTable.second = !showTable.second;\n if (e === \"showVocEntries\") {\n if (showTable.third === true) {\n }\n else showTable.third = !showTable.third;\n }\n}\nfunction manURLInput(e) {\n props.context.node.input({ 'name': e.target.value, 'resource': e.target.value })\n}\n\nfunction handleSpatielListClick(el) {\n props.context.node.input(el);\n inputText.value = el.name;\n activeInput('showVocEntries');\n showTable.third = false;\n saveToLocal(el)\n}\n\nfunction submitType() {\n activeInput('showVocTable');\n\n}\n// console.log(voc);\n</script>\n\n<template>\n <div class=\"d-flex flex-column w-100 spatialWrap\">\n <div class=\"d-flex formkit-inner mx-3 mb-3\" v-if=\"!props.context.attrs.multiple && showTable.activeValue\">\n <!-- <div class=\"infoI\">\n <div class=\"tooltipFormkit\">{{ props.context.attrs.info }}</div>\n </div> -->\n <a class=\"autocompleteInputSingleValue \">{{ restoredValueFromEditMode }}</a>\n <div class=\"removeX\" @click=\"removeProperty\"></div>\n </div>\n <div v-else>\n <div class=\" w-100 d-flex\">\n <div v-if=\"!vocabularyOnly\" class=\"d-flex position-relative m-3 w-100\">\n <label class=\"w-100\"> {{ $t('message.dataupload.info.preferredInput') }}\n <input id=\"I1\" type=\"text\" class=\"selectInputField formkit-inner\" readonly=\"readonly\"\n :placeholder=\"$t('message.dataupload.info.preferredInput')\"\n @click=\"activeInput('showTable')\" />\n </label>\n\n <ul ref=\"I1\" v-show=\"showTable.first\" class=\"spatialListUpload\">\n <li @click=\"activeInput('showTable'); man = true; if (vocSearch) { vocSearch = false; };\"\n class=\"p-2 border-b border-gray-200 choosableItemsAC\">\n {{ $t('message.dataupload.datasets.conditional.manually') }}\n </li>\n <li @click=\"activeInput('showTable'); vocSearch = true; if (man) { man = false }\"\n class=\"p-2 border-b border-gray-200 choosableItemsAC\">\n {{ $t('message.dataupload.datasets.conditional.vocabulary') }}\n </li>\n </ul>\n </div>\n <div v-if=\"man\" class=\"d-flex position-relative m-3 w-100\">\n <label class=\"w-100\">\n <!-- todo: I borrowed this from another input. Maybe refactor? -->\n {{ $te('message.dataupload.datasets.isReferencedByUrl.placeholder') ? $t('message.dataupload.datasets.isReferencedByUrl.placeholder') : 'Provide an URL' }}\n <input type=\"URL\" class=\"selectInputField formkit-inner\" placeholder=\"URL\"\n @input=\"manURLInput($event)\">\n </label>\n </div>\n <div v-if=\"vocSearch\" class=\"d-flex position-relative m-3 w-100\">\n <!-- todo: I borrowed this from another input. Maybe refactor? -->\n <label class=\"w-100\"> {{ $te('message.dataupload.datasets.contributorType.placeholder') ? $t('message.dataupload.datasets.contributorType.placeholder') : 'Choose type of vocabulary' }} \n <input id=\"I2\" type=\"text\" class=\"selectInputField formkit-inner\" readonly=\"readonly\" v-model=\"typeText\"\n :placeholder=\"$te('message.dataupload.datasets.accessRights.placeholder') ? $t('message.dataupload.datasets.accessRights.placeholder') : 'Choose type of vocabulary'\" @click=\"activeInput('showVocTable');\">\n </label>\n <ul ref=\"I2\" v-if=\"showTable.second\" class=\"spatialListUpload\">\n <li v-for=\"el in listOfVoc\" :key=\"el\" class=\"p-2 border-b border-gray-200 choosableItemsAC\"\n @click=\" closeAll(); el.active = !el.active; activeInput('showVocTable'); inputText = ''; voc = el.item; typeText = el.placeholder\">\n {{ $t('message.dataupload.datasets.conditional.' + el.item) }}</li>\n </ul>\n </div>\n </div>\n <div class=\"m-3\" v-if=\"vocSearch\">\n <div v-for=\"el in listOfVoc\" :key=\"el\" class=\"position-relative\">\n <label class=\"w-100\" v-if=\"el.active\">\n <!-- todo: I borrowed this from another input. Maybe refactor? -->\n <!-- {{ $te('message.dataupload.datasets.accessRights.placeholder') ? $t('message.dataupload.datasets.accessRights.placeholder') : 'Choose type of vocabulary' }} -->\n {{ el.placeholder ? el.placeholder : $t('message.dataupload.datasets.conditional.' + el.item) }}\n <input id=\"I3\" type=\"text\"\n v-model=\"inputText\" class=\"selectInputField formkit-inner\" :placeholder=\"$te('message.dataupload.datasets.accessRights.placeholder') ? $t('message.dataupload.datasets.accessRights.placeholder') : 'Choose type of vocabulary'\"\n @click=\"activeInput('showVocEntries'); inputText = ''\"\n >\n </label>\n <ul ref=\"I3\" v-if=\"showTable.third && el.active\" class=\"spatialListUpload\">\n <li v-for=\"el in matches\" :key=\"el\" class=\"p-2 border-b border-gray-200 choosableItemsAC\"\n @click=\"handleSpatielListClick(el)\">\n {{ el.name }}</li>\n </ul>\n </div>\n\n </div>\n\n </div>\n </div>\n</template>\n\n<script>\n\n</script>\n\n<style lang=\"scss\" scoped>\n.spatialWrap label {\n font-family: var(--fk-font-family-label);\n font-size: var(--fk-font-size-label);\n font-weight: var(--fk-font-weight-label);\n line-height: var(--fk-line-height-label);\n}\n\n.spatialWrap {\n .spatialListUpload {\n width: 100%;\n left: 0;\n top: 78px;\n }\n}\n</style>\n"],"names":["instance","getCurrentInstance","route","useRoute","dpiContext","useDpiContext","props","__props","requestAutocompleteSuggestions","useAutocomplete","listOfVoc","ref","typeText","inputText","voc","matches","manURL","useStore","t","locale","useI18n","ted","useTed","man","vocSearch","isEdit","computed","_a","resourceNameWhenEditing","keyFromResourceName","spatialVocabName","maybePrefix","vocabKey","translatedResourceName","vocabKeyUpper","word","execute","state","isLoading","useRequestUriName","restoredValueFromEditMode","once","watchEffect","whenever","v","vocabularyOnly","_b","watch","getAutocompleteSuggestions","newValue","oldValue","onMounted","nextTick","showTable","activeInput","closeAll","element","removeProperty","e","saveToLocal","el","pathToLocalStorage","arr","index","vocCache","text","response","r","getTranslationFor","reactive","I1","I2","I3","onClickOutside","event","manURLInput","handleSpatielListClick"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,QAAIA,IAAWC,GAAkB,EAAG,WAAW,IAAI,OAAO,iBAAiB,MACvEC,IAAQC,GAAQ;AACpB,UAAMC,IAAaC,GAAa,GAE1BC,IAAQC,GAIR,EAAE,gCAAAC,EAAgC,IAAGC,GAAgB;AAG3D,QAAIC,IAAYC,EAAI,EAAE;AACtB,UAAMC,IAAWD,EAAI,EAAE;AACvB,QAAIE,IAAYF,EAAI,EAAE,GAClBG,IAAMH,EAAI,EAAE,GACZI,IAAUJ,EAAI,EAAE,GAChBK,IAASL,EAAI,EAAE;AACL,IAAAM,GAAU;AACxB,UAAM,EAAE,GAAAC,GAAG,QAAAC,EAAQ,IAAGC,GAAQ,EAAE,eAAe,IAAM,UAAU,SAAQ,CAAE,GACnEC,IAAMC,GAAM,GAEZC,IAAMZ,EAAI,EAAK,GACfa,IAAYb,EAAI,EAAK,GAErBc,IAASC,EAAS;;AAAM,cAAC,GAACC,IAAAvB,EAAW,MAAM,SAAjB,QAAAuB,EAAuB;AAAA,KAAO,GACxDC,IAA0BF,EAAS,MAAM,CAAC,CAACD,EAAO,SAASnB,EAAM,QAAQ,MAAM,QAAQ,GAEvFuB,IAAsBH,EAAS,MAC7BE,EAAwB,QACjBA,EAAwB,MAAM,MAAM,GAAG,EAAEA,EAAwB,MAAM,MAAM,GAAG,EAAE,SAAS,CAAC,IAEhG,EACV,GACKE,IAAmBJ,EAAS,MAAM;AACtC,UAAI,CAACG,EAAoB;AACvB,eAAO;AAGT,YAAME,IAAczB,EAAM,QAAQ,MAAM,eAAe,0BACnD,yBAEA,IAGE0B,IAAWH,EAAoB,MAAM,QAAQ,mBAAmB,OAAO,EAAE,YAAY;AAC3F,aAAO,GAAGE,CAA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DoB,EAAeD,GAAI,CAAAE,MAASrB,EAAU,QAAQ,EAAK;AACnD,aAASC,EAAYI,GAAG;AAGpB,MAAIA,MAAM,gBAAaL,EAAU,QAAQ,CAACA,EAAU,QAChDK,MAAM,mBAAgBL,EAAU,SAAS,CAACA,EAAU,SACpDK,MAAM,qBACFL,EAAU,UAAU,OAEnBA,EAAU,QAAQ,CAACA,EAAU;AAAA,IAE1C;AACA,aAASsB,GAAYjB,GAAG;AACpB,MAAApD,EAAM,QAAQ,KAAK,MAAM,EAAE,MAAQoD,EAAE,OAAO,OAAO,UAAYA,EAAE,OAAO,MAAK,CAAE;AAAA,IACnF;AAEA,aAASkB,GAAuBhB,GAAI;AAClC,MAAAtD,EAAM,QAAQ,KAAK,MAAMsD,CAAE,GAC3B/C,EAAU,QAAQ+C,EAAG,MACrBN,EAAY,gBAAgB,GAC5BD,EAAU,QAAQ,IAClBM,GAAc;AAAA,IAChB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,10 +1,10 @@
1
- import { getCurrentInstance as g, ref as l, computed as D, onMounted as h, watchEffect as q, resolveComponent as $, openBlock as o, createElementBlock as b, createElementVNode as _, toDisplayString as y, createTextVNode as k, createBlock as r } from "vue";
1
+ import { getCurrentInstance as I, ref as l, computed as D, onMounted as h, watchEffect as q, resolveComponent as b, openBlock as o, createElementBlock as $, createElementVNode as _, toDisplayString as y, createTextVNode as k, createBlock as r } from "vue";
2
2
  import "vue-router";
3
3
  import { isNil as C } from "lodash-es";
4
- import U from "axios";
5
- import { useStore as x } from "vuex";
6
- import { useI18n as E } from "vue-i18n";
7
- import { useDpiContext as N } from "../composables/useDpiContext.mjs";
4
+ import S from "axios";
5
+ import { useStore as U } from "vuex";
6
+ import { useI18n as x } from "vue-i18n";
7
+ import { useDpiContext as E } from "../composables/useDpiContext.mjs";
8
8
  import "@formkit/core";
9
9
  import "merge-anything";
10
10
  import "../../configurations/config-schema/apiSchema.mjs";
@@ -17,18 +17,18 @@ import "../../configurations/config-schema/themesSchema.mjs";
17
17
  import "../../configurations/config-schema/trackerSchema.mjs";
18
18
  import "../../configurations/config-schema/configSchema.mjs";
19
19
  import "../../utils/helpers.mjs";
20
- const S = { class: "formkitProperty DSid" }, B = {
20
+ const N = { class: "formkitProperty DSid" }, B = {
21
21
  props: ["context"]
22
22
  }, te = /* @__PURE__ */ Object.assign(B, {
23
23
  __name: "UniqueIdentifierInput",
24
24
  setup(F) {
25
- let u = g().appContext.app.config.globalProperties.$env;
26
- const n = x(), p = N(), d = l(), m = D(() => {
25
+ let u = I().appContext.app.config.globalProperties.$env;
26
+ const n = U(), p = E(), d = l(), m = D(() => {
27
27
  var e;
28
28
  return !!((e = p.value.edit) != null && e.enabled);
29
29
  });
30
30
  d.value = localStorage.getItem("dpi_duplicate");
31
- const { t: i, locale: M } = E(), a = l({
31
+ const { t: i, locale: M } = x({ useScope: "global" }), a = l({
32
32
  idformatvalid: "",
33
33
  idunique: "",
34
34
  required: ""
@@ -46,8 +46,8 @@ const S = { class: "formkitProperty DSid" }, B = {
46
46
  else if (v.includes(e.value))
47
47
  t = !1;
48
48
  else {
49
- const I = `${s}datasets/${e.value}?useNormalizedId=true`;
50
- U.head(I).then(() => {
49
+ const g = `${s}datasets/${e.value}?useNormalizedId=true`;
50
+ S.head(g).then(() => {
51
51
  t = !1;
52
52
  }).catch((P) => {
53
53
  t = !0;
@@ -59,8 +59,8 @@ const S = { class: "formkitProperty DSid" }, B = {
59
59
  return /^[a-z0-9-]*$/.test(e.value);
60
60
  }
61
61
  return (e, t) => {
62
- const s = $("FormKit");
63
- return o(), b("div", S, [
62
+ const s = b("FormKit");
63
+ return o(), $("div", N, [
64
64
  _("h4", null, y(e.$t("message.dataupload.datasets.datasetID.label")), 1),
65
65
  t[0] || (t[0] = k()),
66
66
  !m.value || d.value ? (o(), r(s, {
@@ -1 +1 @@
1
- {"version":3,"file":"UniqueIdentifierInput.vue.mjs","sources":["../../../lib/data-provider-interface/components/UniqueIdentifierInput.vue"],"sourcesContent":["<script setup>\nimport { ref, onMounted, watchEffect, computed } from 'vue'\nimport { useRoute } from 'vue-router';\nimport { isNil } from 'lodash';\nimport axios from 'axios';\nimport { useStore } from 'vuex';\nimport { getCurrentInstance } from \"vue\";\nimport { useI18n } from 'vue-i18n';\nimport { useDpiContext } from '../composables';\nlet env = getCurrentInstance().appContext.app.config.globalProperties.$env;\n\nconst store = useStore();\nconst dpiContext = useDpiContext();\nconst isDuplicate = ref();\nconst isEditMode = computed(() => !!dpiContext.value.edit?.enabled)\nisDuplicate.value = localStorage.getItem('dpi_duplicate');\n\nconst { t, locale } = useI18n();\n\nconst validationMessages = ref({\n idformatvalid: \"\",\n idunique: \"\",\n required: \"\"\n\n});\n\nonMounted(() => {\n // This is kind of buggy, its taking the strings from the wrong json (de and en is switched)\n validationMessages.value.idformatvalid = t('message.dataupload.datasets.datasetID.invalidFormat');\n validationMessages.value.idunique = t('message.dataupload.datasets.datasetID.duplicate');\n validationMessages.value.required = t('message.dataupload.datasets.datasetID.required');\n});\n\n\nwatchEffect(() => {\n\n\n});\n\n\n\nasync function idunique(node) {\n let isUniqueID = true;\n let hubUrl = env.api.hubUrl;\n const draftIDs = store.getters['auth/getUserDraftIds'];\n\n new Promise(() => {\n if (isNil(node.value) || node.value === '' || node.value === undefined) isUniqueID = true;\n else if (draftIDs.includes(node.value)) isUniqueID = false;\n else {\n const request = `${hubUrl}datasets/${node.value}?useNormalizedId=true`;\n axios.head(request)\n .then(() => {\n isUniqueID = false;\n })\n .catch((e) => {\n isUniqueID = true;\n });\n }\n });\n return isUniqueID;\n}\n\nfunction idformatvalid(node) {\n return /^[a-z0-9-]*$/.test(node.value);\n}\n\n</script>\n\n<template>\n <div class=\"formkitProperty DSid\">\n <h4>{{ $t(`message.dataupload.datasets.datasetID.label`) }}</h4>\n <FormKit v-if=\"!isEditMode || isDuplicate\" type=\"text\" name=\"datasetID\" id=\"datasetID\"\n :placeholder=\"$t(`message.dataupload.datasets.datasetID.label`)\"\n :info=\"$t(`message.dataupload.datasets.datasetID.info`)\" :help=\"$t(`message.dataupload.datasets.datasetID.help`)\"\n :validation-rules=\"{ idformatvalid, idunique }\" validation=\"idformatvalid|idunique|required\"\n validation-visibility=\"live\" :validation-messages=\"validationMessages\" outer-class=\"formkitCmpWrap p-3\">\n </FormKit>\n <FormKit v-else type=\"text\" name=\"datasetID\" id=\"datasetID\" :disabled=\"true\"\n :info=\"$t(`message.dataupload.datasets.datasetID.info`)\" :help=\"$t(`message.dataupload.datasets.datasetID.help`)\">\n </FormKit>\n </div>\n</template>\n\n<script>\nexport default {\n props: ['context']\n}\n</script>\n\n<style></style>\n"],"names":["__default__","env","getCurrentInstance","store","useStore","dpiContext","useDpiContext","isDuplicate","ref","isEditMode","computed","_a","t","locale","useI18n","validationMessages","onMounted","watchEffect","idunique","node","isUniqueID","hubUrl","draftIDs","isNil","request","axios","e","idformatvalid"],"mappings":";;;;;;;;;;;;;;;;;;;6CAqFeA,IAAA;AAAA,EACb,OAAO,CAAC,SAAS;AACnB;;;AA9EA,QAAIC,IAAMC,EAAkB,EAAG,WAAW,IAAI,OAAO,iBAAiB;AAEtE,UAAMC,IAAQC,EAAQ,GAChBC,IAAaC,EAAa,GAC1BC,IAAcC,EAAG,GACjBC,IAAaC,EAAS;;AAAM,cAAC,GAACC,IAAAN,EAAW,MAAM,SAAjB,QAAAM,EAAuB;AAAA,KAAO;AAClE,IAAAJ,EAAY,QAAQ,aAAa,QAAQ,eAAe;AAExD,UAAM,EAAE,GAAAK,GAAG,QAAAC,MAAWC,KAEhBC,IAAqBP,EAAI;AAAA,MAC7B,eAAe;AAAA,MACf,UAAU;AAAA,MACV,UAAU;AAAA,IAEZ,CAAC;AAED,IAAAQ,EAAU,MAAM;AAEd,MAAAD,EAAmB,MAAM,gBAAgBH,EAAE,qDAAqD,GAChGG,EAAmB,MAAM,WAAWH,EAAE,iDAAiD,GACvFG,EAAmB,MAAM,WAAWH,EAAE,gDAAgD;AAAA,IACxF,CAAC,GAGDK,EAAY,MAAM;AAAA,IAGlB,CAAC;AAID,mBAAeC,EAASC,GAAM;AAC5B,UAAIC,IAAa,IACbC,IAASpB,EAAI,IAAI;AACrB,YAAMqB,IAAWnB,EAAM,QAAQ,sBAAsB;AAErD,iBAAI,QAAQ,MAAM;AAChB,YAAIoB,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,QACL;AAAA,MACJ,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, computed } from 'vue'\nimport { useRoute } from 'vue-router';\nimport { isNil } from 'lodash';\nimport axios from 'axios';\nimport { useStore } from 'vuex';\nimport { getCurrentInstance } from \"vue\";\nimport { useI18n } from 'vue-i18n';\nimport { useDpiContext } from '../composables';\nlet env = getCurrentInstance().appContext.app.config.globalProperties.$env;\n\nconst store = useStore();\nconst dpiContext = useDpiContext();\nconst isDuplicate = ref();\nconst isEditMode = computed(() => !!dpiContext.value.edit?.enabled)\nisDuplicate.value = localStorage.getItem('dpi_duplicate');\n\nconst { t, locale } = useI18n({ useScope: 'global' });\n\nconst validationMessages = ref({\n idformatvalid: \"\",\n idunique: \"\",\n required: \"\"\n\n});\n\nonMounted(() => {\n // This is kind of buggy, its taking the strings from the wrong json (de and en is switched)\n validationMessages.value.idformatvalid = t('message.dataupload.datasets.datasetID.invalidFormat');\n validationMessages.value.idunique = t('message.dataupload.datasets.datasetID.duplicate');\n validationMessages.value.required = t('message.dataupload.datasets.datasetID.required');\n});\n\n\nwatchEffect(() => {\n\n\n});\n\n\n\nasync function idunique(node) {\n let isUniqueID = true;\n let hubUrl = env.api.hubUrl;\n const draftIDs = store.getters['auth/getUserDraftIds'];\n\n new Promise(() => {\n if (isNil(node.value) || node.value === '' || node.value === undefined) isUniqueID = true;\n else if (draftIDs.includes(node.value)) isUniqueID = false;\n else {\n const request = `${hubUrl}datasets/${node.value}?useNormalizedId=true`;\n axios.head(request)\n .then(() => {\n isUniqueID = false;\n })\n .catch((e) => {\n isUniqueID = true;\n });\n }\n });\n return isUniqueID;\n}\n\nfunction idformatvalid(node) {\n return /^[a-z0-9-]*$/.test(node.value);\n}\n\n</script>\n\n<template>\n <div class=\"formkitProperty DSid\">\n <h4>{{ $t(`message.dataupload.datasets.datasetID.label`) }}</h4>\n <FormKit v-if=\"!isEditMode || isDuplicate\" type=\"text\" name=\"datasetID\" id=\"datasetID\"\n :placeholder=\"$t(`message.dataupload.datasets.datasetID.label`)\"\n :info=\"$t(`message.dataupload.datasets.datasetID.info`)\" :help=\"$t(`message.dataupload.datasets.datasetID.help`)\"\n :validation-rules=\"{ idformatvalid, idunique }\" validation=\"idformatvalid|idunique|required\"\n validation-visibility=\"live\" :validation-messages=\"validationMessages\" outer-class=\"formkitCmpWrap p-3\">\n </FormKit>\n <FormKit v-else type=\"text\" name=\"datasetID\" id=\"datasetID\" :disabled=\"true\"\n :info=\"$t(`message.dataupload.datasets.datasetID.info`)\" :help=\"$t(`message.dataupload.datasets.datasetID.help`)\">\n </FormKit>\n </div>\n</template>\n\n<script>\nexport default {\n props: ['context']\n}\n</script>\n\n<style></style>\n"],"names":["__default__","env","getCurrentInstance","store","useStore","dpiContext","useDpiContext","isDuplicate","ref","isEditMode","computed","_a","t","locale","useI18n","validationMessages","onMounted","watchEffect","idunique","node","isUniqueID","hubUrl","draftIDs","isNil","request","axios","e","idformatvalid"],"mappings":";;;;;;;;;;;;;;;;;;;6CAqFeA,IAAA;AAAA,EACb,OAAO,CAAC,SAAS;AACnB;;;AA9EA,QAAIC,IAAMC,EAAkB,EAAG,WAAW,IAAI,OAAO,iBAAiB;AAEtE,UAAMC,IAAQC,EAAQ,GAChBC,IAAaC,EAAa,GAC1BC,IAAcC,EAAG,GACjBC,IAAaC,EAAS;;AAAM,cAAC,GAACC,IAAAN,EAAW,MAAM,SAAjB,QAAAM,EAAuB;AAAA,KAAO;AAClE,IAAAJ,EAAY,QAAQ,aAAa,QAAQ,eAAe;AAExD,UAAM,EAAE,GAAAK,GAAG,QAAAC,MAAWC,EAAQ,EAAE,UAAU,SAAQ,CAAE,GAE9CC,IAAqBP,EAAI;AAAA,MAC7B,eAAe;AAAA,MACf,UAAU;AAAA,MACV,UAAU;AAAA,IAEZ,CAAC;AAED,IAAAQ,EAAU,MAAM;AAEd,MAAAD,EAAmB,MAAM,gBAAgBH,EAAE,qDAAqD,GAChGG,EAAmB,MAAM,WAAWH,EAAE,iDAAiD,GACvFG,EAAmB,MAAM,WAAWH,EAAE,gDAAgD;AAAA,IACxF,CAAC,GAGDK,EAAY,MAAM;AAAA,IAGlB,CAAC;AAID,mBAAeC,EAASC,GAAM;AAC5B,UAAIC,IAAa,IACbC,IAASpB,EAAI,IAAI;AACrB,YAAMqB,IAAWnB,EAAM,QAAQ,sBAAsB;AAErD,iBAAI,QAAQ,MAAM;AAChB,YAAIoB,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,QACL;AAAA,MACJ,CAAG,GACMA;AAAA,IACT;AAEA,aAASO,EAAcR,GAAM;AAC3B,aAAO,eAAe,KAAKA,EAAK,KAAK;AAAA,IACvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -4,3 +4,4 @@ export * from './useDpiContext';
4
4
  export * from './useDpiEditMode';
5
5
  export * from './useDpiStepper';
6
6
  export * from './useRequestUriName';
7
+ export * from './useFormSchema';
@@ -1,26 +1,25 @@
1
1
  import { useRoute as D } from "vue-router";
2
- import { computed as o, toValue as n } from "vue";
3
- import { useStore as I } from "vuex";
4
- import { useRuntimeEnv as $ } from "../../composables/useRuntimeEnv.mjs";
5
- import { useAsyncState as q } from "../../external/@vueuse/core/index";
6
- import { watchOnce as S } from "../../external/@vueuse/shared/index";
7
- function N(s) {
8
- const r = D(), a = I(), i = $(), l = o(() => {
2
+ import { computed as o, toValue as n, watch as I } from "vue";
3
+ import { useStore as $ } from "vuex";
4
+ import { useRuntimeEnv as q } from "../../composables/useRuntimeEnv.mjs";
5
+ import { useAsyncState as S } from "../../external/@vueuse/core/index";
6
+ function w(s) {
7
+ const r = D(), a = $(), u = q(), m = o(() => {
9
8
  var t, e;
10
9
  return ((e = (t = n(s)) == null ? void 0 : t.edit) == null ? void 0 : e.enabled) ?? r.query.edit === "true";
11
- }), u = o(() => {
10
+ }), i = o(() => {
12
11
  var t, e;
13
12
  return ((e = (t = n(s)) == null ? void 0 : t.edit) == null ? void 0 : e.id) ?? r.query.id;
14
13
  }), d = o(() => {
15
14
  var t, e;
16
15
  return ((e = (t = n(s)) == null ? void 0 : t.edit) == null ? void 0 : e.fromDraft) ?? r.query.fromDraft ?? a.getters["auth/getIsDraft"];
17
16
  });
18
- l.value && (localStorage.setItem("dpi_editmode", "false"), a.dispatch("auth/setIsEditMode", !1));
17
+ m.value && (localStorage.setItem("dpi_editmode", "false"), a.dispatch("auth/setIsEditMode", !1));
19
18
  const c = o(() => {
20
- var m;
21
- const t = d.value, e = (m = a.getters["auth/getUserData"]) == null ? void 0 : m.rtpToken, g = r.params.property, h = r.params.id;
22
- return { endpoint: t ? `${i.api.hubUrl}drafts/datasets/${u.value}.nt?catalogue=${r.query.catalog}` : r.params.property === "catalogues" ? `${i.api.hubUrl}catalogues/${r.query.catalog}.nt` : `${i.api.hubUrl}datasets/${u.value}.nt?useNormalizedId=true`, token: e, property: g, id: h };
23
- }), { execute: f, isLoading: v, error: y } = q(
19
+ var l;
20
+ const t = d.value, e = (l = a.getters["auth/getUserData"]) == null ? void 0 : l.rtpToken, g = r.params.property, h = r.params.id;
21
+ return { endpoint: t ? `${u.api.hubUrl}drafts/datasets/${i.value}.nt?catalogue=${r.query.catalog}` : r.params.property === "catalogues" ? `${u.api.hubUrl}catalogues/${r.query.catalog}.nt` : `${u.api.hubUrl}datasets/${i.value}.nt?useNormalizedId=true`, token: e, property: g, id: h };
22
+ }), { execute: f, isLoading: v, error: y } = S(
24
23
  async () => await a.dispatch(
25
24
  "dpiStore/convertToInput",
26
25
  { ...c.value }
@@ -29,8 +28,8 @@ function N(s) {
29
28
  {
30
29
  immediate: !1
31
30
  }
32
- ), p = o(() => !!u.value && !!c.value.token);
33
- return S(p, () => {
31
+ ), p = o(() => !!i.value && !!c.value.token);
32
+ return I(p, () => {
34
33
  if (!p.value)
35
34
  return;
36
35
  const t = d.value;
@@ -41,6 +40,6 @@ function N(s) {
41
40
  };
42
41
  }
43
42
  export {
44
- N as useDpiEditMode
43
+ w as useDpiEditMode
45
44
  };
46
45
  //# sourceMappingURL=useDpiEditMode.mjs.map
@@ -1 +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, toValue } 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 editQuery = computed(() => {\n return toValue(dpiContext)?.edit?.enabled ?? route.query.edit === 'true';\n });\n\n const editIdQuery = computed(() => {\n return toValue(dpiContext)?.edit?.id ?? route.query.id;\n });\n\n const editFromDraft = computed(() => {\n return toValue(dpiContext)?.edit?.fromDraft ?? route.query.fromDraft ?? store.getters[\"auth/getIsDraft\"];\n });\n\n // For legacy purposes, set editmode to false if editQuery is false\n if (!!editQuery.value) {\n localStorage.setItem('dpi_editmode', 'false');\n store.dispatch(\"auth/setIsEditMode\", false);\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 const endpoint = isDraft\n ? `${env.api.hubUrl}drafts/datasets/${editIdQuery.value}.nt?catalogue=${route.query.catalog}`\n : route.params.property === \"catalogues\"\n ? `${env.api.hubUrl}catalogues/${route.query.catalog}.nt`\n : `${env.api.hubUrl}datasets/${editIdQuery.value}.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 const inEditModeAndRptAvailable = computed(() => !!editIdQuery.value && !!requestParams.value.token)\n watchOnce(inEditModeAndRptAvailable, () => {\n if (!inEditModeAndRptAvailable.value) return;\n const isDraft = editFromDraft.value;\n store.dispatch(\"auth/setIsEditMode\", true);\n store.dispatch(\"auth/setIsDraft\", isDraft);\n execute();\n }, { immediate: true });\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","editQuery","computed","_b","_a","toValue","editIdQuery","editFromDraft","requestParams","isDraft","token","property","id","execute","isLoading","error","useAsyncState","inEditModeAndRptAvailable","watchOnce"],"mappings":";;;;;;AAgBO,SAASA,EAAeC,GAA0C;AACvE,QAAMC,IAAQC,KACRC,IAAQC,KACRC,IAAMC,KAENC,IAAYC,EAAS,MAAM;;AAC/B,aAAOC,KAAAC,IAAAC,EAAQX,CAAU,MAAlB,gBAAAU,EAAqB,SAArB,gBAAAD,EAA2B,YAAWR,EAAM,MAAM,SAAS;AAAA,EAAA,CACnE,GAEKW,IAAcJ,EAAS,MAAM;;AACjC,aAAOC,KAAAC,IAAAC,EAAQX,CAAU,MAAlB,gBAAAU,EAAqB,SAArB,gBAAAD,EAA2B,OAAMR,EAAM,MAAM;AAAA,EAAA,CACrD,GAEKY,IAAgBL,EAAS,MAAM;;AAC5B,aAAAC,KAAAC,IAAAC,EAAQX,CAAU,MAAlB,gBAAAU,EAAqB,SAArB,gBAAAD,EAA2B,cAAaR,EAAM,MAAM,aAAaE,EAAM,QAAQ,iBAAiB;AAAA,EAAA,CACxG;AAGG,EAAEI,EAAU,UACD,aAAA,QAA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-provider-interface/composables/useDpiEditMode.ts"],"sourcesContent":["import { useRoute } from \"vue-router\";\nimport { type DpiContext } from \"./useDpiContext\";\nimport { computed, MaybeRefOrGetter, toValue, watch } 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 editQuery = computed(() => {\n return toValue(dpiContext)?.edit?.enabled ?? route.query.edit === 'true';\n });\n\n const editIdQuery = computed(() => {\n return toValue(dpiContext)?.edit?.id ?? route.query.id;\n });\n\n const editFromDraft = computed(() => {\n return toValue(dpiContext)?.edit?.fromDraft ?? route.query.fromDraft ?? store.getters[\"auth/getIsDraft\"];\n });\n\n // For legacy purposes, set editmode to false if editQuery is false\n if (!!editQuery.value) {\n localStorage.setItem('dpi_editmode', 'false');\n store.dispatch(\"auth/setIsEditMode\", false);\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 const endpoint = isDraft\n ? `${env.api.hubUrl}drafts/datasets/${editIdQuery.value}.nt?catalogue=${route.query.catalog}`\n : route.params.property === \"catalogues\"\n ? `${env.api.hubUrl}catalogues/${route.query.catalog}.nt`\n : `${env.api.hubUrl}datasets/${editIdQuery.value}.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 const inEditModeAndRptAvailable = computed(() => !!editIdQuery.value && !!requestParams.value.token)\n watch(inEditModeAndRptAvailable, () => {\n if (!inEditModeAndRptAvailable.value) return;\n const isDraft = editFromDraft.value;\n store.dispatch(\"auth/setIsEditMode\", true);\n store.dispatch(\"auth/setIsDraft\", isDraft);\n execute();\n }, { immediate: true });\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","editQuery","computed","_b","_a","toValue","editIdQuery","editFromDraft","requestParams","isDraft","token","property","id","execute","isLoading","error","useAsyncState","inEditModeAndRptAvailable","watch"],"mappings":";;;;;AAgBO,SAASA,EAAeC,GAA0C;AACvE,QAAMC,IAAQC,KACRC,IAAQC,KACRC,IAAMC,KAENC,IAAYC,EAAS,MAAM;;AAC/B,aAAOC,KAAAC,IAAAC,EAAQX,CAAU,MAAlB,gBAAAU,EAAqB,SAArB,gBAAAD,EAA2B,YAAWR,EAAM,MAAM,SAAS;AAAA,EAAA,CACnE,GAEKW,IAAcJ,EAAS,MAAM;;AACjC,aAAOC,KAAAC,IAAAC,EAAQX,CAAU,MAAlB,gBAAAU,EAAqB,SAArB,gBAAAD,EAA2B,OAAMR,EAAM,MAAM;AAAA,EAAA,CACrD,GAEKY,IAAgBL,EAAS,MAAM;;AAC5B,aAAAC,KAAAC,IAAAC,EAAQX,CAAU,MAAlB,gBAAAU,EAAqB,SAArB,gBAAAD,EAA2B,cAAaR,EAAM,MAAM,aAAaE,EAAM,QAAQ,iBAAiB;AAAA,EAAA,CACxG;AAGG,EAAEI,EAAU,UACD,aAAA,QAAQ,gBAAgB,OAAO,GACtCJ,EAAA,SAAS,sBAAsB,EAAK;AAGtC,QAAAW,IAAgBN,EAAS,MAAM;;AACnC,UAAMO,IAAUF,EAAc,OACxBG,KAAQN,IAAAP,EAAM,QAAQ,kBAAkB,MAAhC,gBAAAO,EAAmC,UAC3CO,IAAWhB,EAAM,OAAO,UACxBiB,IAAKjB,EAAM,OAAO;AAOxB,WAAO,EAAE,UALQc,IACb,GAAGV,EAAI,IAAI,MAAM,mBAAmBO,EAAY,KAAK,iBAAiBX,EAAM,MAAM,OAAO,KACzFA,EAAM,OAAO,aAAa,eAC1B,GAAGI,EAAI,IAAI,MAAM,cAAcJ,EAAM,MAAM,OAAO,QAClD,GAAGI,EAAI,IAAI,MAAM,YAAYO,EAAY,KAAK,4BAC/B,OAAAI,GAAO,UAAAC,GAAU,IAAAC,EAAG;AAAA,EAAA,CACxC,GAEK,EAAE,SAAAC,GAAS,WAAAC,GAAW,OAAAC,EAAU,IAAAC;AAAA,IACpC,YACS,MAAMnB,EAAM;AAAA,MACjB;AAAA,MACA,EAAE,GAAGW,EAAc,MAAM;AAAA,IAAA;AAAA,IAG7B;AAAA,IACA;AAAA,MACE,WAAW;AAAA,IACb;AAAA,EAAA,GAGIS,IAA4Bf,EAAS,MAAM,CAAC,CAACI,EAAY,SAAS,CAAC,CAACE,EAAc,MAAM,KAAK;AACnG,SAAAU,EAAMD,GAA2B,MAAM;AACrC,QAAI,CAACA,EAA0B;AAAO;AACtC,UAAMR,IAAUF,EAAc;AACxB,IAAAV,EAAA,SAAS,sBAAsB,EAAI,GACnCA,EAAA,SAAS,mBAAmBY,CAAO,GACjCI;EAAA,GACP,EAAE,WAAW,GAAA,CAAM,GAQf;AAAA,IACL,SALcX,EAAS,MAChB,CAAC,CAACL,EAAM,QAAQ,+BAA+B,KAAK,CAACiB,EAAU,KACvE;AAAA,IAIC,OAAAC;AAAA,EAAA;AAEJ;"}
@@ -0,0 +1,13 @@
1
+ import { MaybeRefOrGetter } from 'vue';
2
+
3
+ export declare function useFormSchema(): {
4
+ createSchema: ({ property, page }: {
5
+ property: string;
6
+ page: string;
7
+ }) => void;
8
+ translateSchema: ({ property, page }: {
9
+ property: string;
10
+ page: string;
11
+ }) => void;
12
+ getSchema: (property: MaybeRefOrGetter<string>) => import('vue').ComputedRef<{} | undefined>;
13
+ };
@@ -0,0 +1,59 @@
1
+ import { computed as h, ref as v, toValue as C } from "vue";
2
+ import { useDpiContext as g } from "./useDpiContext.mjs";
3
+ import { useI18n as p } from "vue-i18n";
4
+ import b from "../utils/translation-helper.mjs";
5
+ import { createSharedComposable as x } from "../../external/@vueuse/shared/index";
6
+ const D = x(() => {
7
+ const i = v({
8
+ schema: {
9
+ datasets: {},
10
+ distributions: {},
11
+ catalogues: {}
12
+ },
13
+ usersCatalogs: {}
14
+ });
15
+ return { state: i, getSchema: (a) => h(() => {
16
+ const u = C(a);
17
+ if (a === "catalogues" || a === "datasets" || a === "distributions")
18
+ return i.value.schema[u];
19
+ }) };
20
+ });
21
+ function y() {
22
+ const i = g();
23
+ p({ useScope: "global" });
24
+ const { state: n, getSchema: a } = D(), u = h(() => i.value.specification);
25
+ function f({ property: t, page: e }) {
26
+ var c, s;
27
+ const o = (c = u.value.pageConent) == null ? void 0 : c[t][e], m = (s = u.value.inputDefinition) == null ? void 0 : s[t], r = JSON.parse(JSON.stringify(n.value));
28
+ d({ state: r, pageProperties: o, propertyDefinitions: m, property: t, page: e }), n.value = r;
29
+ }
30
+ function d({
31
+ state: t,
32
+ pageProperties: e,
33
+ propertyDefinitions: o,
34
+ property: m,
35
+ page: r
36
+ }) {
37
+ const c = [];
38
+ for (let s = 0; s < e.length; s += 1) {
39
+ const l = e[s];
40
+ try {
41
+ c.push(o[l]);
42
+ } catch {
43
+ console.warn(
44
+ `DCATAP doens't include a property called: ${l}`
45
+ );
46
+ }
47
+ }
48
+ t.schema[m][r] = c;
49
+ }
50
+ function S({ property: t, page: e }) {
51
+ const o = { ...n.value.schema };
52
+ b(o[t][e], t), n.value.schema[t][e] = o[t][e];
53
+ }
54
+ return { createSchema: f, translateSchema: S, getSchema: a };
55
+ }
56
+ export {
57
+ y as useFormSchema
58
+ };
59
+ //# sourceMappingURL=useFormSchema.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFormSchema.mjs","sources":["../../../lib/data-provider-interface/composables/useFormSchema.ts"],"sourcesContent":["import { createSharedComposable } from '@vueuse/core'\nimport { computed, MaybeRefOrGetter, ref, toValue, watch } from 'vue'\nimport { useDpiContext } from './useDpiContext'\nimport { useI18n } from 'vue-i18n'\nimport translate from '../utils/translation-helper'\n\nconst useFormSchemaGlobal = createSharedComposable(() => {\n const state = ref({\n schema: {\n datasets: {},\n distributions: {},\n catalogues: {}\n },\n usersCatalogs: {}\n })\n\n /**\n * Retrieves the schema for a given property.\n *\n * @param property - The property whose schema should be retrieved.\n * Can be a string or a ref to a string.\n * @returns A computed ref to the schema of the given property.\n */\n const getSchema = (property: MaybeRefOrGetter<string>) => computed(() => {\n const _property = toValue(property)\n\n if (property === 'catalogues' || property === 'datasets' || property === 'distributions') {\n return state.value.schema[_property as keyof typeof state.value.schema]\n }\n\n return undefined\n })\n\n return { state, getSchema }\n})\n\nexport function useFormSchema() {\n const dpiContext = useDpiContext()\n const { t } = useI18n({ useScope: 'global' })\n const { state, getSchema } = useFormSchemaGlobal()\n\n const dpiConfig = computed(() => dpiContext.value.specification)\n\n function createSchema({ property, page }: { property: string, page: string }) {\n const pageProperties = dpiConfig.value.pageConent?.[property as keyof typeof dpiConfig.value.pageConent][page] as unknown as string[]\n const propertyDefinitions = dpiConfig.value.inputDefinition?.[property as keyof typeof dpiConfig.value.inputDefinition]\n\n // Create copy of state because extractSchema does in-place modifications.\n // Just to be safe.\n const stateCopy = JSON.parse(JSON.stringify(state.value))\n extractSchema({ state: stateCopy, pageProperties, propertyDefinitions, property, page })\n\n state.value = stateCopy\n }\n\n function extractSchema({\n state,\n pageProperties,\n propertyDefinitions,\n property,\n page,\n }: {\n state: any\n pageProperties: string[]\n propertyDefinitions: any\n property: string\n page: string\n }) {\n // important: create new empty schema each time so already existing schema will be overwritten on route/view-change\n const newSchema = [];\n\n for (let index = 0; index < pageProperties.length; index += 1) {\n const propertyKey = pageProperties[index];\n try {\n newSchema.push(propertyDefinitions[propertyKey]);\n } catch (err) {\n console.warn(\n `DCATAP doens't include a property called: ${propertyKey}`\n );\n }\n }\n\n state.schema[property][page] = newSchema;\n }\n\n function translateSchema({ property, page }: { property: string, page: string }) {\n const schemaCopy = { ...state.value.schema }\n // @ts-ignore\n translate(schemaCopy[property][page], property);\n\n // Update the global state with the new schema\n // @ts-ignore\n state.value.schema[property][page] = schemaCopy[property][page]\n }\n\n return { createSchema, translateSchema, getSchema }\n\n}"],"names":["useFormSchemaGlobal","createSharedComposable","state","ref","property","computed","_property","toValue","useFormSchema","dpiContext","useDpiContext","useI18n","getSchema","dpiConfig","createSchema","page","pageProperties","_a","propertyDefinitions","_b","stateCopy","extractSchema","newSchema","index","propertyKey","translateSchema","schemaCopy","translate"],"mappings":";;;;;AAMA,MAAMA,IAAsBC,EAAuB,MAAM;AACvD,QAAMC,IAAQC,EAAI;AAAA,IAChB,QAAQ;AAAA,MACN,UAAU,CAAC;AAAA,MACX,eAAe,CAAC;AAAA,MAChB,YAAY,CAAC;AAAA,IACf;AAAA,IACA,eAAe,CAAC;AAAA,EAAA,CACjB;AAmBM,SAAA,EAAE,OAAAD,GAAO,WAVE,CAACE,MAAuCC,EAAS,MAAM;AACjE,UAAAC,IAAYC,EAAQH,CAAQ;AAElC,QAAIA,MAAa,gBAAgBA,MAAa,cAAcA,MAAa;AAChE,aAAAF,EAAM,MAAM,OAAOI,CAA4C;AAAA,EAGjE,CACR;AAGH,CAAC;AAEM,SAASE,IAAgB;AAC9B,QAAMC,IAAaC;AACL,EAAAC,EAAQ,EAAE,UAAU,UAAU;AAC5C,QAAM,EAAE,OAAAT,GAAO,WAAAU,EAAU,IAAIZ,EAAoB,GAE3Ca,IAAYR,EAAS,MAAMI,EAAW,MAAM,aAAa;AAE/D,WAASK,EAAa,EAAE,UAAAV,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+ import { default as ConditionalInput } from './components/ConditionalInput.vue';
4
+ import { default as DataFetchingComponent } from './components/DataFetchingComponent.vue';
5
+ import { default as Dropup } from './components/Dropup.vue';
6
+ import { default as FileUpload } from './components/FileUpload.vue';
7
+ import { default as InfoSlot } from './components/InfoSlot.vue';
8
+ import { default as LanguageSelector } from './components/LanguageSelector.vue';
9
+ import { default as Navigation } from './components/Navigation.vue';
10
+ import { default as UniqueIdentifierInput } from './components/UniqueIdentifierInput.vue';
11
+ import { default as inputDefinitions } from '../form/inputDefinitions';
12
+ import { default as CatalogueOverview } from './views/OverviewPage/CatalogueOverview.vue';
13
+ import { default as DatasetOverview } from './views/OverviewPage/DatasetOverview.vue';
14
+ import { default as DistributionOverview } from './views/OverviewPage/DistributionOverview.vue';
15
+ import { default as PropertyEntry } from './views/OverviewPage/PropertyEntry.vue';
16
+ import { default as DistOverview } from './views/DistributionOverview.vue';
17
+ import { default as DraftsPage } from './views/DraftsPage.vue';
18
+ import { default as InputPage } from './views/InputPage.vue';
19
+ import { default as LinkedDataViewer } from './views/LinkedDataViewer.vue';
20
+ import { default as OverviewPage } from './views/OverviewPage.vue';
21
+ import { default as UserCataloguesPage } from './views/UserCataloguesPage.vue';
22
+ import { default as UserProfilePage } from './views/UserProfilePage.vue';
23
+ import { default as DataProviderInterface } from './DataProviderInterface.vue';
24
+ import { default as DpiMenu } from './DPIMenu.vue';
25
+ import { default as store } from './store/dpiStore';
26
+
1
27
  export * from './composables/index';
2
28
  export { config as dpiSpecConfig } from './config/dpi-spec-config';
29
+ export declare function registerComponents(app: App): void;
30
+ export { AutocompleteInput, ConditionalInput, DataFetchingComponent, Dropup, FileUpload, InfoSlot, LanguageSelector, Navigation, UniqueIdentifierInput };
31
+ export { CatalogueOverview, DatasetOverview, DistributionOverview, PropertyEntry };
32
+ export { DistOverview, DraftsPage, InputPage, LinkedDataViewer, OverviewPage, UserCataloguesPage, UserProfilePage };
33
+ export { DataProviderInterface, DpiMenu };
34
+ export { inputDefinitions, store };
35
+ export { injectionKey as injectionKeyRuntimeConfig } from '../services/runtimeConfigurationService';
@@ -1,33 +1,33 @@
1
- import { has as c, isObject as i } from "lodash-es";
2
- import r from "../../store/index.mjs";
3
- function m(a, s) {
4
- const l = r.$app.config.globalProperties.i18n.global;
5
- if (c(a, "identifier")) {
6
- const e = ["label", "info", "help", "placeholder", "add-label"], o = a.identifier;
7
- for (let d = 0; d < e.length; d += 1) {
8
- let n = o;
9
- const t = e[d], $ = l.te(`message.dataupload.${s}.${o}.${t}`), f = l.te(`message.dataupload.${s}.${o}.${t}`, "en");
10
- c(s, t) || ($ ? n = l.t(`message.dataupload.${s}.${o}.${t}`) : f ? n = l.t(`message.dataupload.${s}.${o}.${t}`, "en") : n = t, !!a.$cmp && !a.$formkit && i(a.props) && a.$cmp === "SelectControlledGroup" ? a.props[t] = n : a[t] = n), a.mandatory && t === "label" && (a[t] = `${n}*`);
1
+ import { has as m, isObject as h } from "lodash-es";
2
+ import { useI18n as r } from "vue-i18n";
3
+ function u(s, a) {
4
+ const { t: o, te: e } = r({ useScope: "global" });
5
+ if (m(s, "identifier")) {
6
+ const d = ["label", "info", "help", "placeholder", "add-label"], l = s.identifier;
7
+ for (let c = 0; c < d.length; c += 1) {
8
+ let n = l;
9
+ const t = d[c], f = e(`message.dataupload.${a}.${l}.${t}`), C = e(`message.dataupload.${a}.${l}.${t}`, "en");
10
+ m(a, t) || (f ? n = o(`message.dataupload.${a}.${l}.${t}`) : C ? n = o(`message.dataupload.${a}.${l}.${t}`, "en") : n = t, !!s.$cmp && !s.$formkit && h(s.props) && s.$cmp === "SelectControlledGroup" ? s.props[t] = n : s[t] = n), s.mandatory && t === "label" && (s[t] = `${n}*`);
11
11
  }
12
12
  }
13
13
  }
14
- function u(a, s) {
15
- for (let l = 0; l < a.length; l += 1) {
16
- const e = a[l];
17
- if (c(e, "children"))
18
- m(e, s), u(e.children, s);
19
- else if (c(e, "data")) {
20
- m(e, s);
21
- const o = Object.keys(e.data);
22
- for (let d = 0; d < o.length; d += 1) {
23
- const n = o[d];
24
- u(e.data[n], s);
14
+ function $(s, a) {
15
+ for (let o = 0; o < s.length; o += 1) {
16
+ const e = s[o];
17
+ if (m(e, "children"))
18
+ u(e, a), $(e.children, a);
19
+ else if (m(e, "data")) {
20
+ u(e, a);
21
+ const d = Object.keys(e.data);
22
+ for (let l = 0; l < d.length; l += 1) {
23
+ const c = d[l];
24
+ $(e.data[c], a);
25
25
  }
26
26
  } else
27
- m(e, s);
27
+ u(e, a);
28
28
  }
29
29
  }
30
30
  export {
31
- u as default
31
+ $ as default
32
32
  };
33
33
  //# sourceMappingURL=translation-helper.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"translation-helper.mjs","sources":["../../../lib/data-provider-interface/utils/translation-helper.js"],"sourcesContent":["import { has, isObject } from 'lodash-es';\nimport store from '../../store';\n\n/**\n * Translation of each translatable parameter within the given structure if a translation is available\n * @param {*} propertyDefinition Object containing parameters defining the form and their content\n * @param {String} property String defining which property translation should be used\n */\n\nfunction translateProperty(propertyDefinition, property) {\n\n const i18n = store.$app.config.globalProperties.i18n.global;\n if (has(propertyDefinition, 'identifier')) { // hidden fields don't need a label and have no identifier\n const translatableParameters = ['label', 'info', 'help', 'placeholder', 'add-label'];\n const propertyName = propertyDefinition.identifier;\n\n for (let valueIndex = 0; valueIndex < translatableParameters.length; valueIndex += 1) {\n let translation = propertyName;\n const parameter = translatableParameters[valueIndex];\n\n const translationExsists = i18n.te(`message.dataupload.${property}.${propertyName}.${parameter}`);\n const translationExsistsEN = i18n.te(`message.dataupload.${property}.${propertyName}.${parameter}`, 'en');\n\n // Check if translation exists\n if (!has(property, parameter)) {\n if (translationExsists) {\n translation = i18n.t(`message.dataupload.${property}.${propertyName}.${parameter}`);\n } else if (translationExsistsEN) {\n translation = i18n.t(`message.dataupload.${property}.${propertyName}.${parameter}`, 'en');\n } else {\n translation = parameter;\n }\n\n const isCustomComponentWithProps = !!propertyDefinition.$cmp\n && !propertyDefinition.$formkit\n && isObject(propertyDefinition.props);\n\n const isSelectControlledGroupCustomComponent = isCustomComponentWithProps\n && propertyDefinition.$cmp === 'SelectControlledGroup';\n\n if (isSelectControlledGroupCustomComponent) {\n propertyDefinition.props[parameter] = translation;\n } else {\n propertyDefinition[parameter] = translation;\n }\n\n // if (parameter === \"info\") {\n\n // propertyDefinition['sections-schema'] = { prefix: { $el: 'div', attrs: { class: 'infoI', }, children: [{ $el: 'div', children: translation, attrs: { class: 'tooltipFormkit' } }] } }\n // }\n }\n\n // Highlight mandatory fields\n if (propertyDefinition.mandatory && parameter === \"label\") propertyDefinition[parameter] = `${translation}*`\n }\n }\n}\n\n/**\n * Recursive translation of propertie parameters including recursive translation of nested properties\n * @param {Object} schema Object containing the forms schema\n * @param {String} property String defining which property translation should be used (datasets/ distribution/ catalogues)\n */\nfunction translate(schema, property) {\n for (let index = 0; index < schema.length; index += 1) {\n const schemaPropertyValues = schema[index];\n\n // translation of group forms and their nested properties\n if (has(schemaPropertyValues, 'children')) {\n // group attributes should be translated too\n translateProperty(schemaPropertyValues, property);\n // translated nested properties\n translate(schemaPropertyValues.children, property);\n // translation of conditional forms and their nested properties\n } else if (has(schemaPropertyValues, 'data')) {\n // group attributes should be translated too\n translateProperty(schemaPropertyValues, property);\n // translate nested data\n const dataKeys = Object.keys(schemaPropertyValues.data);\n for (let keyIndex = 0; keyIndex < dataKeys.length; keyIndex += 1) {\n const currentKey = dataKeys[keyIndex];\n translate(schemaPropertyValues.data[currentKey], property);\n }\n // translation of 'normal' singular form properties\n } else {\n translateProperty(schemaPropertyValues, property);\n }\n }\n}\n\nexport default translate;\n"],"names":["translateProperty","propertyDefinition","property","i18n","store","has","translatableParameters","propertyName","valueIndex","translation","parameter","translationExsists","translationExsistsEN","isObject","translate","schema","index","schemaPropertyValues","dataKeys","keyIndex","currentKey"],"mappings":";;AASA,SAASA,EAAkBC,GAAoBC,GAAU;AAErD,QAAMC,IAAOC,EAAM,KAAK,OAAO,iBAAiB,KAAK;AACrD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EAAqB,IAAI;AACtD,eAASE,IAAW,GAAGA,IAAWD,EAAS,QAAQC,KAAY,GAAG;AAC9D,cAAMC,IAAaF,EAASC,CAAQ;AACpC,QAAAL,EAAUG,EAAqB,KAAKG,CAAU,GAAGlB,CAAQ;AAAA,MAC5D;AAAA,IAEb;AACY,MAAAF,EAAkBiB,GAAsBf,CAAQ;AAAA,EAEvD;AACL;"}
1
+ {"version":3,"file":"translation-helper.mjs","sources":["../../../lib/data-provider-interface/utils/translation-helper.js"],"sourcesContent":["import { has, isObject } from 'lodash-es';\nimport { useI18n } from 'vue-i18n';\n\n/**\n * Translation of each translatable parameter within the given structure if a translation is available\n * @param {*} propertyDefinition Object containing parameters defining the form and their content\n * @param {String} property String defining which property translation should be used\n */\n\nfunction translateProperty(propertyDefinition, property) {\n const { t, te } = useI18n({ useScope: 'global' });\n\n if (has(propertyDefinition, 'identifier')) { // hidden fields don't need a label and have no identifier\n const translatableParameters = ['label', 'info', 'help', 'placeholder', 'add-label'];\n const propertyName = propertyDefinition.identifier;\n\n for (let valueIndex = 0; valueIndex < translatableParameters.length; valueIndex += 1) {\n let translation = propertyName;\n const parameter = translatableParameters[valueIndex];\n\n const translationExsists = te(`message.dataupload.${property}.${propertyName}.${parameter}`);\n const translationExsistsEN = te(`message.dataupload.${property}.${propertyName}.${parameter}`, 'en');\n\n // Check if translation exists\n if (!has(property, parameter)) {\n if (translationExsists) {\n translation = t(`message.dataupload.${property}.${propertyName}.${parameter}`);\n } else if (translationExsistsEN) {\n translation = t(`message.dataupload.${property}.${propertyName}.${parameter}`, 'en');\n } else {\n translation = parameter;\n }\n\n const isCustomComponentWithProps = !!propertyDefinition.$cmp\n && !propertyDefinition.$formkit\n && isObject(propertyDefinition.props);\n\n const isSelectControlledGroupCustomComponent = isCustomComponentWithProps\n && propertyDefinition.$cmp === 'SelectControlledGroup';\n\n if (isSelectControlledGroupCustomComponent) {\n propertyDefinition.props[parameter] = translation;\n } else {\n propertyDefinition[parameter] = translation;\n }\n\n // if (parameter === \"info\") {\n\n // propertyDefinition['sections-schema'] = { prefix: { $el: 'div', attrs: { class: 'infoI', }, children: [{ $el: 'div', children: translation, attrs: { class: 'tooltipFormkit' } }] } }\n // }\n }\n\n // Highlight mandatory fields\n if (propertyDefinition.mandatory && parameter === \"label\") propertyDefinition[parameter] = `${translation}*`\n }\n }\n}\n\n/**\n * Recursive translation of propertie parameters including recursive translation of nested properties\n * @param {Object} schema Object containing the forms schema\n * @param {String} property String defining which property translation should be used (datasets/ distribution/ catalogues)\n */\nfunction translate(schema, property) {\n for (let index = 0; index < schema.length; index += 1) {\n const schemaPropertyValues = schema[index];\n\n // translation of group forms and their nested properties\n if (has(schemaPropertyValues, 'children')) {\n // group attributes should be translated too\n translateProperty(schemaPropertyValues, property);\n // translated nested properties\n translate(schemaPropertyValues.children, property);\n // translation of conditional forms and their nested properties\n } else if (has(schemaPropertyValues, 'data')) {\n // group attributes should be translated too\n translateProperty(schemaPropertyValues, property);\n // translate nested data\n const dataKeys = Object.keys(schemaPropertyValues.data);\n for (let keyIndex = 0; keyIndex < dataKeys.length; keyIndex += 1) {\n const currentKey = dataKeys[keyIndex];\n translate(schemaPropertyValues.data[currentKey], property);\n }\n // translation of 'normal' singular form properties\n } else {\n translateProperty(schemaPropertyValues, property);\n }\n }\n}\n\nexport default translate;\n"],"names":["translateProperty","propertyDefinition","property","t","te","useI18n","has","translatableParameters","propertyName","valueIndex","translation","parameter","translationExsists","translationExsistsEN","isObject","translate","schema","index","schemaPropertyValues","dataKeys","keyIndex","currentKey"],"mappings":";;AASA,SAASA,EAAkBC,GAAoBC,GAAU;AACrD,QAAM,EAAE,GAAAC,GAAG,IAAAC,EAAI,IAAGC,EAAQ,EAAE,UAAU,SAAQ,CAAE;AAEhD,MAAIC,EAAIL,GAAoB,YAAY,GAAG;AACvC,UAAMM,IAAyB,CAAC,SAAS,QAAQ,QAAQ,eAAe,WAAW,GAC7EC,IAAeP,EAAmB;AAExC,aAASQ,IAAa,GAAGA,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A,MAC5D;AAAA,IAEb;AACY,MAAAF,EAAkBkB,GAAsBhB,CAAQ;AAAA,EAEvD;AACL;"}
@@ -19,8 +19,8 @@ declare const _default: import('vue').DefineComponent<{
19
19
  descriptionExists(data: any): boolean;
20
20
  accessExists(data: any): boolean;
21
21
  saveLocalstorageValues: import('vuex').ActionMethod;
22
- deleteDistribution: import('vuex').ActionMethod;
23
22
  addDistribution: import('vuex').ActionMethod;
23
+ deleteDistribution: import('vuex').ActionMethod;
24
24
  setDeleteDistributionInline: import('vuex').ActionMethod;
25
25
  }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
26
26
  distributionOverviewPage?: any;
@@ -1207,6 +1207,15 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
1207
1207
  }, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
1208
1208
  }>;
1209
1209
  isEditMode: import('vue').ComputedRef<boolean>;
1210
+ translateSchema: ({ property, page }: {
1211
+ property: string;
1212
+ page: string;
1213
+ }) => void;
1214
+ createSchema: ({ property, page }: {
1215
+ property: string;
1216
+ page: string;
1217
+ }) => void;
1218
+ getSchema: (property: import('vue').MaybeRefOrGetter<string>) => import('vue').ComputedRef<{} | undefined>;
1210
1219
  }, {
1211
1220
  heightActiveSec: string;
1212
1221
  formValues: {};
@@ -1221,7 +1230,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
1221
1230
  createIDFromTitle(): any;
1222
1231
  getFirstTitleFromForm(): any;
1223
1232
  isInput(): boolean;
1224
- getSchema: import('vuex').Computed;
1225
1233
  getNavSteps: import('vuex').Computed;
1226
1234
  getDeleteDistributionInline: import('vuex').Computed;
1227
1235
  getIsEditMode: import('vuex').Computed;
@@ -1235,11 +1243,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
1235
1243
  createDatasetID(): void;
1236
1244
  generateandTranslateSchema(property: any): void;
1237
1245
  clearAll: import('vuex').ActionMethod;
1238
- createSchema: import('vuex').ActionMethod;
1239
- translateSchema: import('vuex').ActionMethod;
1240
1246
  saveFormValues: import('vuex').ActionMethod;
1241
1247
  saveLocalstorageValues: import('vuex').ActionMethod;
1242
- addCatalogOptions: import('vuex').ActionMethod;
1243
1248
  setIsEditMode: import('vuex').ActionMethod;
1244
1249
  setIsDraft: import('vuex').ActionMethod;
1245
1250
  }, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{