@europeana/portal
Version:
Europeana Portal
2 lines • 16.8 kB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[91,93],{1052:function(t,e,r){"use strict";r.r(e);r(21),r(42),r(22);var n=r(830),l={name:"InfoCard",components:{SmartLink:r(159).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(){return"".concat(this.variant,"-card")}}},o=r(40),d=r(942),c=r.n(d),component=Object(o.a)(l,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("b-card",{staticClass:"text-center info-card",class:t.cardClass,attrs:{"data-qa":"info card","no-body":""}},[r("SmartLink",{attrs:{destination:t.url,"link-class":"card-link"}},[t.image?r("div",{staticClass:"card-img"},[r("span",{class:t.image})]):t._e(),t._v(" "),r("b-card-body",{attrs:{"data-qa":"card body"}},[t.info?r("b-card-title",{attrs:{"title-tag":"div","data-qa":"card info"}},[r("span",[t._v("\n "+t._s(t.info)+"\n ")])]):t._e(),t._v(" "),r("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 c.a&&c()(component);var h={components:{InfoCard:component.exports},props:{section:{type:Object,default:()=>null}},computed:{cards(){return this.section.hasPartCollection.items.filter((t=>null!==t))},cardGroupClass(){return"items/type-counts"===this.section.type?"card-deck-3-cols":"card-deck-4-cols"},cardVariant(){return"items/type-counts"===this.section.type?"dark":"default"}}},m=Object(o.a)(h,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.section?r("section",{staticClass:"info-card-section row mb-3"},[r("div",{staticClass:"col-12"},[r("b-card-group",{class:t.cardGroupClass,attrs:{deck:"",align:"center","data-qa":"section group"}},t._l(t.cards,(function(e,n){return r("InfoCard",{key:n,attrs:{url:e.url,info:e.info,label:e.label,image:e.image,variant:t.cardVariant}})})),1),t._v(" "),t.section.moreButton?r("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",f="Item counts by media type",v={name:"AutomatedCardGroup",components:{ContentCardSection:n.default,InfoCardSection:m},props:{sectionType:{type:String,required:!0},moreButton:{type:Object,default:null}},data(){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===f&&(data.key="items/type-counts",data.cardType="InfoCard"),data},fetch(){return this.$axios.get("/_api/cache/".concat(this.key),{baseURL:window.location.origin}).then((t=>{this.entries=t.data}))},computed:{contentCardSection(){var t,e;return this.sectionType===f?{type:this.key,hasPartCollection:{items:null===(e=this.entries)||void 0===e?void 0:e.map((t=>({__typename:this.cardType,url:this.searchFromType(t.label),info:this.$i18n.n(t.count),label:this.$t("facets.TYPE.options.".concat(t.label)),image:this.infoImageFromType(t.label)})))},moreButton:this.moreButton}:{headline:this.headline,hasPartCollection:{items:null===(t=this.entries)||void 0===t?void 0:t.map((t=>({__typename:this.cardType,__variant:this.sectionType===y?null:"mini",name:t.prefLabel,identifier:t.id,image:this.$apis.entity.imageUrl(t),encoding:t,logo:!!t.logo})))},moreButton:this.moreButton}}},methods:{infoImageFromType:t=>"ic-".concat(t.toLowerCase()),searchFromType:t=>({name:"search",query:{query:"",qf:'TYPE:"'.concat(t,'"')}})}},C=Object(o.a)(v,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.entries&&t.entries.length>0?r("div",["items/type-counts"===t.key?r("InfoCardSection",{attrs:{section:t.contentCardSection}}):r("ContentCardSection",{attrs:{section:t.contentCardSection}})],1):t._e()}),[],!1,null,null,null);e.default=C.exports},641:function(t,e,r){"use strict";r.r(e);r(21),r(42),r(22),r(14),r(38),r(43),r(48),r(80),r(41),r(76);var n=r(141),l=r.n(n),o=r(159),d=r(642),c=r(24),h=r(160),m={name:"ContentCard",components:{ClientOnly:l.a,SmartLink:o.a,MediaDefaultThumbnail:()=>r.e(23).then(r.bind(null,1101))},mixins:[d.a],props:{title:{type:[String,Object],default:""},subTitle:{type:String,default:null},texts:{type:Array,default:()=>[]},hitsText:{type:Object,default:null},url:{type:[String,Object],default:""},imageUrl:{type:String,default:""},imageContentType:{type:String,default:null},imageWidth:{type:Number,default:null},imageHeight:{type:Number,default:null},imageAlt:{type:String,default:""},imageOptimisationOptions:{type:Object,default:()=>({})},lazy:{type:Boolean,default:!0},showSubtitle:{type:Boolean,default:!0},variant:{type:String,default:"default"},omitAllUris:{type:Boolean,default:!1},omitUrisIfOtherValues:{type:Boolean,default:!1},limitValuesWithinEachText:{type:Number,default:-1},blankImageHeight:{type:Number,default:null},blankImageWidth:{type:Number,default:null},logo:{type:Boolean,default:!1},mediaType:{type:String,default:null},offset:{type:Number,default:null}},data(){return{cardImageUrl:this.imageUrl,displayLabelTypes:"exhibitions|galleries|blog|collections",themes:h.a.map((t=>t.id))}},computed:{cardClass(){return"".concat(this.variant,"-card")},displayTitle(){if(this.title){if("string"==typeof this.title)return{value:this.title,code:null};var t=Object(c.h)(this.title,this.$i18n.locale);return{value:t.values[0],code:t.code}}return null},displaySubTitle(){return this.subTitle||this.displayLabel},displayLabel(){if(!this.displayLabelType)return!1;if("collections"===this.displayLabelType){var t="string"==typeof this.url?this.url.split("/").pop().split("-").shift():this.url.params.pathMatch;return this.themes.includes(t)?this.$t("cardLabels.theme"):this.$t("cardLabels.".concat(this.displayLabelTypeCollections))}return"blog"===this.displayLabelType?this.$tc("blog.posts",1):this.$tc("".concat(this.displayLabelType,".").concat(this.displayLabelType),1)},displayLabelTypeCollections(){return"object"==typeof this.url?this.url.params.type:this.url.split("/").slice(-2,-1)},displayLabelType(){return!!this.displayLabelMatch&&this.displayLabelMatch[1]},displayLabelMatch(){return"object"==typeof this.url?this.displayLabelMatchObject:this.displayLabelMatchString},displayLabelMatchObject(){return this.url.name.match(new RegExp("(".concat(this.displayLabelTypes,")")))},displayLabelMatchString(){return this.url.match(new RegExp("/(".concat(this.displayLabelTypes,")[/.]")))},displayTexts(){return this.texts.filter(Boolean).map((t=>"string"==typeof t?{values:[t],code:null}:Array.isArray(t)?{values:t,code:null}:Object(c.h)(t,this.$i18n.locale,{omitUrisIfOtherValues:this.omitUrisIfOtherValues,omitAllUris:this.omitAllUris})))},optimisedImageUrl(){return this.$options.filters.optimisedImageUrl(this.imageUrl,this.imageContentType,this.imageOptimisationOptions)}},watch:{imageUrl(){this.cardImageUrl=this.imageUrl}},methods:{cardText(t){var e=this.limitValuesWithinEachText>-1?t.slice(0,this.limitValuesWithinEachText):[].concat(t);t.length>e.length&&e.push(this.$t("formatting.ellipsis"));var r=e.join(this.$t("formatting.listSeperator")+" "),n=this.stripMarkdown(r);return this.$options.filters.truncate(n,255,this.$t("formatting.ellipsis"))},redrawMasonry(){this.$redrawVueMasonry&&this.$nextTick((()=>{this.$redrawVueMasonry()}))},imageNotFound(){this.cardImageUrl="",this.redrawMasonry()},imageLoaded(t){t.target.src.startsWith("data:")||this.redrawMasonry()}}},y=r(40),f=r(643),v=r.n(f),component=Object(y.a)(m,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("b-card",{staticClass:"text-left content-card",class:t.cardClass,attrs:{"data-qa":"content card","no-body":""}},[r("div",{staticClass:"card-wrapper"},[r("SmartLink",{attrs:{destination:t.url,"link-class":"card-link","aria-label":t.displayTitle?t.displayTitle.value:null,title:"mosaic"===t.variant&&t.displayTitle?t.displayTitle.value:null}}),t._v(" "),"mini"!==t.variant?r("MediaDefaultThumbnail",{directives:[{name:"show",rawName:"v-show",value:!t.cardImageUrl,expression:"!cardImageUrl"}],attrs:{"media-type":t.mediaType,offset:t.offset}}):t._e(),t._v(" "),t.cardImageUrl?r("div",{staticClass:"card-img",class:{logo:t.logo}},[t.lazy?r("b-img-lazy",{attrs:{src:t.optimisedImageUrl,"blank-width":t.blankImageWidth,"blank-height":t.blankImageHeight,width:t.imageWidth,height:t.imageHeight,alt:t.imageAlt},nativeOn:{error:function(e){return t.imageNotFound.apply(null,arguments)},load:function(e){return t.imageLoaded.apply(null,arguments)}}}):r("b-img",{attrs:{src:t.optimisedImageUrl,width:t.imageWidth,height:t.imageHeight,alt:t.imageAlt},on:{error:t.imageNotFound,load:t.imageLoaded}})],1):t._e(),t._v(" "),"mosaic"!==t.variant?r("b-card-body",{attrs:{"data-qa":"card body"}},[t.displaySubTitle&&"mini"!==t.variant&&t.showSubtitle?r("b-card-sub-title",{staticClass:"mt-0",attrs:{"sub-title-tag":"div","sub-title-text-variant":"default"}},[t._v("\n "+t._s(t.displaySubTitle)+"\n ")]):t._e(),t._v(" "),r("div",{staticClass:"title-texts-wrapper"},[t.displayTitle?r("b-card-title",{attrs:{"title-tag":"div","data-qa":"card title",lang:t.displayTitle.code}},[r("span",[t._v("\n "+t._s(t._f("truncate")(t.displayTitle.value,90,t.$t("formatting.ellipsis")))+"\n ")])]):t._e(),t._v(" "),t.hitsText?r("b-card-text",{attrs:{"text-tag":"div","data-qa":"highlighted search term"}},[r("p",[t._v("\n "+t._s(t.hitsText.prefix)),r("strong",{staticClass:"has-text-highlight"},[t._v(t._s(t.hitsText.exact))]),t._v(t._s(t.hitsText.suffix)+"\n ")])]):t._e(),t._v(" "),t.displayTexts.length>0?t._l(t.displayTexts,(function(text,e){return r("b-card-text",{key:e,attrs:{lang:text.code,"text-tag":"div"}},[r("p",{domProps:{innerHTML:t._s(t.cardText(text.values))}})])})):t._e()],2),t._v(" "),r("client-only",[t._t("footer")],2)],1):t._e()],1),t._v(" "),r("client-only",[t._t("image-overlay")],2)],1)}),[],!1,null,null,null);"function"==typeof v.a&&v()(component);e.default=component.exports},642:function(t,e,r){"use strict";r(80),r(14),r(41),r(21),r(22),r(28);var n=r(645);e.a={methods:{stripMarkdown(text){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[""];for(var pattern of(text=n.marked.parse(text),(t=>[/\n$/].concat(t.map((t=>new RegExp("</?".concat(t,".*?>"),"gi")))))(t)))text=text.replace(pattern,"");return text}}}},643:function(t,e){},682:function(t,e,r){var content=r(752);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,r(106).default)("3f6cbcc0",content,!0,{sourceMap:!1})},751:function(t,e,r){"use strict";r(682)},752:function(t,e,r){var n=r(105)(!1);n.push([t.i,".browse-section h2[data-v-c30fc238],.browse-section p[data-v-c30fc238]{color:#4d4d4d;text-align:left}.browse-section h2[data-v-c30fc238]{font-size:1.5rem;font-weight:600;letter-spacing:.1212rem}.browse-section p[data-v-c30fc238]{letter-spacing:.0975rem;line-height:1.5}",""]),t.exports=n},830:function(t,e,r){"use strict";r.r(e);r(14),r(48);var n=r(641),data=(r(43),r(250),r(21),r(22),r(83)),l=r(256),o=r(251),d={components:{ContentCard:n.default},props:{fields:{type:Object,default:()=>({})},cardType:{type:String,default:null},variant:{type:String,default:null}},computed:{cardFields(){return"AutomatedRecordCard"===this.cardType&&this.fields.encoding?this.fields.encoding:this.fields},title(){return"AutomatedRecordCard"===this.cardType&&this.fields.encoding?this.cardFields.dcTitleLangAware?this.cardFields.dcTitleLangAware:this.cardFields.dcDescriptionLangAware?this.cardFields.dcDescriptionLangAware:this.$t("record.record"):this.cardFields.name},imageIsContentfulAsset(){var t,e;return(null===(t=this.cardFields.image)||void 0===t||null===(e=t.url)||void 0===e?void 0:e.includes("://images.ctfassets.net/"))||!1},imageUrl(){var t="";return this.cardFields.thumbnailUrl?t=this.cardFields.thumbnailUrl:"string"==typeof this.cardFields.image?t=this.cardFields.image:this.cardFields.edmPreview?t=this.$apis.thumbnail.edmPreview(this.cardFields.edmPreview[0],{size:400}):this.cardFields.entityImage?t=this.cardFields.entityImage:this.imageIsContentfulAsset&&(t=this.cardFields.image.url),t},imageContentType(){return this.imageIsContentfulAsset?this.cardFields.image.contentType:null},imageAlt(){return this.imageIsContentfulAsset&&this.cardFields.image.description?this.cardFields.image.description:""},imageWidth(){return this.imageIsContentfulAsset?this.cardFields.image.width:null},imageHeight(){return this.imageIsContentfulAsset?this.cardFields.image.height:null},destination(){var t="";return this.fields.url?t=this.fields.url:this.forEuropeanaRecord()?t=this.recordRouterLink(this.fields.identifier):"string"==typeof this.fields.identifier&&/^https?:\/\//.test(this.fields.identifier)&&(t=this.forEuropeanaEntity()?this.entityRouterLink(this.fields.identifier,this.fields.slug):this.fields.identifier),t},texts(){var t=[];for(var e of"AutomatedRecordCard"===this.cardType?this.fields.encoding?["dcCreatorLangAware","dataProvider"]:["creator","provider"]:["description"])this.cardFields[e]&&t.push(this.cardFields[e]);return t},cardVariant(){return this.variant?this.variant:"AutomatedEntityCard"===this.cardType?"entity":"default"}},methods:{forEuropeanaRecord(){return"string"==typeof this.fields.identifier&&Object(l.b)(this.fields.identifier)},forEuropeanaEntity(){return"string"==typeof this.fields.identifier&&this.fields.identifier.includes(data.a)},entityRouterLink(t,e){var r=t.match("^".concat(data.a,"/([^/]+)/(.+)$"));return{name:"collections-type-all",params:{type:Object(o.e)(r[1]),pathMatch:e||r[2]}}},recordRouterLink:t=>({name:"item-all",params:{pathMatch:t.slice(1)}})}},c=r(40),h=Object(c.a)(d,(function(){var t=this,e=t.$createElement;return(t._self._c||e)("ContentCard",{attrs:{title:t.title,texts:t.texts,url:t.destination,"image-url":t.imageUrl,"image-content-type":t.imageContentType,"image-width":t.imageWidth,"image-height":t.imageHeight,"image-alt":t.imageAlt,variant:t.cardVariant,"omit-all-uris":!0,"image-optimisation-options":{width:510},logo:t.fields.logo}})}),[],!1,null,null,null).exports,m=r(159),y={components:{BrowseContentCard:h,ContentCard:n.default,SmartLink:m.a},props:{section:{type:Object,default:()=>null}},computed:{cards(){return this.section.hasPartCollection.items.filter((t=>!!t))},isPeopleSection(){return 4===this.cards.length&&this.cards.every((t=>{if("AutomatedEntityCard"!==t.__typename)return!1;var e=t.identifier;return!!e&&"person"===Object(o.b)(e).type}))}},methods:{entityRouterLink(t,e){var r=t.match("^".concat(data.a,"/([^/]+)/(.+)$"));return{name:"collections-type-all",params:{type:Object(o.e)(r[1]),pathMatch:e||r[2]}}}}},f=(r(751),Object(c.a)(y,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return t.section?r("section",{staticClass:"browse-section row mb-5",attrs:{"data-qa":"browse section"}},[r("div",{staticClass:"col-12 col-lg-9"},[r("h2",{attrs:{"data-qa":"section headline"}},[t._v("\n "+t._s(t.section.headline)+"\n ")]),t._v(" "),r("p",[t._v("\n "+t._s(t.section.text)+"\n ")])]),t._v(" "),r("div",{staticClass:"col-12"},[r("b-card-group",{staticClass:"card-deck-4-cols",attrs:{deck:"","data-qa":"section group"}},[t.isPeopleSection?t._l(t.cards,(function(e,n){return r("ContentCard",{key:n,attrs:{title:e.name,url:t.entityRouterLink(e.identifier,e.slug),"image-url":e.entityImage,"image-optimisation-options":{width:510},variant:"mini"}})})):t._l(t.cards,(function(t,e){return r("BrowseContentCard",{key:e,attrs:{fields:t,"card-type":t.__typename,variant:t.__variant}})}))],2),t._v(" "),t.section.moreButton?r("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,"c30fc238",null));e.default=f.exports},942:function(t,e){}}]);
//# sourceMappingURL=e35507e.modern.js.map