@europeana/portal
Version:
Europeana Portal
2 lines • 5.01 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[117],{1011:function(t,e){},1123:function(t,e,n){"use strict";n.r(e);n(10),n(43),n(46),n(47);var o=n(1085),r=(n(13),{name:"InfoCard",components:{SmartLink:n(203).a},props:{url:{type:Object,default:null},info:{type:String,default:""},label:{type:String,default:null},image:{type:String,default:""},variant:{type:String,default:"default"}},computed:{cardClass:function(){return"".concat(this.variant,"-card")}}}),c=n(59),l=n(1011),d=n.n(l),component=Object(c.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-card",{staticClass:"text-center info-card",class:t.cardClass,attrs:{"data-qa":"info card","no-body":""}},[n("SmartLink",{attrs:{destination:t.url,"link-class":"card-link"}},[t.image?n("div",{staticClass:"card-img"},[n("span",{class:t.image})]):t._e(),t._v(" "),n("b-card-body",{attrs:{"data-qa":"card body"}},[t.info?n("b-card-title",{attrs:{"title-tag":"div","data-qa":"card info"}},[n("span",[t._v("\n "+t._s(t.info)+"\n ")])]):t._e(),t._v(" "),n("b-card-text",{staticClass:"text-uppercase",attrs:{"text-tag":"div"}},[t._v("\n "+t._s(t.label)+"\n ")])],1)],1)],1)}),[],!1,null,null,null);"function"==typeof d.a&&d()(component);var m={components:{InfoCard:component.exports},props:{section:{type:Object,default:function(){return null}}},computed:{cards:function(){return this.section.hasPartCollection.items.filter((function(t){return null!==t}))},cardGroupClass:function(){return"items/type-counts"===this.section.type?"card-deck-3-cols":"card-deck-4-cols"},cardVariant:function(){return"items/type-counts"===this.section.type?"dark":"default"}}},f=Object(c.a)(m,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.section?n("section",{staticClass:"info-card-section row mb-3"},[n("div",{staticClass:"col-12"},[n("b-card-group",{class:t.cardGroupClass,attrs:{deck:"",align:"center","data-qa":"section group"}},t._l(t.cards,(function(e,o){return n("InfoCard",{key:o,attrs:{url:e.url,info:e.info,label:e.label,image:e.image,variant:t.cardVariant}})})),1),t._v(" "),t.section.moreButton?n("SmartLink",{staticClass:"btn btn-light",attrs:{destination:t.section.moreButton.url,"data-qa":"section more button"}},[t._v("\n "+t._s(t.section.moreButton.text)+"\n ")]):t._e()],1)]):t._e()}),[],!1,null,null,null).exports,y="Recent items",h="Item counts by media type",C={name:"AutomatedCardGroup",components:{ContentCardSection:o.default,InfoCardSection:f},props:{sectionType:{type:String,required:!0},moreButton:{type:Object,default:null}},data:function(){var data={entries:[]};return"Featured organisations"===this.sectionType?(data.key="collections/organisations/featured",data.cardType="AutomatedEntityCard",data.headline=this.$i18n.t("automatedCardGroup.organisation")):"Featured places"===this.sectionType?(data.key="".concat(this.$i18n.locale,"/collections/places/featured"),data.cardType="AutomatedEntityCard",data.headline=this.$i18n.t("automatedCardGroup.place")):"Featured topics"===this.sectionType?(data.key="".concat(this.$i18n.locale,"/collections/topics/featured"),data.cardType="AutomatedEntityCard",data.headline=this.$i18n.t("automatedCardGroup.topic")):"Featured centuries"===this.sectionType?(data.key="".concat(this.$i18n.locale,"/collections/times/featured"),data.cardType="AutomatedEntityCard",data.headline=this.$i18n.t("automatedCardGroup.time")):this.sectionType===y?(data.key="items/recent",data.cardType="AutomatedRecordCard",data.headline=this.$i18n.t("automatedCardGroup.item")):this.sectionType===h&&(data.key="items/type-counts",data.cardType="InfoCard"),data},fetch:function(){var t=this;return this.$axios.get("/_api/cache/".concat(this.key),{baseURL:window.location.origin}).then((function(e){t.entries=e.data}))},computed:{contentCardSection:function(){var t,e,n=this;return this.sectionType===h?{type:this.key,hasPartCollection:{items:null===(e=this.entries)||void 0===e?void 0:e.map((function(t){return{__typename:n.cardType,url:n.searchFromType(t.label),info:n.$i18n.n(t.count),label:n.$t("facets.TYPE.options.".concat(t.label)),image:n.infoImageFromType(t.label)}}))},moreButton:this.moreButton}:{headline:this.headline,hasPartCollection:{items:null===(t=this.entries)||void 0===t?void 0:t.map((function(t){return{__typename:n.cardType,__variant:n.sectionType===y?null:"mini",name:t.prefLabel,identifier:t.id,image:n.$apis.entity.imageUrl(t),encoding:t,logo:!!t.logo}}))},moreButton:this.moreButton}}},methods:{infoImageFromType:function(t){return"ic-".concat(t.toLowerCase())},searchFromType:function(t){return{name:"search",query:{query:"",qf:'TYPE:"'.concat(t,'"')}}}}},_=Object(c.a)(C,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.entries&&t.entries.length>0?n("div",["items/type-counts"===t.key?n("InfoCardSection",{attrs:{section:t.contentCardSection}}):n("ContentCardSection",{attrs:{section:t.contentCardSection}})],1):t._e()}),[],!1,null,null,null);e.default=_.exports}}]);
//# sourceMappingURL=dae9c79.js.map