UNPKG

@europeana/portal

Version:
2 lines 11.4 kB
(window.webpackJsonp=window.webpackJsonp||[]).push([[93],{1009:function(t,e,n){"use strict";n(877)},1010:function(t,e,n){var r=n(137)(!1);r.push([t.i,".latest-section h2[data-v-0e30d20d]{color:#4d4d4d;font-size:1.5rem;font-weight:600;letter-spacing:.1212rem;text-align:left}",""]),t.exports=r},1174:function(t,e,n){"use strict";n.r(e);var r=n(2),l=(n(250),n(30),n(34),n(15),n(64),{components:{ContentCard:n(711).default},props:{category:{type:String,required:!0},cards:{type:Array,default:function(){return[]}},total:{type:Number,default:0}},computed:{contentType:function(){var t={};return this.forExhibitions?t={type:"exhibitionPage",name:this.$tc("exhibitions.exhibitions",this.total),path:"exhibitions"}:this.forGalleries?t={type:"imageGallery",name:this.$tc("galleries.galleries",this.total),path:"galleries"}:this.forBlogPosts&&(t={type:"blogPosting",name:this.$tc("blog.posts",this.total),path:"blog"}),t},forGalleries:function(){return"Galleries"===this.category},forExhibitions:function(){return"Exhibitions"===this.category},forBlogPosts:function(){return"Blog posts"===this.category},showMoreLink:function(){return"".concat(this.$tc("showMore")," ").concat(this.contentType.name.toLowerCase()," (").concat(this.total,")")}},methods:{cardData:function(t){return this.forExhibitions?this.defaultCardData(t,"exhibitions-exhibition"):this.forGalleries?this.galleryCardData(t):this.forBlogPosts?this.defaultCardData(t,"blog-all"):null},defaultCardData:function(t,e){var n,l,o,c,d="exhibitions-exhibition"===e?"exhibition":"pathMatch";return{cardLink:{name:e,params:Object(r.a)({},d,t.identifier)},description:t.description?t.description:"",imageUrl:null===(n=t.primaryImageOfPage)||void 0===n||null===(l=n.image)||void 0===l?void 0:l.url,imageContentType:null===(o=t.primaryImageOfPage)||void 0===o||null===(c=o.image)||void 0===c?void 0:c.contentType}},galleryCardData:function(t){var e,n,r=(null===(e=t.hasPartCollection.items[0].encoding)||void 0===e||null===(n=e.edmPreview)||void 0===n?void 0:n[0])||t.hasPartCollection.items[0].thumbnailUrl;return{cardLink:{name:"galleries-all",params:{pathMatch:t.identifier}},imageUrl:this.$apis.thumbnail.edmPreview(r,{size:400})}}}}),o=(n(1009),n(59)),component=Object(o.a)(l,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("section",{staticClass:"latest-section row mb-5"},[n("div",{staticClass:"col-12"},[n("h2",[t._v("\n "+t._s(t.contentType.name)+"\n ")]),t._v(" "),n("b-card-group",{staticClass:"card-deck-4-cols",attrs:{deck:"","data-qa":"latest "+t.contentType.name}},t._l(t.cards,(function(e){return n("ContentCard",{key:e.identifier,attrs:{title:e.name,texts:[e.description],url:t.cardData(e).cardLink,"image-url":t.cardData(e).imageUrl,"image-content-type":t.cardData(e).imageContentType,"image-optimisation-options":{width:510},"image-alt":t.cardData(e).description}})})),1),t._v(" "),t.total>4?n("b-button",{attrs:{variant:"light",to:t.localePath({name:t.contentType.path})}},[t._v("\n "+t._s(t.showMoreLink)+"\n ")]):t._e()],1)])}),[],!1,null,"0e30d20d",null);e.default=component.exports},711:function(t,e,n){"use strict";n.r(e);var r=n(44),l=(n(10),n(43),n(46),n(250),n(47),n(21),n(52),n(58),n(62),n(30),n(41),n(67),n(34),n(107),n(60),n(13),n(50),n(104),n(176)),o=n.n(l),c=n(203),d=n(712),h=n(31),f=n(204),m={name:"ContentCard",components:{ClientOnly:o.a,SmartLink:c.a,MediaDefaultThumbnail:function(){return n.e(24).then(n.bind(null,1172))}},mixins:[d.a],props:{title:{type:[String,Object],default:""},subTitle:{type:String,default:null},texts:{type:Array,default:function(){return[]}},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:function(){return{}}},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:function(){return{cardImageUrl:this.imageUrl,displayLabelTypes:"exhibitions|galleries|blog|collections",themes:f.a.map((function(t){return t.id}))}},computed:{cardClass:function(){return"".concat(this.variant,"-card")},displayTitle:function(){if(this.title){if("string"==typeof this.title)return{value:this.title,code:null};var t=Object(h.h)(this.title,this.$i18n.locale);return{value:t.values[0],code:t.code}}return null},displaySubTitle:function(){return this.subTitle||this.displayLabel},displayLabel:function(){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:function(){return"object"===Object(r.a)(this.url)?this.url.params.type:this.url.split("/").slice(-2,-1)},displayLabelType:function(){return!!this.displayLabelMatch&&this.displayLabelMatch[1]},displayLabelMatch:function(){return"object"===Object(r.a)(this.url)?this.displayLabelMatchObject:this.displayLabelMatchString},displayLabelMatchObject:function(){return this.url.name.match(new RegExp("(".concat(this.displayLabelTypes,")")))},displayLabelMatchString:function(){return this.url.match(new RegExp("/(".concat(this.displayLabelTypes,")[/.]")))},displayTexts:function(){var t=this;return this.texts.filter(Boolean).map((function(e){return"string"==typeof e?{values:[e],code:null}:Array.isArray(e)?{values:e,code:null}:Object(h.h)(e,t.$i18n.locale,{omitUrisIfOtherValues:t.omitUrisIfOtherValues,omitAllUris:t.omitAllUris})}))},optimisedImageUrl:function(){return this.$options.filters.optimisedImageUrl(this.imageUrl,this.imageContentType,this.imageOptimisationOptions)}},watch:{imageUrl:function(){this.cardImageUrl=this.imageUrl}},methods:{cardText:function(t){var e=this.limitValuesWithinEachText>-1?t.slice(0,this.limitValuesWithinEachText):[].concat(t);t.length>e.length&&e.push(this.$t("formatting.ellipsis"));var n=e.join(this.$t("formatting.listSeperator")+" "),r=this.stripMarkdown(n);return this.$options.filters.truncate(r,255,this.$t("formatting.ellipsis"))},redrawMasonry:function(){var t=this;this.$redrawVueMasonry&&this.$nextTick((function(){t.$redrawVueMasonry()}))},imageNotFound:function(){this.cardImageUrl="",this.redrawMasonry()},imageLoaded:function(t){t.target.src.startsWith("data:")||this.redrawMasonry()}}},y=n(59),v=n(715),T=n.n(v),component=Object(y.a)(m,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-card",{staticClass:"text-left content-card",class:t.cardClass,attrs:{"data-qa":"content card","no-body":""}},[n("div",{staticClass:"card-wrapper"},[n("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?n("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?n("div",{staticClass:"card-img",class:{logo:t.logo}},[t.lazy?n("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)}}}):n("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?n("b-card-body",{attrs:{"data-qa":"card body"}},[t.displaySubTitle&&"mini"!==t.variant&&t.showSubtitle?n("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(" "),n("div",{staticClass:"title-texts-wrapper"},[t.displayTitle?n("b-card-title",{attrs:{"title-tag":"div","data-qa":"card title",lang:t.displayTitle.code}},[n("span",[t._v("\n "+t._s(t._f("truncate")(t.displayTitle.value,90,t.$t("formatting.ellipsis")))+"\n ")])]):t._e(),t._v(" "),t.hitsText?n("b-card-text",{attrs:{"text-tag":"div","data-qa":"highlighted search term"}},[n("p",[t._v("\n "+t._s(t.hitsText.prefix)),n("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 n("b-card-text",{key:e,attrs:{lang:text.code,"text-tag":"div"}},[n("p",{domProps:{innerHTML:t._s(t.cardText(text.values))}})])})):t._e()],2),t._v(" "),n("client-only",[t._t("footer")],2)],1):t._e()],1),t._v(" "),n("client-only",[t._t("image-overlay")],2)],1)}),[],!1,null,null,null);"function"==typeof T.a&&T()(component);e.default=component.exports},712:function(t,e,n){"use strict";n(30),n(47),n(107),n(21),n(60),n(37),n(41),n(10),n(34),n(68),n(43),n(15),n(64),n(71),n(46);var r=n(717);function l(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0,r=function(){};return{s:r,n:function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,c=!0,d=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return c=t.done,t},e:function(t){d=!0,l=t},f:function(){try{c||null==n.return||n.return()}finally{if(d)throw l}}}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var c=function(t){return[/\n$/].concat(t.map((function(t){return new RegExp("</?".concat(t,".*?>"),"gi")})))};e.a={methods:{stripMarkdown:function(text){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[""];text=r.marked.parse(text);var e,n=l(c(t));try{for(n.s();!(e=n.n()).done;){var pattern=e.value;text=text.replace(pattern,"")}}catch(t){n.e(t)}finally{n.f()}return text}}}},715:function(t,e){},877:function(t,e,n){var content=n(1010);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(138).default)("603076ec",content,!0,{sourceMap:!1})}}]); //# sourceMappingURL=0bd4403.js.map