{"version":3,"file":"Distributions.vue.mjs","sources":["../../../lib/datasetDetails/distributions/Distributions.vue"],"sourcesContent":["<template>\n    <div class=\"mt-1 dsd-distributions\">\n      <distributions-header \n        :getDistributionDescription=\"getDistributionDescription\"\n        :openModal=\"openModal\"\n        :getDistributionTitle=\"getDistributionTitle\"\n        :showDownloadUrls=\"showDownloadUrls\"\n        :isUrlInvalid=\"isUrlInvalid\"\n        :showPublisher=\"showPublisher\"\n        :embed=\"embed\"\n      />\n      <div class=\"row\" v-if=\"!embed\">\n        <ul class=\"list list-unstyled w-100\">\n          <div class=\"distributions\" :key=\"`${expandedDistributions.length}--${expandedDistributionDescriptions.length}`\">\n            <distribution\n                v-for=\"(distribution, index) in displayedDistributions\"\n                @selectForPreview=\"selectDistribution\"\n                :key=\"`${index}--${distribution.id}`\"\n                :distribution=\"distribution\"\n                :fading=\"!distributions.displayAll && !isDistributionsAllDisplayed && index === distributions.displayCount - 1\"\n                :distributions=\"distributions\"\n                :setDistributionsDisplayCount=\"setDistributionsDisplayCount\"\n                :getDistributionFormat=\"getDistributionFormat\"\n                :distributionFormatTruncated=\"distributionFormatTruncated\"\n                :getDistributionTitle=\"getDistributionTitle\"\n                :distributionVisibleContent=\"distributionVisibleContent\"\n                :distributionExpandedContent=\"distributionExpandedContent\"\n                :distributionDescriptionIsExpanded=\"distributionDescriptionIsExpanded\"\n                :distributionDescriptionIsExpandable=\"distributionDescriptionIsExpandable\"\n                :getDistributionDescription=\"getDistributionDescription\"\n                :distributionIsExpanded=\"distributionIsExpanded\"\n                :showObject=\"showObject\"\n                :showNumber=\"showNumber\"\n                :showDownloadDropdown=\"showDownloadDropdown\"\n                :showLicence=\"showLicence\"\n                :showLicensingAssistant=\"showLicensingAssistant\"\n                :filterDateFormatEU=\"filterDateFormatEU\"\n                :showArray=\"showArray\"\n                :showObjectArray=\"showObjectArray\"\n                :getVisualisationLink=\"getVisualisationLink\"\n                :isOnlyOneUrl=\"isOnlyOneUrl\"\n                :getDownloadUrl=\"getDownloadUrl\"\n                :trackGoto=\"trackGoto\"\n                :showAccessUrls=\"showAccessUrls\"\n                :replaceHttp=\"replaceHttp\"\n                :previewLinkCallback=\"previewLinkCallback\"\n                :toggleDistribution=\"toggleDistribution\"\n                :toggleDistributionDescription=\"toggleDistributionDescription\"\n                :increaseNumDisplayedDistributions=\"increaseNumDisplayedDistributions\"\n                :nonOverflowingIncrementsForDistributions=\"nonOverflowingIncrementsForDistributions\"\n                :isUrlInvalid=\"isUrlInvalid\"\n                :openIfValidUrl=\"openIfValidUrl\"\n                :showTooltipVisualiseButton=\"showTooltipVisualiseButton\"\n                :appendCurrentLocaleToURL=\"appendCurrentLocaleToURL\"\n                :embed=\"embed\"\n            />\n          </div>\n        </ul>\n        <div class=\"w-100 d-flex flex-row justify-content-end\">\n          <download-all-distributions\n            v-if=\"!downloadAllTop\"\n            :getDistributionDescription=\"getDistributionDescription\"\n            :openModal=\"openModal\"\n            :getDistributionTitle=\"getDistributionTitle\"\n            :showDownloadUrls=\"showDownloadUrls\"\n            :isUrlInvalid=\"isUrlInvalid\"\n          />\n        </div>\n      </div>\n      <download-as-modal />\n      <!-- <distribution-visualization v-if=\"showDistibutionVisualisation\" class=\"mb-4\"></distribution-visualization> -->\n      <distribution-visualisation-slot\n        v-if=\"showDistibutionVisualisation && showVisualisation\"\n        ref=\"visualisationComponent\"\n        :key=\"componentKey\"\n        class=\"mb-4\"\n        :title=\"previewedDistTitle\"\n        :downloadUrl=\"previewedDistDownloadUrl\"\n        :format=\"previewedDistFormat\"\n        :compressFormat=\"previewedDistCompressFormat\"\n      ></distribution-visualisation-slot>\n    </div>\n</template>\n\n<script>\n\nimport {has, isNil} from \"lodash\";\nimport {getTranslationFor} from \"../../utils/helpers\";\nimport { mapGetters } from \"vuex\";\nimport DownloadAsModal from \"../../datasetDetails/distributions/DistributionDownloadAsModal\";\n\nexport default {\n  name: 'Distributions',\n  components: {\n    DownloadAsModal\n  },\n  props: {\n    openModal: Function,\n    expandedDistributions: Array,\n    expandedDistributionDescriptions: Array,\n    displayedDistributions: Array,\n    distributions: Object,\n    setDistributionsDisplayCount: Function,\n    isDistributionsAllDisplayed: Boolean,\n    pages: Object,\n    showDownloadUrls: Function,\n    getDistributionFormat: Function,\n    distributionFormatTruncated: Function,\n    getDistributionTitle: Function,\n    distributionVisibleContent: Array,\n    distributionExpandedContent: Array,\n    distributionDescriptionIsExpanded: Function,\n    distributionDescriptionIsExpandable: Function,\n    distributionIsExpanded: Function,\n    showObject: Function,\n    showNumber: Function,\n    showDownloadDropdown: Function,\n    showLicence: Function,\n    showLicensingAssistant: Function,\n    filterDateFormatEU: Function,\n    showArray: Function,\n    showObjectArray: Function,\n    getVisualisationLink: Function,\n    isOnlyOneUrl: Function,\n    getDownloadUrl: Function,\n    trackGoto: Function,\n    showAccessUrls: Function,\n    replaceHttp: Function,\n    previewLinkCallback: Function,\n    toggleDistribution: Function,\n    toggleDistributionDescription: Function,\n    increaseNumDisplayedDistributions: Function,\n    nonOverflowingIncrementsForDistributions: Function,\n    isUrlInvalid: Function,\n    openIfValidUrl: Function,\n    showTooltipVisualiseButton: Function,\n    appendCurrentLocaleToURL: Function,\n    showPublisher: Boolean,\n    embed: Boolean,\n  },\n  data() {\n    return {\n      componentKey: 0,\n      downloadAllTop: this.$env.content.datasetDetails.bulkDownload.buttonPosition === \"top\",\n      // previewedDistributionTitle: this.getDistributionTitle(this.displayedDistributions[0]),\n      showDistibutionVisualisation: false,\n      previewedDistributionTitle: \"\",\n      previewedDistDownloadUrl: \"\",\n      previewedDistFormat: \"\",\n      previewedDistCompressFormat: \"\",\n      selectedDistribution: null,\n      showVisualisation: this.$env.content.datasetDetails.distributions.showVisualisation,\n\n    };\n  },\n  computed: {\n    ...mapGetters('datasetDetails', [\n      'getLanguages',\n      'getCatalog',\n    ]),\n  },\n  methods: {\n    getDistributionDescription(distribution) {\n      return (has(distribution, 'description') && !isNil(distribution.description)) ? getTranslationFor(distribution.description, this.$route.query.locale, this.getLanguages) : '-';\n    },\n    selectDistribution(dist) {\n      this.previewedDistTitle = dist.title;\n      this.previewedDistDownloadUrl = dist.url;\n      this.previewedDistFormat = dist.format;\n      this.previewedDistCompressFormat = dist.compressFormat ? dist.compressFormat : '';\n      this.showDistibutionVisualisation = true;\n      this.componentKey += 1;  // kill and rerender with new values\n\n      // scroll to visualisation component\n      this.$nextTick(() => {\n        const visualisationComponent = this.$refs.visualisationComponent;\n        if (visualisationComponent) {\n          visualisationComponent.$el.scrollIntoView({ behavior: 'smooth' });\n        }\n      });\n    },\n  },\n};\n</script>\n\n<style lang=\"scss\" scoped>\n  .catalogue-label {\n    white-space: pre-line;\n  }\n\n  .cursor-pointer {\n    cursor: pointer;\n  }\n\n  .tag-color {\n    background-color: var(--tag-color);\n  }\n  .subjectBg {\n    background-color: #196fd2;\n  }\n  .btn-color {\n     &:hover {\n       background-color: #196fd2;\n       border-color: #196fd2;\n     }\n  }\n\n  .download-all-btn {\n    min-width: 100px;\n    height: 31px;\n  }\n\n  /*** BOOTSTRAP ***/\n  button:focus {\n    outline:0;\n  }\n\n.spinner-grow {\n  width: 20px;\n  height: 20px;\n}\n\n  /*** FONT AWESOME ICONS ***/\n  .fa-check-square {\n    color: #28a745;\n    width: 16px;\n    height: 16px;\n  }\n\n  /*** MATERIAL ICONS ***/\n  %modal-icon {\n    font-size: 18px;\n    cursor: default;\n  }\n\n  .help-icon {\n    @extend %modal-icon;\n  }\n\n  .check-icon {\n    @extend %modal-icon;\n    color: #28a745;\n  }\n\n  .material-icons.small-icon {\n    font-size: 20px;\n  }\n\n  .mt-4 {\n    margin-top: 1.5rem !important;\n  }\n\n  .keywords {\n\n    &__item {\n      position: relative;\n    }\n\n    &__actions {\n      display: flex;\n      justify-content: center;\n      align-items: flex-end;\n      height: 100%;\n      z-index: 11;\n    }\n  }\n  .sectionList {\n    list-style-type: '→ ';\n    margin-left:6.5%;\n  }\n  @media only screen and (max-width: 991px) {\n  .sectionList {\n    margin-left: 0;\n  }\n}\n</style>\n"],"names":["_sfc_main","DownloadAsModal","mapGetters","distribution","has","isNil","getTranslationFor","dist","visualisationComponent","_hoisted_1","_hoisted_3","_hoisted_4","_openBlock","_createElementBlock","_createVNode","_component_distributions_header","$options","$props","_hoisted_2","_createElementVNode","_Fragment","_renderList","index","_createBlock","_component_distribution","$data","_component_download_all_distributions","_component_download_as_modal","_component_distribution_visualisation_slot","_ctx"],"mappings":";;;;;;;AA2FA,MAAKA,IAAU;AAAA,EACb,MAAM;AAAA,EACN,YAAY;AAAA,IACV,iBAAAC;AAAA,EACD;AAAA,EACD,OAAO;AAAA,IACL,WAAW;AAAA,IACX,uBAAuB;AAAA,IACvB,kCAAkC;AAAA,IAClC,wBAAwB;AAAA,IACxB,eAAe;AAAA,IACf,8BAA8B;AAAA,IAC9B,6BAA6B;AAAA,IAC7B,OAAO;AAAA,IACP,kBAAkB;AAAA,IAClB,uBAAuB;AAAA,IACvB,6BAA6B;AAAA,IAC7B,sBAAsB;AAAA,IACtB,4BAA4B;AAAA,IAC5B,6BAA6B;AAAA,IAC7B,mCAAmC;AAAA,IACnC,qCAAqC;AAAA,IACrC,wBAAwB;AAAA,IACxB,YAAY;AAAA,IACZ,YAAY;AAAA,IACZ,sBAAsB;AAAA,IACtB,aAAa;AAAA,IACb,wBAAwB;AAAA,IACxB,oBAAoB;AAAA,IACpB,WAAW;AAAA,IACX,iBAAiB;AAAA,IACjB,sBAAsB;AAAA,IACtB,cAAc;AAAA,IACd,gBAAgB;AAAA,IAChB,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,aAAa;AAAA,IACb,qBAAqB;AAAA,IACrB,oBAAoB;AAAA,IACpB,+BAA+B;AAAA,IAC/B,mCAAmC;AAAA,IACnC,0CAA0C;AAAA,IAC1C,cAAc;AAAA,IACd,gBAAgB;AAAA,IAChB,4BAA4B;AAAA,IAC5B,0BAA0B;AAAA,IAC1B,eAAe;AAAA,IACf,OAAO;AAAA,EACR;AAAA,EACD,OAAO;AACL,WAAO;AAAA,MACL,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