@piveau/piveau-hub-ui-modules 4.4.20 → 4.4.22
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/DataProviderInterface.vue.mjs.map +1 -1
- package/dist/data-provider-interface/DataProviderInterface.vue2.mjs +28 -19
- package/dist/data-provider-interface/DataProviderInterface.vue2.mjs.map +1 -1
- package/dist/data-provider-interface/components/UniqueIdentifierInput.vue.mjs +44 -38
- package/dist/data-provider-interface/components/UniqueIdentifierInput.vue.mjs.map +1 -1
- package/dist/data-provider-interface/composables/useDpiContext.d.ts +5 -0
- package/dist/data-provider-interface/composables/useDpiContext.mjs.map +1 -1
- package/dist/data-provider-interface/composables/useDpiEditMode.mjs +33 -22
- package/dist/data-provider-interface/composables/useDpiEditMode.mjs.map +1 -1
- package/dist/data-provider-interface/utils/inputConverter.mjs +65 -64
- package/dist/data-provider-interface/utils/inputConverter.mjs.map +1 -1
- package/dist/datasetDetails/distributions/Distributions.vue.d.ts +1 -0
- package/dist/datasetDetails/distributions/Distributions.vue.mjs +16 -15
- package/dist/datasetDetails/distributions/Distributions.vue.mjs.map +1 -1
- package/dist/piveau-hub-ui-modules.css +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataProviderInterface.vue.mjs","sources":["../../lib/data-provider-interface/DataProviderInterface.vue"],"sourcesContent":["<template>\n <div class=\"d-flex flex-column bg-transparent container-fluid justify-content-between dpi position-relative w-100\" :key=\"property\">\n <!-- CONTENT -->\n <router-view v-if=\"isReady\" ref=\"view\" :key=\"key\">\n </router-view>\n </div>\n</template>\n\n<script lang=\"ts\">\n/* eslint-disable no-nested-ternary, no-lonely-if, no-param-reassign */\nimport { DpiContext, setupDpiContext } from './composables/useDpiContext';\nimport { computed, defineAsyncComponent, defineComponent, PropType , ref, toRef, toRefs, watch, watchEffect} from 'vue';\nimport { mapActions, mapGetters, useStore } from 'vuex';\nimport dpiSpecs from './config/dpi-spec-config';\nimport { useRuntimeEnv } from '../composables/useRuntimeEnv';\nimport { useRoute } from 'vue-router';\nimport { useAsyncState, watchOnce } from '@vueuse/core';\nimport { useDpiEditMode } from './composables/useDpiEditMode';\n\n\n\nexport default defineComponent({\n name: 'DataProviderInterface',\n components: {\n InputPage: defineAsyncComponent(() => import('./views/InputPage.vue')),\n },\n props: {\n name: {\n type: String,\n default: '',\n },\n dpiContext: {\n type: Object as PropType<DpiContext>,\n default: () => undefined,\n }\n },\n metaInfo() {\n return {\n title: `${this.$t('message.metadata.upload')} | ${this.$t('message.header.navigation.data.datasets')}`,\n meta: [\n { name: 'description', vmid: 'description', content: `${this.$t('message.datasets.meta.description')}` },\n { name: 'keywords', vmid: 'keywords', content: `${this.$env.metadata.keywords} ${this.$t('message.datasets.meta.description')}}` },\n { name: 'robots', content: 'noindex, follow' },\n ],\n };\n },\n data() {\n return {\n property: this.$route.params.property,\n id: this.$route.params.id,\n };\n },\n computed: {\n ...mapGetters('auth', [\n 'getIsEditMode',\n ]),\n mode() {\n return this.property === 'catalogues'\n ? this.getIsEditMode\n ? this.$t('message.dataupload.menu.editCatalogue')\n : this.$t('message.dataupload.createNewCatalogue')\n : this.property === 'datasets'\n ? this.getIsEditMode\n ? this.$t('message.dataupload.menu.editDataset')\n : this.$t('message.dataupload.createNewDataset')\n : 'Edit Distribution';\n },\n },\n methods: {\n ...mapActions('dpiStore', [\n 'saveLocalstorageValues',\n ]),\n ...mapActions('auth', [\n 'populateDraftAndEdit',\n ]),\n getClearPath() {\n return `${this.$env.content.dataProviderInterface.basePath}/${this.property}?locale=${this.$i18n.locale}&clear=true`;;\n },\n handleScroll() {\n try {\n if (document.getElementById(\"stepperAnchor\")?.offsetTop || 0 >= 35) {\n document.getElementById(\"stepperAnchor\")?.classList.add(\"border-bottom-lightgray\");\n }\n else {\n document.getElementById(\"stepperAnchor\")?.classList.remove(\"border-bottom-lightgray\");\n }\n } catch (error) {\n \n }\n }\n\n },\n created() {\n window.addEventListener('scroll', this.handleScroll);\n this.populateDraftAndEdit();\n },\n mounted() {\n this.saveLocalstorageValues(this.property);\n },\n unmounted() {\n window.removeEventListener('scroll', this.handleScroll);\n },\n setup(props) {\n const route = useRoute()\n const store = useStore()\n const env = useRuntimeEnv()\n const userSpec = env.content.dataProviderInterface.specification as 'dcatap' | 'dcatapde' | 'dcatapdeODB'\n const fallbackSpec = dpiSpecs[userSpec]\n const dpiContext = toRef(props, 'dpiContext')\n\n const resolvedDpiContext = computed<DpiContext>(() => {\n return dpiContext.value || {\n specification: fallbackSpec,\n specificationName: userSpec\n }\n })\n\n setupDpiContext(resolvedDpiContext)\n\n watchEffect(() => {\n store.dispatch('dpiStore/setSpecification', resolvedDpiContext.value.specification)\n store.dispatch('dpiStore/setSpecificationname', resolvedDpiContext.value.specificationName)\n })\n\n const key = computed(() => {\n return `${route.query.key}@${resolvedDpiContext.value.specificationName}`\n })\n\n const { isReady } = useDpiEditMode(resolvedDpiContext)\n\n return {\n resolvedDpiContext,\n key,\n isReady,\n }\n\n }\n});\n</script>\n\n<style lang=\"scss\">\n.border-bottom-lightgray {\n border-bottom: 1px solid lightgray;\n}\n.stickyStepper {\n position: sticky;\n top: 0;\n background: #ffffff;\n z-index: 999;\n}\n\n.stickyStepper .SSfirstRow {\n margin: 1vh 0;\n display: flex;\n align-items: center;\n}\n\n.stickyStepper .stickyNav {\n border-left: 1px solid black;\n margin-left: 1vh;\n padding-left: 1vh;\n}\n\n#stepper {\n width: 100% !important;\n}\n\n#input {\n padding: 10px;\n}\n\n.small-headline {\n font-size: 1.5rem;\n min-width: max-content;\n}\n\n.property {\n margin: 20px;\n background-color: #ffffff;\n border: solid 0.5px rgb(225, 225, 225);\n margin-top: 30px;\n}\n\n.infoBox .material-icons {\n font-size: 20px;\n vertical-align: text-bottom;\n margin-right: 5px;\n margin-bottom: 1px;\n}\n\n.infoBox {\n width: 100%;\n height: 30%;\n background-color: #f7f7f7;\n padding: 5%;\n border-radius: 0.25rem;\n margin-top: 20px;\n\n .input_subpage_nav {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 15px;\n }\n}\n\n.besides {\n .formkit-input-group-repeatable {\n display: flex;\n flex-direction: row;\n background-color: transparent;\n padding: 0px;\n }\n}\n\n.main {\n width: 75%;\n margin: 0 5px 0 5px;\n}\n\n.sub {\n width: 20%;\n margin: 0 5px 0 5px;\n}\n\n#subStepperBox {\n position: sticky;\n top: 154px;\n z-index: 10;\n width: 100%;\n padding: 0 10%;\n\n .step-progress__bar {\n border-top: none !important;\n }\n\n .step-progress__step--active {\n .step-progress__step-label {\n background-color: lightsteelblue !important;\n }\n\n }\n}\n\n.step-progress__step span{\n \n color:white !important;\n \n}\n// Stepper Customizing -------------\n\n// #stepper,\n// #subStepper {\n// .step-progress__step {\n// display: flex;\n// align-items: center;\n// justify-content: center;\n// height: 70%;\n// width: 20%;\n// display: flex;\n// align-items: center;\n// z-index: 1;\n\n\n// span {\n// color: grey;\n// font-size: 18px;\n// display: none;\n// }\n\n// div {\n// padding: 1rem;\n// height: 100%;\n// display: flex;\n// align-items: center;\n// color: white;\n// font-weight: 300;\n\n// }\n\n// .step-progress__step-label {\n\n// background: lightgrey;\n// background-size: 400% 400%;\n// background-position: 100% 0%;\n// transition: all 300ms ease-in-out;\n// border-right: 1px white solid;\n// font-size: 14px;\n// display: flex;\n// align-items: center;\n// justify-content: center;\n\n\n// }\n\n\n// .step-progress__step-label:hover {\n// background-position: 65% 0%;\n// color: black;\n\n// }\n\n// }\n\n// .step-progress__step--active {\n\n// z-index: 7 !important;\n\n\n// span {\n// color: black;\n// }\n\n// div {\n// background: white;\n// }\n\n// .step-progress__step-label {\n// background: rgb(236, 236, 236);\n// background-position: 50% 0%;\n// box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12) !important;\n// transform: scale(1.1);\n// z-index: 8;\n// font-size: 16px;\n// }\n\n// }\n\n// .step-progress__step--valid {\n// div {\n// color: white;\n\n// }\n\n// .step-progress__step-label {\n// background: rgba(0, 235, 0, 0.2);\n// color: lightslategrey;\n\n\n// }\n\n// .step-progress__step-label:hover {\n// color: black;\n// }\n// }\n\n// .step-progress__step--active .step-progress__step-label {\n// color: rgb(31, 31, 31);\n// }\n\n// .step-progress__wrapper-after {\n// display: none;\n// }\n\n// .step-progress__step-icon {\n// display: none !important;\n// }\n\n// .step-progress__bar {\n// margin: 0;\n// height: 5rem;\n// border-top: 1px solid lightslategray;\n\n// }\n\n// .step-progress__step-label {\n// position: unset;\n// transform: unset;\n// flex-grow: 1;\n// }\n\n// .step-progress__step {}\n\n// .step-progress__wrapper-before {\n// display: none !important;\n// }\n\n// #stepper .step-progress__step::after {\n// display: none !important;\n// }\n// }\n#stepper .step-progress__step{\n border: solid white 20px;\n}\n#stepper .step-progress__step-icon, #subStepper .step-progress__step-icon {\n font-size: 25px;\n}\n.step-progress__step-label{\n cursor: pointer;\n}\n// Input Form Margins & Borders ----\n\n.formkit-input[data-classification=group] [data-is-repeatable] {\n border: none;\n padding: 1em 1em 1em 0em;\n}\n\n.formkit-input[data-classification=group] [data-is-repeatable] .formkit-input-group-repeatable {\n border-bottom: none;\n}\n\n.formkit-input-element--checkbox {\n margin-right: 5px;\n}\n\n.formkit-input-wrapper {\n font-family: \"Ubuntu\";\n}\n\n.formkit-input[data-classification=button] button[data-ghost] {\n font-weight: 400;\n}\n\n.formkit-input-error {\n color: #e13737 !important;\n font-weight: 400 !important;\n}\n\n// General Formkit Styling ----\n\n.formkit {\n &-input {\n .formkit {\n &-input {\n &-element {\n max-width: 100%;\n }\n\n &-error {\n font-weight: bold;\n }\n }\n }\n }\n\n .formkit-input-group-add-more {\n display: flex;\n justify-content: flex-end;\n\n button {\n border: black;\n }\n }\n\n .formkit-input {\n &[data-classification=\"text\"] .formkit-input-wrapper {\n display: flex;\n flex-direction: column;\n }\n\n &[data-classification=\"select\"] .formkit-input-wrapper {\n display: flex;\n flex-direction: column;\n }\n }\n\n .formkit-input[data-classification=\"button\"] {\n button {\n &[data-ghost] {\n color: white;\n background-color: #001d85;\n border-color: #001d85;\n border-radius: 1.875rem;\n\n &:hover {\n background-color: #196fd2;\n border-color: #196fd2;\n }\n }\n }\n }\n}\n\n.formkit-input.besides {\n border-bottom: 1px solid lightgrey !important;\n}\n\n.formkit-input-label {\n font-weight: 500 !important;\n}\n\n.formkit-input-element {\n\n &--textarea {\n width: 100%;\n }\n}\n\n.formkit-input-element--group {\n display: block !important;\n}\n\n.formkit-input.besides>.formkit-input-wrapper>.formkit-input-label {\n\n\n text-decoration: underline !important;\n}\n\n// #stepper,\n// #subStepper {\n\n\n// .step-progress__step::after {\n// display: none;\n// }\n\n// .step-progress__step-label {\n// cursor: pointer;\n// }\n// }\n</style>\n"],"names":["_resolveComponent","property","_createElementBlock","isReady","_ctx","_openBlock","_createBlock","_component_router_view","_createCommentVNode"],"mappings":";;;;;YACEA,EAIM,aAAA;SAJmHC,EAAQ,GAAAC,EAAA,OAAA;AAAA,IAAA,OAAA;AAAA,IAE5GC,KAAAA,EAAAA;AAAAA,EAAAA,GAAAA;AAAAA,IAASC,EAAA,WAAAC,KAAoBC,EAAAC,GAAA;AAAA,MAAA,KAAA;AAAA,MAHpD,KAAAH,EAAA;AAAA,IAAA,CAAA,KAAAI,EAAA,IAAA,EAAA;AAAA;;;"}
|
|
1
|
+
{"version":3,"file":"DataProviderInterface.vue.mjs","sources":["../../lib/data-provider-interface/DataProviderInterface.vue"],"sourcesContent":["<template>\n <div class=\"d-flex flex-column bg-transparent container-fluid justify-content-between dpi position-relative w-100\" :key=\"property\">\n <!-- CONTENT -->\n <router-view v-if=\"isReady\" ref=\"view\" :key=\"key\">\n </router-view>\n </div>\n</template>\n\n<script lang=\"ts\">\n/* eslint-disable no-nested-ternary, no-lonely-if, no-param-reassign */\nimport { DpiContext, setupDpiContext } from './composables/useDpiContext';\nimport { computed, defineAsyncComponent, defineComponent, PropType , ref, toRef, toRefs, toValue, watch, watchEffect} from 'vue';\nimport { mapActions, mapGetters, useStore } from 'vuex';\nimport dpiSpecs from './config/dpi-spec-config';\nimport { useRuntimeEnv } from '../composables/useRuntimeEnv';\nimport { useRoute } from 'vue-router';\nimport { useAsyncState, watchOnce } from '@vueuse/core';\nimport { useDpiEditMode } from './composables/useDpiEditMode';\n\n\n\nexport default defineComponent({\n name: 'DataProviderInterface',\n components: {\n InputPage: defineAsyncComponent(() => import('./views/InputPage.vue')),\n },\n props: {\n name: {\n type: String,\n default: '',\n },\n dpiContext: {\n type: Object as PropType<DpiContext>,\n default: () => undefined,\n }\n },\n metaInfo() {\n return {\n title: `${this.$t('message.metadata.upload')} | ${this.$t('message.header.navigation.data.datasets')}`,\n meta: [\n { name: 'description', vmid: 'description', content: `${this.$t('message.datasets.meta.description')}` },\n { name: 'keywords', vmid: 'keywords', content: `${this.$env.metadata.keywords} ${this.$t('message.datasets.meta.description')}}` },\n { name: 'robots', content: 'noindex, follow' },\n ],\n };\n },\n data() {\n return {\n property: this.$route.params.property,\n id: this.$route.params.id,\n };\n },\n computed: {\n ...mapGetters('auth', [\n 'getIsEditMode',\n ]),\n mode() {\n return this.property === 'catalogues'\n ? this.getIsEditMode\n ? this.$t('message.dataupload.menu.editCatalogue')\n : this.$t('message.dataupload.createNewCatalogue')\n : this.property === 'datasets'\n ? this.getIsEditMode\n ? this.$t('message.dataupload.menu.editDataset')\n : this.$t('message.dataupload.createNewDataset')\n : 'Edit Distribution';\n },\n },\n methods: {\n ...mapActions('dpiStore', [\n 'saveLocalstorageValues',\n ]),\n ...mapActions('auth', [\n 'populateDraftAndEdit',\n ]),\n getClearPath() {\n return `${this.$env.content.dataProviderInterface.basePath}/${this.property}?locale=${this.$i18n.locale}&clear=true`;;\n },\n handleScroll() {\n try {\n if (document.getElementById(\"stepperAnchor\")?.offsetTop || 0 >= 35) {\n document.getElementById(\"stepperAnchor\")?.classList.add(\"border-bottom-lightgray\");\n }\n else {\n document.getElementById(\"stepperAnchor\")?.classList.remove(\"border-bottom-lightgray\");\n }\n } catch (error) {\n \n }\n }\n\n },\n created() {\n window.addEventListener('scroll', this.handleScroll);\n this.populateDraftAndEdit();\n },\n mounted() {\n this.saveLocalstorageValues(this.property);\n },\n unmounted() {\n window.removeEventListener('scroll', this.handleScroll);\n },\n setup(props) {\n const route = useRoute()\n const store = useStore()\n const env = useRuntimeEnv()\n const userSpec = env.content.dataProviderInterface.specification as 'dcatap' | 'dcatapde' | 'dcatapdeODB'\n const fallbackSpec = dpiSpecs[userSpec]\n const dpiContext = toRef(props, 'dpiContext')\n\n const resolvedDpiContext = computed<DpiContext>(() => {\n const _dpiContext = toValue(dpiContext)\n\n return {\n specification: fallbackSpec,\n specificationName: userSpec,\n edit: {\n enabled: route.query.edit === 'true',\n id: route.query.id as string || undefined,\n fromDraft: route.query.fromDraft === 'true',\n },\n ..._dpiContext\n }\n })\n\n setupDpiContext(resolvedDpiContext)\n\n watchEffect(() => {\n store.dispatch('dpiStore/setSpecification', resolvedDpiContext.value.specification)\n store.dispatch('dpiStore/setSpecificationname', resolvedDpiContext.value.specificationName)\n })\n\n const key = computed(() => {\n return `${route.query.key}@${resolvedDpiContext.value.specificationName}`\n })\n\n const { isReady } = useDpiEditMode(resolvedDpiContext)\n\n return {\n resolvedDpiContext,\n key,\n isReady,\n }\n\n }\n});\n</script>\n\n<style lang=\"scss\">\n.border-bottom-lightgray {\n border-bottom: 1px solid lightgray;\n}\n.stickyStepper {\n position: sticky;\n top: 0;\n background: #ffffff;\n z-index: 999;\n}\n\n.stickyStepper .SSfirstRow {\n margin: 1vh 0;\n display: flex;\n align-items: center;\n}\n\n.stickyStepper .stickyNav {\n border-left: 1px solid black;\n margin-left: 1vh;\n padding-left: 1vh;\n}\n\n#stepper {\n width: 100% !important;\n}\n\n#input {\n padding: 10px;\n}\n\n.small-headline {\n font-size: 1.5rem;\n min-width: max-content;\n}\n\n.property {\n margin: 20px;\n background-color: #ffffff;\n border: solid 0.5px rgb(225, 225, 225);\n margin-top: 30px;\n}\n\n.infoBox .material-icons {\n font-size: 20px;\n vertical-align: text-bottom;\n margin-right: 5px;\n margin-bottom: 1px;\n}\n\n.infoBox {\n width: 100%;\n height: 30%;\n background-color: #f7f7f7;\n padding: 5%;\n border-radius: 0.25rem;\n margin-top: 20px;\n\n .input_subpage_nav {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 15px;\n }\n}\n\n.besides {\n .formkit-input-group-repeatable {\n display: flex;\n flex-direction: row;\n background-color: transparent;\n padding: 0px;\n }\n}\n\n.main {\n width: 75%;\n margin: 0 5px 0 5px;\n}\n\n.sub {\n width: 20%;\n margin: 0 5px 0 5px;\n}\n\n#subStepperBox {\n position: sticky;\n top: 154px;\n z-index: 10;\n width: 100%;\n padding: 0 10%;\n\n .step-progress__bar {\n border-top: none !important;\n }\n\n .step-progress__step--active {\n .step-progress__step-label {\n background-color: lightsteelblue !important;\n }\n\n }\n}\n\n.step-progress__step span{\n \n color:white !important;\n \n}\n// Stepper Customizing -------------\n\n// #stepper,\n// #subStepper {\n// .step-progress__step {\n// display: flex;\n// align-items: center;\n// justify-content: center;\n// height: 70%;\n// width: 20%;\n// display: flex;\n// align-items: center;\n// z-index: 1;\n\n\n// span {\n// color: grey;\n// font-size: 18px;\n// display: none;\n// }\n\n// div {\n// padding: 1rem;\n// height: 100%;\n// display: flex;\n// align-items: center;\n// color: white;\n// font-weight: 300;\n\n// }\n\n// .step-progress__step-label {\n\n// background: lightgrey;\n// background-size: 400% 400%;\n// background-position: 100% 0%;\n// transition: all 300ms ease-in-out;\n// border-right: 1px white solid;\n// font-size: 14px;\n// display: flex;\n// align-items: center;\n// justify-content: center;\n\n\n// }\n\n\n// .step-progress__step-label:hover {\n// background-position: 65% 0%;\n// color: black;\n\n// }\n\n// }\n\n// .step-progress__step--active {\n\n// z-index: 7 !important;\n\n\n// span {\n// color: black;\n// }\n\n// div {\n// background: white;\n// }\n\n// .step-progress__step-label {\n// background: rgb(236, 236, 236);\n// background-position: 50% 0%;\n// box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12) !important;\n// transform: scale(1.1);\n// z-index: 8;\n// font-size: 16px;\n// }\n\n// }\n\n// .step-progress__step--valid {\n// div {\n// color: white;\n\n// }\n\n// .step-progress__step-label {\n// background: rgba(0, 235, 0, 0.2);\n// color: lightslategrey;\n\n\n// }\n\n// .step-progress__step-label:hover {\n// color: black;\n// }\n// }\n\n// .step-progress__step--active .step-progress__step-label {\n// color: rgb(31, 31, 31);\n// }\n\n// .step-progress__wrapper-after {\n// display: none;\n// }\n\n// .step-progress__step-icon {\n// display: none !important;\n// }\n\n// .step-progress__bar {\n// margin: 0;\n// height: 5rem;\n// border-top: 1px solid lightslategray;\n\n// }\n\n// .step-progress__step-label {\n// position: unset;\n// transform: unset;\n// flex-grow: 1;\n// }\n\n// .step-progress__step {}\n\n// .step-progress__wrapper-before {\n// display: none !important;\n// }\n\n// #stepper .step-progress__step::after {\n// display: none !important;\n// }\n// }\n#stepper .step-progress__step{\n border: solid white 20px;\n}\n#stepper .step-progress__step-icon, #subStepper .step-progress__step-icon {\n font-size: 25px;\n}\n.step-progress__step-label{\n cursor: pointer;\n}\n// Input Form Margins & Borders ----\n\n.formkit-input[data-classification=group] [data-is-repeatable] {\n border: none;\n padding: 1em 1em 1em 0em;\n}\n\n.formkit-input[data-classification=group] [data-is-repeatable] .formkit-input-group-repeatable {\n border-bottom: none;\n}\n\n.formkit-input-element--checkbox {\n margin-right: 5px;\n}\n\n.formkit-input-wrapper {\n font-family: \"Ubuntu\";\n}\n\n.formkit-input[data-classification=button] button[data-ghost] {\n font-weight: 400;\n}\n\n.formkit-input-error {\n color: #e13737 !important;\n font-weight: 400 !important;\n}\n\n// General Formkit Styling ----\n\n.formkit {\n &-input {\n .formkit {\n &-input {\n &-element {\n max-width: 100%;\n }\n\n &-error {\n font-weight: bold;\n }\n }\n }\n }\n\n .formkit-input-group-add-more {\n display: flex;\n justify-content: flex-end;\n\n button {\n border: black;\n }\n }\n\n .formkit-input {\n &[data-classification=\"text\"] .formkit-input-wrapper {\n display: flex;\n flex-direction: column;\n }\n\n &[data-classification=\"select\"] .formkit-input-wrapper {\n display: flex;\n flex-direction: column;\n }\n }\n\n .formkit-input[data-classification=\"button\"] {\n button {\n &[data-ghost] {\n color: white;\n background-color: #001d85;\n border-color: #001d85;\n border-radius: 1.875rem;\n\n &:hover {\n background-color: #196fd2;\n border-color: #196fd2;\n }\n }\n }\n }\n}\n\n.formkit-input.besides {\n border-bottom: 1px solid lightgrey !important;\n}\n\n.formkit-input-label {\n font-weight: 500 !important;\n}\n\n.formkit-input-element {\n\n &--textarea {\n width: 100%;\n }\n}\n\n.formkit-input-element--group {\n display: block !important;\n}\n\n.formkit-input.besides>.formkit-input-wrapper>.formkit-input-label {\n\n\n text-decoration: underline !important;\n}\n\n// #stepper,\n// #subStepper {\n\n\n// .step-progress__step::after {\n// display: none;\n// }\n\n// .step-progress__step-label {\n// cursor: pointer;\n// }\n// }\n</style>\n"],"names":["_resolveComponent","property","_createElementBlock","isReady","_ctx","_openBlock","_createBlock","_component_router_view","_createCommentVNode"],"mappings":";;;;;YACEA,EAIM,aAAA;SAJmHC,EAAQ,GAAAC,EAAA,OAAA;AAAA,IAAA,OAAA;AAAA,IAE5GC,KAAAA,EAAAA;AAAAA,EAAAA,GAAAA;AAAAA,IAASC,EAAA,WAAAC,KAAoBC,EAAAC,GAAA;AAAA,MAAA,KAAA;AAAA,MAHpD,KAAAH,EAAA;AAAA,IAAA,CAAA,KAAAI,EAAA,IAAA,EAAA;AAAA;;;"}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { setupDpiContext as l } from "./composables/useDpiContext.mjs";
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
import { mapGetters as
|
|
4
|
-
import { config as
|
|
5
|
-
import { useRuntimeEnv as
|
|
6
|
-
import { useRoute as
|
|
7
|
-
import { useDpiEditMode as
|
|
8
|
-
const
|
|
2
|
+
import { defineComponent as h, defineAsyncComponent as f, toRef as g, computed as i, toValue as y, watchEffect as v } from "vue";
|
|
3
|
+
import { mapGetters as $, mapActions as r, useStore as E } from "vuex";
|
|
4
|
+
import { config as S } from "./config/dpi-spec-config.mjs";
|
|
5
|
+
import { useRuntimeEnv as w } from "../composables/useRuntimeEnv.mjs";
|
|
6
|
+
import { useRoute as C } from "vue-router";
|
|
7
|
+
import { useDpiEditMode as D } from "./composables/useDpiEditMode.mjs";
|
|
8
|
+
const N = h({
|
|
9
9
|
name: "DataProviderInterface",
|
|
10
10
|
components: {
|
|
11
|
-
InputPage:
|
|
11
|
+
InputPage: f(() => import("./views/InputPage.vue.mjs"))
|
|
12
12
|
},
|
|
13
13
|
props: {
|
|
14
14
|
name: {
|
|
@@ -38,7 +38,7 @@ const L = u({
|
|
|
38
38
|
};
|
|
39
39
|
},
|
|
40
40
|
computed: {
|
|
41
|
-
|
|
41
|
+
...$("auth", [
|
|
42
42
|
"getIsEditMode"
|
|
43
43
|
]),
|
|
44
44
|
mode() {
|
|
@@ -56,9 +56,9 @@ const L = u({
|
|
|
56
56
|
return `${this.$env.content.dataProviderInterface.basePath}/${this.property}?locale=${this.$i18n.locale}&clear=true`;
|
|
57
57
|
},
|
|
58
58
|
handleScroll() {
|
|
59
|
-
var
|
|
59
|
+
var a, t, o;
|
|
60
60
|
try {
|
|
61
|
-
(
|
|
61
|
+
(a = document.getElementById("stepperAnchor")) != null && a.offsetTop || 0 >= 35 ? (t = document.getElementById("stepperAnchor")) == null || t.classList.add("border-bottom-lightgray") : (o = document.getElementById("stepperAnchor")) == null || o.classList.remove("border-bottom-lightgray");
|
|
62
62
|
} catch {
|
|
63
63
|
}
|
|
64
64
|
}
|
|
@@ -72,15 +72,24 @@ const L = u({
|
|
|
72
72
|
unmounted() {
|
|
73
73
|
window.removeEventListener("scroll", this.handleScroll);
|
|
74
74
|
},
|
|
75
|
-
setup(
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
75
|
+
setup(a) {
|
|
76
|
+
const t = C(), o = E(), s = w().content.dataProviderInterface.specification, d = S[s], p = g(a, "dpiContext"), e = i(() => {
|
|
77
|
+
const u = y(p);
|
|
78
|
+
return {
|
|
79
|
+
specification: d,
|
|
80
|
+
specificationName: s,
|
|
81
|
+
edit: {
|
|
82
|
+
enabled: t.query.edit === "true",
|
|
83
|
+
id: t.query.id || void 0,
|
|
84
|
+
fromDraft: t.query.fromDraft === "true"
|
|
85
|
+
},
|
|
86
|
+
...u
|
|
87
|
+
};
|
|
79
88
|
});
|
|
80
|
-
l(e),
|
|
81
|
-
|
|
89
|
+
l(e), v(() => {
|
|
90
|
+
o.dispatch("dpiStore/setSpecification", e.value.specification), o.dispatch("dpiStore/setSpecificationname", e.value.specificationName);
|
|
82
91
|
});
|
|
83
|
-
const c = i(() => `${
|
|
92
|
+
const c = i(() => `${t.query.key}@${e.value.specificationName}`), { isReady: m } = D(e);
|
|
84
93
|
return {
|
|
85
94
|
resolvedDpiContext: e,
|
|
86
95
|
key: c,
|
|
@@ -89,6 +98,6 @@ const L = u({
|
|
|
89
98
|
}
|
|
90
99
|
});
|
|
91
100
|
export {
|
|
92
|
-
|
|
101
|
+
N as default
|
|
93
102
|
};
|
|
94
103
|
//# sourceMappingURL=DataProviderInterface.vue2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataProviderInterface.vue2.mjs","sources":["../../lib/data-provider-interface/DataProviderInterface.vue"],"sourcesContent":["<template>\n <div class=\"d-flex flex-column bg-transparent container-fluid justify-content-between dpi position-relative w-100\" :key=\"property\">\n <!-- CONTENT -->\n <router-view v-if=\"isReady\" ref=\"view\" :key=\"key\">\n </router-view>\n </div>\n</template>\n\n<script lang=\"ts\">\n/* eslint-disable no-nested-ternary, no-lonely-if, no-param-reassign */\nimport { DpiContext, setupDpiContext } from './composables/useDpiContext';\nimport { computed, defineAsyncComponent, defineComponent, PropType , ref, toRef, toRefs, watch, watchEffect} from 'vue';\nimport { mapActions, mapGetters, useStore } from 'vuex';\nimport dpiSpecs from './config/dpi-spec-config';\nimport { useRuntimeEnv } from '../composables/useRuntimeEnv';\nimport { useRoute } from 'vue-router';\nimport { useAsyncState, watchOnce } from '@vueuse/core';\nimport { useDpiEditMode } from './composables/useDpiEditMode';\n\n\n\nexport default defineComponent({\n name: 'DataProviderInterface',\n components: {\n InputPage: defineAsyncComponent(() => import('./views/InputPage.vue')),\n },\n props: {\n name: {\n type: String,\n default: '',\n },\n dpiContext: {\n type: Object as PropType<DpiContext>,\n default: () => undefined,\n }\n },\n metaInfo() {\n return {\n title: `${this.$t('message.metadata.upload')} | ${this.$t('message.header.navigation.data.datasets')}`,\n meta: [\n { name: 'description', vmid: 'description', content: `${this.$t('message.datasets.meta.description')}` },\n { name: 'keywords', vmid: 'keywords', content: `${this.$env.metadata.keywords} ${this.$t('message.datasets.meta.description')}}` },\n { name: 'robots', content: 'noindex, follow' },\n ],\n };\n },\n data() {\n return {\n property: this.$route.params.property,\n id: this.$route.params.id,\n };\n },\n computed: {\n ...mapGetters('auth', [\n 'getIsEditMode',\n ]),\n mode() {\n return this.property === 'catalogues'\n ? this.getIsEditMode\n ? this.$t('message.dataupload.menu.editCatalogue')\n : this.$t('message.dataupload.createNewCatalogue')\n : this.property === 'datasets'\n ? this.getIsEditMode\n ? this.$t('message.dataupload.menu.editDataset')\n : this.$t('message.dataupload.createNewDataset')\n : 'Edit Distribution';\n },\n },\n methods: {\n ...mapActions('dpiStore', [\n 'saveLocalstorageValues',\n ]),\n ...mapActions('auth', [\n 'populateDraftAndEdit',\n ]),\n getClearPath() {\n return `${this.$env.content.dataProviderInterface.basePath}/${this.property}?locale=${this.$i18n.locale}&clear=true`;;\n },\n handleScroll() {\n try {\n if (document.getElementById(\"stepperAnchor\")?.offsetTop || 0 >= 35) {\n document.getElementById(\"stepperAnchor\")?.classList.add(\"border-bottom-lightgray\");\n }\n else {\n document.getElementById(\"stepperAnchor\")?.classList.remove(\"border-bottom-lightgray\");\n }\n } catch (error) {\n \n }\n }\n\n },\n created() {\n window.addEventListener('scroll', this.handleScroll);\n this.populateDraftAndEdit();\n },\n mounted() {\n this.saveLocalstorageValues(this.property);\n },\n unmounted() {\n window.removeEventListener('scroll', this.handleScroll);\n },\n setup(props) {\n const route = useRoute()\n const store = useStore()\n const env = useRuntimeEnv()\n const userSpec = env.content.dataProviderInterface.specification as 'dcatap' | 'dcatapde' | 'dcatapdeODB'\n const fallbackSpec = dpiSpecs[userSpec]\n const dpiContext = toRef(props, 'dpiContext')\n\n const resolvedDpiContext = computed<DpiContext>(() => {\n return dpiContext.value || {\n specification: fallbackSpec,\n specificationName: userSpec\n }\n })\n\n setupDpiContext(resolvedDpiContext)\n\n watchEffect(() => {\n store.dispatch('dpiStore/setSpecification', resolvedDpiContext.value.specification)\n store.dispatch('dpiStore/setSpecificationname', resolvedDpiContext.value.specificationName)\n })\n\n const key = computed(() => {\n return `${route.query.key}@${resolvedDpiContext.value.specificationName}`\n })\n\n const { isReady } = useDpiEditMode(resolvedDpiContext)\n\n return {\n resolvedDpiContext,\n key,\n isReady,\n }\n\n }\n});\n</script>\n\n<style lang=\"scss\">\n.border-bottom-lightgray {\n border-bottom: 1px solid lightgray;\n}\n.stickyStepper {\n position: sticky;\n top: 0;\n background: #ffffff;\n z-index: 999;\n}\n\n.stickyStepper .SSfirstRow {\n margin: 1vh 0;\n display: flex;\n align-items: center;\n}\n\n.stickyStepper .stickyNav {\n border-left: 1px solid black;\n margin-left: 1vh;\n padding-left: 1vh;\n}\n\n#stepper {\n width: 100% !important;\n}\n\n#input {\n padding: 10px;\n}\n\n.small-headline {\n font-size: 1.5rem;\n min-width: max-content;\n}\n\n.property {\n margin: 20px;\n background-color: #ffffff;\n border: solid 0.5px rgb(225, 225, 225);\n margin-top: 30px;\n}\n\n.infoBox .material-icons {\n font-size: 20px;\n vertical-align: text-bottom;\n margin-right: 5px;\n margin-bottom: 1px;\n}\n\n.infoBox {\n width: 100%;\n height: 30%;\n background-color: #f7f7f7;\n padding: 5%;\n border-radius: 0.25rem;\n margin-top: 20px;\n\n .input_subpage_nav {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 15px;\n }\n}\n\n.besides {\n .formkit-input-group-repeatable {\n display: flex;\n flex-direction: row;\n background-color: transparent;\n padding: 0px;\n }\n}\n\n.main {\n width: 75%;\n margin: 0 5px 0 5px;\n}\n\n.sub {\n width: 20%;\n margin: 0 5px 0 5px;\n}\n\n#subStepperBox {\n position: sticky;\n top: 154px;\n z-index: 10;\n width: 100%;\n padding: 0 10%;\n\n .step-progress__bar {\n border-top: none !important;\n }\n\n .step-progress__step--active {\n .step-progress__step-label {\n background-color: lightsteelblue !important;\n }\n\n }\n}\n\n.step-progress__step span{\n \n color:white !important;\n \n}\n// Stepper Customizing -------------\n\n// #stepper,\n// #subStepper {\n// .step-progress__step {\n// display: flex;\n// align-items: center;\n// justify-content: center;\n// height: 70%;\n// width: 20%;\n// display: flex;\n// align-items: center;\n// z-index: 1;\n\n\n// span {\n// color: grey;\n// font-size: 18px;\n// display: none;\n// }\n\n// div {\n// padding: 1rem;\n// height: 100%;\n// display: flex;\n// align-items: center;\n// color: white;\n// font-weight: 300;\n\n// }\n\n// .step-progress__step-label {\n\n// background: lightgrey;\n// background-size: 400% 400%;\n// background-position: 100% 0%;\n// transition: all 300ms ease-in-out;\n// border-right: 1px white solid;\n// font-size: 14px;\n// display: flex;\n// align-items: center;\n// justify-content: center;\n\n\n// }\n\n\n// .step-progress__step-label:hover {\n// background-position: 65% 0%;\n// color: black;\n\n// }\n\n// }\n\n// .step-progress__step--active {\n\n// z-index: 7 !important;\n\n\n// span {\n// color: black;\n// }\n\n// div {\n// background: white;\n// }\n\n// .step-progress__step-label {\n// background: rgb(236, 236, 236);\n// background-position: 50% 0%;\n// box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12) !important;\n// transform: scale(1.1);\n// z-index: 8;\n// font-size: 16px;\n// }\n\n// }\n\n// .step-progress__step--valid {\n// div {\n// color: white;\n\n// }\n\n// .step-progress__step-label {\n// background: rgba(0, 235, 0, 0.2);\n// color: lightslategrey;\n\n\n// }\n\n// .step-progress__step-label:hover {\n// color: black;\n// }\n// }\n\n// .step-progress__step--active .step-progress__step-label {\n// color: rgb(31, 31, 31);\n// }\n\n// .step-progress__wrapper-after {\n// display: none;\n// }\n\n// .step-progress__step-icon {\n// display: none !important;\n// }\n\n// .step-progress__bar {\n// margin: 0;\n// height: 5rem;\n// border-top: 1px solid lightslategray;\n\n// }\n\n// .step-progress__step-label {\n// position: unset;\n// transform: unset;\n// flex-grow: 1;\n// }\n\n// .step-progress__step {}\n\n// .step-progress__wrapper-before {\n// display: none !important;\n// }\n\n// #stepper .step-progress__step::after {\n// display: none !important;\n// }\n// }\n#stepper .step-progress__step{\n border: solid white 20px;\n}\n#stepper .step-progress__step-icon, #subStepper .step-progress__step-icon {\n font-size: 25px;\n}\n.step-progress__step-label{\n cursor: pointer;\n}\n// Input Form Margins & Borders ----\n\n.formkit-input[data-classification=group] [data-is-repeatable] {\n border: none;\n padding: 1em 1em 1em 0em;\n}\n\n.formkit-input[data-classification=group] [data-is-repeatable] .formkit-input-group-repeatable {\n border-bottom: none;\n}\n\n.formkit-input-element--checkbox {\n margin-right: 5px;\n}\n\n.formkit-input-wrapper {\n font-family: \"Ubuntu\";\n}\n\n.formkit-input[data-classification=button] button[data-ghost] {\n font-weight: 400;\n}\n\n.formkit-input-error {\n color: #e13737 !important;\n font-weight: 400 !important;\n}\n\n// General Formkit Styling ----\n\n.formkit {\n &-input {\n .formkit {\n &-input {\n &-element {\n max-width: 100%;\n }\n\n &-error {\n font-weight: bold;\n }\n }\n }\n }\n\n .formkit-input-group-add-more {\n display: flex;\n justify-content: flex-end;\n\n button {\n border: black;\n }\n }\n\n .formkit-input {\n &[data-classification=\"text\"] .formkit-input-wrapper {\n display: flex;\n flex-direction: column;\n }\n\n &[data-classification=\"select\"] .formkit-input-wrapper {\n display: flex;\n flex-direction: column;\n }\n }\n\n .formkit-input[data-classification=\"button\"] {\n button {\n &[data-ghost] {\n color: white;\n background-color: #001d85;\n border-color: #001d85;\n border-radius: 1.875rem;\n\n &:hover {\n background-color: #196fd2;\n border-color: #196fd2;\n }\n }\n }\n }\n}\n\n.formkit-input.besides {\n border-bottom: 1px solid lightgrey !important;\n}\n\n.formkit-input-label {\n font-weight: 500 !important;\n}\n\n.formkit-input-element {\n\n &--textarea {\n width: 100%;\n }\n}\n\n.formkit-input-element--group {\n display: block !important;\n}\n\n.formkit-input.besides>.formkit-input-wrapper>.formkit-input-label {\n\n\n text-decoration: underline !important;\n}\n\n// #stepper,\n// #subStepper {\n\n\n// .step-progress__step::after {\n// display: none;\n// }\n\n// .step-progress__step-label {\n// cursor: pointer;\n// }\n// }\n</style>\n"],"names":["_sfc_main","defineComponent","defineAsyncComponent","mapGetters","mapActions","_a","_b","_c","props","route","useRoute","store","useStore","userSpec","useRuntimeEnv","fallbackSpec","dpiSpecs","dpiContext","toRef","resolvedDpiContext","computed","setupDpiContext","watchEffect","key","isReady","useDpiEditMode"],"mappings":";;;;;;;AAqBA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV,WAAWC,EAAqB,MAAM,OAAO,2BAAuB,CAAC;AAAA,EACvE;AAAA,EACA,OAAO;AAAA,IACL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS,MAAM;AAAA;AAAA,IACjB;AAAA,EACF;AAAA,EACA,WAAW;AACF,WAAA;AAAA,MACL,OAAO,GAAG,KAAK,GAAG,yBAAyB,CAAC,MAAM,KAAK,GAAG,yCAAyC,CAAC;AAAA,MAC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EhB;AAAA,IACF;AAAA,EAEF;AAAA,EACA,UAAU;AACD,WAAA,iBAAiB,UAAU,KAAK,YAAY,GACnD,KAAK,qBAAqB;AAAA,EAC5B;AAAA,EACA,UAAU;AACH,SAAA,uBAAuB,KAAK,QAAQ;AAAA,EAC3C;AAAA,EACA,YAAY;AACH,WAAA,oBAAoB,UAAU,KAAK,YAAY;AAAA,EACxD;AAAA,EACA,MAAMC,GAAO;AACX,UAAMC,IAAQC,KACRC,IAAQC,KAERC,IADMC,IACS,QAAQ,sBAAsB,eAC7CC,IAAeC,EAASH,CAAQ,GAChCI,IAAaC,EAAMV,GAAO,YAAY,GAEtCW,IAAqBC,EAAqB,MACvCH,EAAW,SAAS;AAAA,MACzB,eAAeF;AAAA,MACf,mBAAmBF;AAAA,IAAA,CAEtB;AAED,IAAAQ,EAAgBF,CAAkB,GAElCG,EAAY,MAAM;AAChB,MAAAX,EAAM,SAAS,6BAA6BQ,EAAmB,MAAM,aAAa,GAClFR,EAAM,SAAS,iCAAiCQ,EAAmB,MAAM,iBAAiB;AAAA,IAAA,CAC3F;AAEK,UAAAI,IAAMH,EAAS,MACZ,GAAGX,EAAM,MAAM,GAAG,IAAIU,EAAmB,MAAM,iBAAiB,EACxE,GAEK,EAAE,SAAAK,EAAA,IAAYC,EAAiC;AAE9C,WAAA;AAAA,MACL,oBAAAN;AAAA,MACA,KAAAI;AAAA,MACA,SAAAC;AAAA,IAAA;AAAA,EAGJ;AACF,CAAC;"}
|
|
1
|
+
{"version":3,"file":"DataProviderInterface.vue2.mjs","sources":["../../lib/data-provider-interface/DataProviderInterface.vue"],"sourcesContent":["<template>\n <div class=\"d-flex flex-column bg-transparent container-fluid justify-content-between dpi position-relative w-100\" :key=\"property\">\n <!-- CONTENT -->\n <router-view v-if=\"isReady\" ref=\"view\" :key=\"key\">\n </router-view>\n </div>\n</template>\n\n<script lang=\"ts\">\n/* eslint-disable no-nested-ternary, no-lonely-if, no-param-reassign */\nimport { DpiContext, setupDpiContext } from './composables/useDpiContext';\nimport { computed, defineAsyncComponent, defineComponent, PropType , ref, toRef, toRefs, toValue, watch, watchEffect} from 'vue';\nimport { mapActions, mapGetters, useStore } from 'vuex';\nimport dpiSpecs from './config/dpi-spec-config';\nimport { useRuntimeEnv } from '../composables/useRuntimeEnv';\nimport { useRoute } from 'vue-router';\nimport { useAsyncState, watchOnce } from '@vueuse/core';\nimport { useDpiEditMode } from './composables/useDpiEditMode';\n\n\n\nexport default defineComponent({\n name: 'DataProviderInterface',\n components: {\n InputPage: defineAsyncComponent(() => import('./views/InputPage.vue')),\n },\n props: {\n name: {\n type: String,\n default: '',\n },\n dpiContext: {\n type: Object as PropType<DpiContext>,\n default: () => undefined,\n }\n },\n metaInfo() {\n return {\n title: `${this.$t('message.metadata.upload')} | ${this.$t('message.header.navigation.data.datasets')}`,\n meta: [\n { name: 'description', vmid: 'description', content: `${this.$t('message.datasets.meta.description')}` },\n { name: 'keywords', vmid: 'keywords', content: `${this.$env.metadata.keywords} ${this.$t('message.datasets.meta.description')}}` },\n { name: 'robots', content: 'noindex, follow' },\n ],\n };\n },\n data() {\n return {\n property: this.$route.params.property,\n id: this.$route.params.id,\n };\n },\n computed: {\n ...mapGetters('auth', [\n 'getIsEditMode',\n ]),\n mode() {\n return this.property === 'catalogues'\n ? this.getIsEditMode\n ? this.$t('message.dataupload.menu.editCatalogue')\n : this.$t('message.dataupload.createNewCatalogue')\n : this.property === 'datasets'\n ? this.getIsEditMode\n ? this.$t('message.dataupload.menu.editDataset')\n : this.$t('message.dataupload.createNewDataset')\n : 'Edit Distribution';\n },\n },\n methods: {\n ...mapActions('dpiStore', [\n 'saveLocalstorageValues',\n ]),\n ...mapActions('auth', [\n 'populateDraftAndEdit',\n ]),\n getClearPath() {\n return `${this.$env.content.dataProviderInterface.basePath}/${this.property}?locale=${this.$i18n.locale}&clear=true`;;\n },\n handleScroll() {\n try {\n if (document.getElementById(\"stepperAnchor\")?.offsetTop || 0 >= 35) {\n document.getElementById(\"stepperAnchor\")?.classList.add(\"border-bottom-lightgray\");\n }\n else {\n document.getElementById(\"stepperAnchor\")?.classList.remove(\"border-bottom-lightgray\");\n }\n } catch (error) {\n \n }\n }\n\n },\n created() {\n window.addEventListener('scroll', this.handleScroll);\n this.populateDraftAndEdit();\n },\n mounted() {\n this.saveLocalstorageValues(this.property);\n },\n unmounted() {\n window.removeEventListener('scroll', this.handleScroll);\n },\n setup(props) {\n const route = useRoute()\n const store = useStore()\n const env = useRuntimeEnv()\n const userSpec = env.content.dataProviderInterface.specification as 'dcatap' | 'dcatapde' | 'dcatapdeODB'\n const fallbackSpec = dpiSpecs[userSpec]\n const dpiContext = toRef(props, 'dpiContext')\n\n const resolvedDpiContext = computed<DpiContext>(() => {\n const _dpiContext = toValue(dpiContext)\n\n return {\n specification: fallbackSpec,\n specificationName: userSpec,\n edit: {\n enabled: route.query.edit === 'true',\n id: route.query.id as string || undefined,\n fromDraft: route.query.fromDraft === 'true',\n },\n ..._dpiContext\n }\n })\n\n setupDpiContext(resolvedDpiContext)\n\n watchEffect(() => {\n store.dispatch('dpiStore/setSpecification', resolvedDpiContext.value.specification)\n store.dispatch('dpiStore/setSpecificationname', resolvedDpiContext.value.specificationName)\n })\n\n const key = computed(() => {\n return `${route.query.key}@${resolvedDpiContext.value.specificationName}`\n })\n\n const { isReady } = useDpiEditMode(resolvedDpiContext)\n\n return {\n resolvedDpiContext,\n key,\n isReady,\n }\n\n }\n});\n</script>\n\n<style lang=\"scss\">\n.border-bottom-lightgray {\n border-bottom: 1px solid lightgray;\n}\n.stickyStepper {\n position: sticky;\n top: 0;\n background: #ffffff;\n z-index: 999;\n}\n\n.stickyStepper .SSfirstRow {\n margin: 1vh 0;\n display: flex;\n align-items: center;\n}\n\n.stickyStepper .stickyNav {\n border-left: 1px solid black;\n margin-left: 1vh;\n padding-left: 1vh;\n}\n\n#stepper {\n width: 100% !important;\n}\n\n#input {\n padding: 10px;\n}\n\n.small-headline {\n font-size: 1.5rem;\n min-width: max-content;\n}\n\n.property {\n margin: 20px;\n background-color: #ffffff;\n border: solid 0.5px rgb(225, 225, 225);\n margin-top: 30px;\n}\n\n.infoBox .material-icons {\n font-size: 20px;\n vertical-align: text-bottom;\n margin-right: 5px;\n margin-bottom: 1px;\n}\n\n.infoBox {\n width: 100%;\n height: 30%;\n background-color: #f7f7f7;\n padding: 5%;\n border-radius: 0.25rem;\n margin-top: 20px;\n\n .input_subpage_nav {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n padding: 15px;\n }\n}\n\n.besides {\n .formkit-input-group-repeatable {\n display: flex;\n flex-direction: row;\n background-color: transparent;\n padding: 0px;\n }\n}\n\n.main {\n width: 75%;\n margin: 0 5px 0 5px;\n}\n\n.sub {\n width: 20%;\n margin: 0 5px 0 5px;\n}\n\n#subStepperBox {\n position: sticky;\n top: 154px;\n z-index: 10;\n width: 100%;\n padding: 0 10%;\n\n .step-progress__bar {\n border-top: none !important;\n }\n\n .step-progress__step--active {\n .step-progress__step-label {\n background-color: lightsteelblue !important;\n }\n\n }\n}\n\n.step-progress__step span{\n \n color:white !important;\n \n}\n// Stepper Customizing -------------\n\n// #stepper,\n// #subStepper {\n// .step-progress__step {\n// display: flex;\n// align-items: center;\n// justify-content: center;\n// height: 70%;\n// width: 20%;\n// display: flex;\n// align-items: center;\n// z-index: 1;\n\n\n// span {\n// color: grey;\n// font-size: 18px;\n// display: none;\n// }\n\n// div {\n// padding: 1rem;\n// height: 100%;\n// display: flex;\n// align-items: center;\n// color: white;\n// font-weight: 300;\n\n// }\n\n// .step-progress__step-label {\n\n// background: lightgrey;\n// background-size: 400% 400%;\n// background-position: 100% 0%;\n// transition: all 300ms ease-in-out;\n// border-right: 1px white solid;\n// font-size: 14px;\n// display: flex;\n// align-items: center;\n// justify-content: center;\n\n\n// }\n\n\n// .step-progress__step-label:hover {\n// background-position: 65% 0%;\n// color: black;\n\n// }\n\n// }\n\n// .step-progress__step--active {\n\n// z-index: 7 !important;\n\n\n// span {\n// color: black;\n// }\n\n// div {\n// background: white;\n// }\n\n// .step-progress__step-label {\n// background: rgb(236, 236, 236);\n// background-position: 50% 0%;\n// box-shadow: 0px 2px 1px -1px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 1px 3px 0px rgba(0, 0, 0, 0.12) !important;\n// transform: scale(1.1);\n// z-index: 8;\n// font-size: 16px;\n// }\n\n// }\n\n// .step-progress__step--valid {\n// div {\n// color: white;\n\n// }\n\n// .step-progress__step-label {\n// background: rgba(0, 235, 0, 0.2);\n// color: lightslategrey;\n\n\n// }\n\n// .step-progress__step-label:hover {\n// color: black;\n// }\n// }\n\n// .step-progress__step--active .step-progress__step-label {\n// color: rgb(31, 31, 31);\n// }\n\n// .step-progress__wrapper-after {\n// display: none;\n// }\n\n// .step-progress__step-icon {\n// display: none !important;\n// }\n\n// .step-progress__bar {\n// margin: 0;\n// height: 5rem;\n// border-top: 1px solid lightslategray;\n\n// }\n\n// .step-progress__step-label {\n// position: unset;\n// transform: unset;\n// flex-grow: 1;\n// }\n\n// .step-progress__step {}\n\n// .step-progress__wrapper-before {\n// display: none !important;\n// }\n\n// #stepper .step-progress__step::after {\n// display: none !important;\n// }\n// }\n#stepper .step-progress__step{\n border: solid white 20px;\n}\n#stepper .step-progress__step-icon, #subStepper .step-progress__step-icon {\n font-size: 25px;\n}\n.step-progress__step-label{\n cursor: pointer;\n}\n// Input Form Margins & Borders ----\n\n.formkit-input[data-classification=group] [data-is-repeatable] {\n border: none;\n padding: 1em 1em 1em 0em;\n}\n\n.formkit-input[data-classification=group] [data-is-repeatable] .formkit-input-group-repeatable {\n border-bottom: none;\n}\n\n.formkit-input-element--checkbox {\n margin-right: 5px;\n}\n\n.formkit-input-wrapper {\n font-family: \"Ubuntu\";\n}\n\n.formkit-input[data-classification=button] button[data-ghost] {\n font-weight: 400;\n}\n\n.formkit-input-error {\n color: #e13737 !important;\n font-weight: 400 !important;\n}\n\n// General Formkit Styling ----\n\n.formkit {\n &-input {\n .formkit {\n &-input {\n &-element {\n max-width: 100%;\n }\n\n &-error {\n font-weight: bold;\n }\n }\n }\n }\n\n .formkit-input-group-add-more {\n display: flex;\n justify-content: flex-end;\n\n button {\n border: black;\n }\n }\n\n .formkit-input {\n &[data-classification=\"text\"] .formkit-input-wrapper {\n display: flex;\n flex-direction: column;\n }\n\n &[data-classification=\"select\"] .formkit-input-wrapper {\n display: flex;\n flex-direction: column;\n }\n }\n\n .formkit-input[data-classification=\"button\"] {\n button {\n &[data-ghost] {\n color: white;\n background-color: #001d85;\n border-color: #001d85;\n border-radius: 1.875rem;\n\n &:hover {\n background-color: #196fd2;\n border-color: #196fd2;\n }\n }\n }\n }\n}\n\n.formkit-input.besides {\n border-bottom: 1px solid lightgrey !important;\n}\n\n.formkit-input-label {\n font-weight: 500 !important;\n}\n\n.formkit-input-element {\n\n &--textarea {\n width: 100%;\n }\n}\n\n.formkit-input-element--group {\n display: block !important;\n}\n\n.formkit-input.besides>.formkit-input-wrapper>.formkit-input-label {\n\n\n text-decoration: underline !important;\n}\n\n// #stepper,\n// #subStepper {\n\n\n// .step-progress__step::after {\n// display: none;\n// }\n\n// .step-progress__step-label {\n// cursor: pointer;\n// }\n// }\n</style>\n"],"names":["_sfc_main","defineComponent","defineAsyncComponent","mapGetters","mapActions","_a","_b","_c","props","route","useRoute","store","useStore","userSpec","useRuntimeEnv","fallbackSpec","dpiSpecs","dpiContext","toRef","resolvedDpiContext","computed","_dpiContext","toValue","setupDpiContext","watchEffect","key","isReady","useDpiEditMode"],"mappings":";;;;;;;AAqBA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV,WAAWC,EAAqB,MAAM,OAAO,2BAAuB,CAAC;AAAA,EACvE;AAAA,EACA,OAAO;AAAA,IACL,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,SAAS;AAAA,IACX;AAAA,IACA,YAAY;AAAA,MACV,MAAM;AAAA,MACN,SAAS,MAAM;AAAA;AAAA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AAAA,EAGJ;AACF,CAAC;"}
|
|
@@ -1,52 +1,58 @@
|
|
|
1
|
-
import { getCurrentInstance as g, ref as
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { getCurrentInstance as g, ref as l, computed as D, onMounted as h, watchEffect as q, resolveComponent as $, openBlock as d, createElementBlock as b, createElementVNode as _, toDisplayString as y, createTextVNode as k, createBlock as r } from "vue";
|
|
2
|
+
import "vue-router";
|
|
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";
|
|
8
|
+
import "@formkit/core";
|
|
9
|
+
const S = { class: "formkitProperty DSid" }, B = {
|
|
7
10
|
props: ["context"]
|
|
8
|
-
},
|
|
11
|
+
}, A = /* @__PURE__ */ Object.assign(B, {
|
|
9
12
|
__name: "UniqueIdentifierInput",
|
|
10
|
-
setup(
|
|
11
|
-
let
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
setup(F) {
|
|
14
|
+
let u = g().appContext.app.config.globalProperties.$env;
|
|
15
|
+
const n = x(), p = N(), o = l(), m = D(() => {
|
|
16
|
+
var e;
|
|
17
|
+
return !!((e = p.value.edit) != null && e.enabled);
|
|
18
|
+
});
|
|
19
|
+
o.value = localStorage.getItem("dpi_duplicate");
|
|
20
|
+
const { t: i, locale: M } = E(), a = l({
|
|
15
21
|
idformatvalid: "",
|
|
16
22
|
idunique: "",
|
|
17
23
|
required: ""
|
|
18
24
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}),
|
|
25
|
+
h(() => {
|
|
26
|
+
a.value.idformatvalid = i("message.dataupload.datasets.datasetID.invalidFormat"), a.value.idunique = i("message.dataupload.datasets.datasetID.duplicate"), a.value.required = i("message.dataupload.datasets.datasetID.required");
|
|
27
|
+
}), q(() => {
|
|
22
28
|
});
|
|
23
|
-
async function
|
|
24
|
-
let
|
|
25
|
-
const
|
|
29
|
+
async function c(e) {
|
|
30
|
+
let t = !0, s = u.api.hubUrl;
|
|
31
|
+
const v = n.getters["auth/getUserDraftIds"];
|
|
26
32
|
return new Promise(() => {
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
else if (
|
|
30
|
-
|
|
33
|
+
if (C(e.value) || e.value === "" || e.value === void 0)
|
|
34
|
+
t = !0;
|
|
35
|
+
else if (v.includes(e.value))
|
|
36
|
+
t = !1;
|
|
31
37
|
else {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}).catch((
|
|
36
|
-
|
|
38
|
+
const I = `${s}datasets/${e.value}?useNormalizedId=true`;
|
|
39
|
+
U.head(I).then(() => {
|
|
40
|
+
t = !1;
|
|
41
|
+
}).catch((P) => {
|
|
42
|
+
t = !0;
|
|
37
43
|
});
|
|
38
44
|
}
|
|
39
|
-
}),
|
|
45
|
+
}), t;
|
|
40
46
|
}
|
|
41
47
|
function f(e) {
|
|
42
48
|
return /^[a-z0-9-]*$/.test(e.value);
|
|
43
49
|
}
|
|
44
|
-
return (e,
|
|
45
|
-
const s =
|
|
46
|
-
return
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
!
|
|
50
|
+
return (e, t) => {
|
|
51
|
+
const s = $("FormKit");
|
|
52
|
+
return d(), b("div", S, [
|
|
53
|
+
_("h4", null, y(e.$t("message.dataupload.datasets.datasetID.label")), 1),
|
|
54
|
+
t[0] || (t[0] = k()),
|
|
55
|
+
!m.value || o.value ? (d(), r(s, {
|
|
50
56
|
key: 0,
|
|
51
57
|
type: "text",
|
|
52
58
|
name: "datasetID",
|
|
@@ -54,12 +60,12 @@ const C = { class: "formkitProperty DSid" }, M = {
|
|
|
54
60
|
placeholder: e.$t("message.dataupload.datasets.datasetID.label"),
|
|
55
61
|
info: e.$t("message.dataupload.datasets.datasetID.info"),
|
|
56
62
|
help: e.$t("message.dataupload.datasets.datasetID.help"),
|
|
57
|
-
"validation-rules": { idformatvalid: f, idunique:
|
|
63
|
+
"validation-rules": { idformatvalid: f, idunique: c },
|
|
58
64
|
validation: "idformatvalid|idunique|required",
|
|
59
65
|
"validation-visibility": "live",
|
|
60
|
-
"validation-messages":
|
|
66
|
+
"validation-messages": a.value,
|
|
61
67
|
"outer-class": "formkitCmpWrap p-3"
|
|
62
|
-
}, null, 8, ["placeholder", "info", "help", "validation-rules", "validation-messages"])) : (
|
|
68
|
+
}, null, 8, ["placeholder", "info", "help", "validation-rules", "validation-messages"])) : (d(), r(s, {
|
|
63
69
|
key: 1,
|
|
64
70
|
type: "text",
|
|
65
71
|
name: "datasetID",
|
|
@@ -73,6 +79,6 @@ const C = { class: "formkitProperty DSid" }, M = {
|
|
|
73
79
|
}
|
|
74
80
|
});
|
|
75
81
|
export {
|
|
76
|
-
|
|
82
|
+
A as default
|
|
77
83
|
};
|
|
78
84
|
//# sourceMappingURL=UniqueIdentifierInput.vue.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UniqueIdentifierInput.vue.mjs","sources":["../../../lib/data-provider-interface/components/UniqueIdentifierInput.vue"],"sourcesContent":["<script setup>\nimport { ref, onMounted, watchEffect } from 'vue'\nimport { isNil } from 'lodash';\nimport axios from 'axios';\nimport { useStore } from 'vuex';\nimport { getCurrentInstance } from \"vue\";\nimport { useI18n } from 'vue-i18n';\nlet env = getCurrentInstance().appContext.app.config.globalProperties.$env;\n\nconst store = useStore();\nconst
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -10,6 +10,11 @@ export interface DpiSpecification {
|
|
|
10
10
|
export interface DpiContext {
|
|
11
11
|
specification: DpiSpecification;
|
|
12
12
|
specificationName: string;
|
|
13
|
+
edit?: {
|
|
14
|
+
enabled?: boolean;
|
|
15
|
+
id?: string;
|
|
16
|
+
fromDraft?: boolean;
|
|
17
|
+
};
|
|
13
18
|
}
|
|
14
19
|
export type ComputedDpiContext = ComputedRef<DpiContext>;
|
|
15
20
|
export declare const dpiContextKey: InjectionKey<ComputedDpiContext>;
|
|
@@ -1 +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":";
|
|
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 edit?: {\n enabled?: boolean\n id?: string\n fromDraft?: boolean\n }\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":";AAuBa,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;"}
|
|
@@ -1,41 +1,52 @@
|
|
|
1
|
-
import { useRoute as
|
|
2
|
-
import { computed as
|
|
3
|
-
import { useStore as
|
|
4
|
-
import { useRuntimeEnv as
|
|
5
|
-
import { useAsyncState as
|
|
6
|
-
import { watchOnce as
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
var
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { useRoute as v } from "vue-router";
|
|
2
|
+
import { computed as s, toValue as d } from "vue";
|
|
3
|
+
import { useStore as D } from "vuex";
|
|
4
|
+
import { useRuntimeEnv as I } from "../../composables/useRuntimeEnv.mjs";
|
|
5
|
+
import { useAsyncState as $ } from "../../external/@vueuse/core/index";
|
|
6
|
+
import { watchOnce as q } from "../../external/@vueuse/shared/index";
|
|
7
|
+
function N(u) {
|
|
8
|
+
const a = v(), r = D(), i = I(), p = s(() => {
|
|
9
|
+
var t, e;
|
|
10
|
+
return ((e = (t = d(u)) == null ? void 0 : t.edit) == null ? void 0 : e.enabled) ?? a.query.edit === "true";
|
|
11
|
+
}), o = s(() => {
|
|
12
|
+
var t, e;
|
|
13
|
+
return ((e = (t = d(u)) == null ? void 0 : t.edit) == null ? void 0 : e.id) ?? a.query.id;
|
|
14
|
+
}), n = s(() => {
|
|
15
|
+
var t, e;
|
|
16
|
+
return ((e = (t = d(u)) == null ? void 0 : t.edit) == null ? void 0 : e.fromDraft) ?? a.query.fromDraft ?? r.getters["auth/getIsDraft"];
|
|
17
|
+
});
|
|
18
|
+
p.value && (localStorage.setItem("dpi_editmode", "false"), r.dispatch("auth/setIsEditMode", !1));
|
|
19
|
+
const m = s(() => {
|
|
20
|
+
var c;
|
|
21
|
+
const t = n.value, e = (c = r.getters["auth/getUserData"]) == null ? void 0 : c.rtpToken, y = a.params.property, g = a.params.id;
|
|
22
|
+
return r.dispatch("auth/setIsEditMode", !0), r.dispatch("auth/setIsDraft", t), { endpoint: t ? `${i.api.hubUrl}drafts/datasets/${o.value}.nt?catalogue=${a.query.catalog}` : a.params.property === "catalogues" ? `${i.api.hubUrl}catalogues/${a.query.catalog}.nt` : `${i.api.hubUrl}datasets/${o.value}.nt?useNormalizedId=true`, token: e, property: y, id: g };
|
|
23
|
+
}), { execute: f, isLoading: l, error: h } = $(
|
|
24
|
+
async () => await r.dispatch(
|
|
14
25
|
"dpiStore/convertToInput",
|
|
15
|
-
|
|
26
|
+
m.value
|
|
16
27
|
),
|
|
17
28
|
void 0,
|
|
18
29
|
{
|
|
19
30
|
immediate: !1
|
|
20
31
|
}
|
|
21
32
|
);
|
|
22
|
-
return
|
|
23
|
-
|
|
33
|
+
return q(
|
|
34
|
+
o,
|
|
24
35
|
() => {
|
|
25
|
-
if (!
|
|
36
|
+
if (!o.value)
|
|
26
37
|
return;
|
|
27
|
-
const
|
|
28
|
-
|
|
38
|
+
const t = n.value;
|
|
39
|
+
r.dispatch("auth/setIsEditMode", !0), r.dispatch("auth/setIsDraft", t), f();
|
|
29
40
|
},
|
|
30
41
|
{
|
|
31
42
|
immediate: !0
|
|
32
43
|
}
|
|
33
44
|
), {
|
|
34
|
-
isReady:
|
|
35
|
-
error:
|
|
45
|
+
isReady: s(() => !!r.getters["dpiStore/getSpecificationName"] && !l.value),
|
|
46
|
+
error: h
|
|
36
47
|
};
|
|
37
48
|
}
|
|
38
49
|
export {
|
|
39
|
-
|
|
50
|
+
N as useDpiEditMode
|
|
40
51
|
};
|
|
41
52
|
//# 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 } 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.id;\n });\n\n const editFromDraft = computed(() => {\n return route.query.fromDraft
|
|
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 store.dispatch(\"auth/setIsEditMode\", true);\n store.dispatch(\"auth/setIsDraft\", isDraft);\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 watchOnce(\n editIdQuery,\n () => {\n if (!editIdQuery.value) return;\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","editQuery","computed","_b","_a","toValue","editIdQuery","editFromDraft","requestParams","isDraft","token","property","id","execute","isLoading","error","useAsyncState","watchOnce"],"mappings":";;;;;;AA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