UNPKG

@europeana/portal

Version:
2 lines 11.3 kB
(window.webpackJsonp=window.webpackJsonp||[]).push([[87,3],{1001:function(t,e,n){"use strict";n(874)},1002:function(t,e,n){var r=n(137)(!1);r.push([t.i,".quick-search[data-v-2f2fb3a9]{border-top:1px solid #d8d8d8;padding:.75rem 0}@media(min-width: 1920px){.quick-search[data-v-2f2fb3a9]{border-top-width:.0625vw;padding:.75vw 0}}.quick-search .related-collections[data-v-2f2fb3a9]{max-width:100%}.quick-search .related-collections.container[data-v-2f2fb3a9]{padding:0}.quick-search .related-collections[data-v-2f2fb3a9] .badge-pill{margin-right:.5rem;margin-bottom:.5rem;flex-shrink:0}@media(min-width: 1920px){.quick-search .related-collections[data-v-2f2fb3a9] .badge-pill{margin-right:.5vw;margin-bottom:.5vw}}.quick-search .related-collections[data-v-2f2fb3a9] .badges-wrapper{margin-top:1rem;padding:0 15px;-ms-overflow-style:none;scrollbar-width:none}@media(min-width: 1920px){.quick-search .related-collections[data-v-2f2fb3a9] .badges-wrapper{margin-top:1vw;padding:0 1vw}}.quick-search .related-collections[data-v-2f2fb3a9] .badges-wrapper::-webkit-scrollbar{display:none}.quick-search[data-v-2f2fb3a9] .related-heading{font-size:.75rem;padding:0 15px;text-align:left}@media(min-width: 1920px){.quick-search[data-v-2f2fb3a9] .related-heading{font-size:.75vw;padding:0 1vw}}",""]),t.exports=r},1003:function(t,e){},1185:function(t,e,n){"use strict";n.r(e);var r=n(23),l=(n(30),n(315),n(41),n(10),n(46),n(75),n(742)),c=n(760),o=n(31),d={name:"QuickSearch",components:{RelatedCollections:l.default},mixins:[c.a],props:{options:{type:Array,default:function(){return[]}}},fetch:function(){var t=this;return Object(r.a)(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.fetchAllThemes();case 2:case"end":return e.stop()}}),e)})))()},computed:{optionsAndThemes:function(){return this.options.concat(this.alphabeticallySortedThemes)},alphabeticallySortedThemes:function(){var t=this;return this.allThemes.slice(0).sort((function(a,b){return Object(o.h)(a.prefLabel,t.$i18n.locale).values[0].localeCompare(Object(o.h)(b.prefLabel,t.$i18n.locale).values[0])}))}}},f=(n(1001),n(59)),m=n(1003),h=n.n(m),component=Object(f.a)(d,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return t.optionsAndThemes.length?n("div",{staticClass:"quick-search",attrs:{"data-qa":"quick-search"}},[n("RelatedCollections",{attrs:{title:t.$t("header.quickSearch"),"related-collections":t.optionsAndThemes}})],1):t._e()}),[],!1,null,"2f2fb3a9",null);"function"==typeof h.a&&h()(component);e.default=component.exports},714:function(t,e,n){"use strict";n.d(e,"d",(function(){return r})),n.d(e,"a",(function(){return l})),n.d(e,"c",(function(){return c})),n.d(e,"b",(function(){return o}));n(10),n(43),n(46),n(177),n(112),n(60),n(50),n(30),n(316);function r(t){return"images.ctfassets.net"===new URL(t).host}function l(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null==t||!t.url)return null;var n=new URL(t.url);for(var r in"image/jpeg"===t.contentType&&(e.fm="jpg",e.fl="progressive",e.q||(e.q=80)),e)n.searchParams.set(r,e[r]);return n.toString()}function c(image,t){return null!=image&&image.url&&r(image.url)&&t?["".concat(l(image,t.small)," ").concat(t.small.w,"w"),"".concat(l(image,t.medium)," ").concat(t.medium.w,"w"),"".concat(l(image,t.large)," ").concat(t.large.w,"w"),"".concat(l(image,t.xl)," ").concat(t.xl.w,"w"),"".concat(l(image,t.xxl)," ").concat(t.xxl.w,"w"),"".concat(l(image,t.xxxl)," ").concat(t.xxxl.w,"w"),"".concat(l(image,t.wqhd)," ").concat(t.wqhd.w,"w"),"".concat(l(image,t["4k"])," ").concat(t["4k"].w,"w")].join(","):null!=image&&image.url?image.url:null}function o(image,t){return image.url&&r(image.url)&&t?{"--bg-img-small":"url('".concat(l(image,t.small),"')"),"--bg-img-medium":"url('".concat(l(image,t.medium),"')"),"--bg-img-large":"url('".concat(l(image,t.large),"')"),"--bg-img-xl":"url('".concat(l(image,t.xl),"')"),"--bg-img-xxl":"url('".concat(l(image,t.xxl),"')"),"--bg-img-xxxl":"url('".concat(l(image,t.xxxl),"')"),"--bg-img-wqhd":"url('".concat(l(image,t.wqhd),"')"),"--bg-img-4k":"url('".concat(l(image,t["4k"]),"')")}:image.url?{"--bg-img-small":"url('".concat(image.url,"')")}:null}},726:function(t,e,n){"use strict";var r=n(2),l=(n(80),n(10),n(16),"en");e.a={methods:{isNamedOrganizationEntity:function(t){return"Organization"===(null==t?void 0:t.type)&&!!t.prefLabel},organizationEntityNativeName:function(t){if(!this.isNamedOrganizationEntity(t))return null;var e=Object.keys(t.prefLabel).find((function(t){return t!==l}))||l;return Object(r.a)({},e,t.prefLabel[e])},organizationEntityNonNativeEnglishName:function(t){return!this.isNamedOrganizationEntity(t)||Object.keys(t.prefLabel).length<2?null:Object(r.a)({},l,t.prefLabel.en)}}}},731:function(t,e,n){"use strict";n(21),n(67);var r=n(314),l=n(31),c=n(109);e.a={methods:{collectionLinkGen:function(t){var e,n=null===(e=t.id)||void 0===e?void 0:e.match("^".concat(c.a,"/([^/]+)/(.+)$"));return n?this.$path({name:"collections-type-all",params:{type:Object(r.e)(n[1]),pathMatch:Object(l.f)(t.id,t.prefLabel.en)}}):null}}}},732:function(t,e,n){"use strict";var r=n(31),l={name:"LinkBadge",props:{linkTo:{type:[String,Object],default:null},title:{type:[String,Object],required:!0},id:{type:String,default:""},img:{type:String,default:""},type:{type:String,default:""},badgeVariant:{type:String,default:"secondary"},clickEventHandler:{type:Function,default:null},imageSrcSet:{type:String,default:null}},data:function(){return{imageUrl:this.img}},computed:{localisedTitle:function(){return"string"==typeof this.title?{values:[this.title],code:null}:Object(r.h)(this.title,this.$i18n.locale)}},methods:{handleClickEvent:function(){this.clickEventHandler?this.clickEventHandler():this.$matomo&&this.$matomo.trackEvent("Related_collections","Click related collection",this.linkTo)},imageNotFound:function(){this.imageUrl=""}}},c=n(59),component=Object(c.a)(l,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-badge",{class:{"img-chip":t.imageUrl},attrs:{to:t.$link.to(t.linkTo),href:t.$link.href(t.linkTo),pill:"",variant:t.badgeVariant,"data-qa":t.localisedTitle.values[0]+" related chip",lang:t.localisedTitle.code},nativeOn:{click:function(e){return t.handleClickEvent.apply(null,arguments)}}},[t.imageUrl&&"Organization"===t.type?n("div",{staticClass:"organisation-logo mr-2",style:"background-image: url("+t.imageUrl+")",attrs:{"data-qa":"entity logo"}}):t.imageUrl?n("b-img",{staticClass:"mr-2",attrs:{src:t.imageUrl,srcset:t.imageSrcSet,sizes:"(max-width 1920px) 28w,\n (max-width 2560) 45w,\n (min-width 2561) 67w",alt:"",rounded:"circle"},on:{error:t.imageNotFound}}):t._e(),t._v(" "),n("span",[t._v(t._s(t.localisedTitle.values[0]))]),t._v(" "),t._t("default")],2)}),[],!1,null,null,null);e.a=component.exports},742:function(t,e,n){"use strict";n.r(e);var r=n(23),l=(n(75),n(80),n(10),n(47),n(34),n(30),n(181)),c=n.n(l),o=n(714),d=n(204),f=n(731),m=n(726),h={name:"RelatedCollections",components:{LinkBadge:n(732).a},mixins:[f.a,m.a],props:{title:{type:String,default:""},relatedCollections:{type:Array,default:function(){return[]}},entityUris:{type:Array,default:function(){return[]}},badgeVariant:{type:String,default:"secondary"},wrap:{type:Boolean,default:!0}},data:function(){return{collections:this.relatedCollections}},fetch:function(){var t=this;return Object(r.a)(regeneratorRuntime.mark((function e(){var n,r,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(0===((null===(n=t.entityUris)||void 0===n?void 0:n.length)||0)||((null===(r=t.relatedCollections)||void 0===r?void 0:r.length)||0)>0)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,t.$apis.entity.find(t.entityUris);case 4:return l=(l=e.sent).map((function(t){return c()(t,["id","prefLabel","isShownBy","logo","type"])})),e.next=8,Object(d.b)(t,l);case 8:t.collections=e.sent;case 9:case"end":return e.stop()}}),e)})))()},mounted:function(){this.draw()},updated:function(){this.draw()},beforeDestroy:function(){this.draw("hide")},methods:{draw:function(t){var e=this;this.$emit(t||(this.collections.length>0?"show":"hide")),this.$nextTick((function(){e.$redrawVueMasonry&&e.$redrawVueMasonry()}))},collectionTitle:function(t){var e=this.organizationEntityNativeName(t);return e||(t.prefLabel?t.prefLabel:t.name)},imageUrl:function(t){return t.contentfulImage&&Object(o.d)(t.contentfulImage.url)?Object(o.a)(t.contentfulImage,{w:28,h:28,fit:"thumb"}):this.$apis.entity.imageUrl(t)},imageSrcSet:function(t){if(t.contentfulImage&&Object(o.d)(t.contentfulImage.url)){var e=Object(o.a)(t.contentfulImage,{w:28,h:28,fit:"thumb"}),n=Object(o.a)(t.contentfulImage,{w:45,h:45,fit:"thumb"}),r=Object(o.a)(t.contentfulImage,{w:67,h:67,fit:"thumb"});return"".concat(e," 28w, ").concat(n," 45w, ").concat(r," 67w")}return null}}},v=n(59),component=Object(v.a)(h,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("b-container",{directives:[{name:"show",rawName:"v-show",value:t.collections.length>0,expression:"collections.length > 0"}],staticClass:"related-collections",attrs:{"data-qa":"related collections"}},[n("h2",{staticClass:"related-heading text-uppercase mb-2"},[t._v("\n "+t._s(t.title)+"\n ")]),t._v(" "),n("div",{staticClass:"badges-wrapper d-flex",class:{"flex-wrap":t.wrap}},t._l(t.collections,(function(e){return n("LinkBadge",{key:e.id,ref:"options",refInFor:!0,attrs:{id:e.id,"link-to":t.collectionLinkGen(e),title:t.collectionTitle(e),img:t.imageUrl(e),type:e.type,"badge-variant":t.badgeVariant,"image-src-set":t.imageSrcSet(e)}})})),1)])}),[],!1,null,null,null);e.default=component.exports},760:function(t,e,n){"use strict";n(16),n(15),n(13),n(10),n(19),n(14),n(20);var r=n(23),l=n(2),c=(n(75),n(21),n(81),n(47),n(108)),o=n(314),d=n(204);function f(object,t){var e=Object.keys(object);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(object);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(object,t).enumerable}))),e.push.apply(e,n)}return e}e.a={computed:function(t){for(var i=1;i<arguments.length;i++){var source=null!=arguments[i]?arguments[i]:{};i%2?f(Object(source),!0).forEach((function(e){Object(l.a)(t,e,source[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(source)):f(Object(source)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(source,e))}))}return t}({},Object(c.c)({allThemes:function(t){return t.search.allThemes}})),methods:{fetchAllThemes:function(){var t=this;return Object(r.a)(regeneratorRuntime.mark((function e(){var n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t.allThemes.length){e.next=5;break}return e.next=3,Object(d.b)(t,d.a.map((function(t){return{id:Object(o.f)("topic",t.id)}})));case 3:n=e.sent,t.$store.commit("search/set",["allThemes",n]);case 5:case"end":return e.stop()}}),e)})))()}}}},874:function(t,e,n){var content=n(1002);content.__esModule&&(content=content.default),"string"==typeof content&&(content=[[t.i,content,""]]),content.locals&&(t.exports=content.locals);(0,n(138).default)("371def8a",content,!0,{sourceMap:!1})}}]); //# sourceMappingURL=6ad60e3.js.map