@europeana/portal
Version:
Europeana Portal
1,200 lines (992 loc) • 34.5 kB
JavaScript
exports.ids = [78,14];
exports.modules = {
/***/ 198:
/***/ (function(module, exports, __webpack_require__) {
// style-loader: Adds some css to the DOM by adding a <style> tag
// load the styles
var content = __webpack_require__(202);
if(content.__esModule) content = content.default;
if(typeof content === 'string') content = [[module.i, content, '']];
if(content.locals) module.exports = content.locals;
// add CSS to SSR context
var add = __webpack_require__(13).default
module.exports.__inject__ = function (context) {
add("688b9c6f", content, true, context)
};
/***/ }),
/***/ 200:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/components/sharing/SocialShare.vue?vue&type=template&id=a553b8a4&scoped=true&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',_vm._l((_vm.networks),function(network,index){return _c('b-link',{key:index,class:("social-share mr-1 " + (network.identifier)),attrs:{"title":_vm.$t('actions.shareOn', { social: network.name }),"href":network.url,"data-qa":("share " + (network.identifier) + " button")},nativeOn:{"click":function($event){_vm.$matomo && _vm.$matomo.trackEvent('Item_share', 'Click social share button', network.url);}}},[_c('span',{class:("icon-" + (network.identifier))}),_vm._v(" "),(_vm.withText)?_c('span',{staticClass:"text"},[_vm._v(_vm._s(network.name)+"\n ")]):_vm._e()])}),1)}
var staticRenderFns = []
// CONCATENATED MODULE: ./src/components/sharing/SocialShare.vue?vue&type=template&id=a553b8a4&scoped=true&
// EXTERNAL MODULE: external "vuex"
var external_vuex_ = __webpack_require__(8);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/sharing/SocialShare.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var SocialSharevue_type_script_lang_js_ = ({
name: 'SocialShare',
props: {
mediaUrl: {
type: String,
default: ''
},
withText: {
type: Boolean,
default: false
}
},
computed: { ...Object(external_vuex_["mapGetters"])({
shareUrl: 'http/canonicalUrlWithoutLocale'
}),
networks() {
return [{
identifier: 'facebook',
name: 'Facebook',
url: `https://www.facebook.com/sharer/sharer.php?display=page&u=${this.shareUrl}`
}, {
identifier: 'twitter',
name: 'Twitter',
url: `https://twitter.com/intent/tweet?text=${this.shareUrl}`
}, {
identifier: 'pinterest',
name: 'Pinterest',
url: `https://pinterest.com/pin/create/link/?url=${this.shareUrl}` + (this.mediaUrl ? `&media=${this.mediaUrl}` : '')
}];
}
}
});
// CONCATENATED MODULE: ./src/components/sharing/SocialShare.vue?vue&type=script&lang=js&
/* harmony default export */ var sharing_SocialSharevue_type_script_lang_js_ = (SocialSharevue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(3);
// CONCATENATED MODULE: ./src/components/sharing/SocialShare.vue
function injectStyles (context) {
var style0 = __webpack_require__(201)
if (style0.__inject__) style0.__inject__(context)
}
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
sharing_SocialSharevue_type_script_lang_js_,
render,
staticRenderFns,
false,
injectStyles,
"a553b8a4",
"c7505654"
)
/* harmony default export */ var SocialShare = __webpack_exports__["a"] = (component.exports);
/***/ }),
/***/ 201:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_vue_loader_lib_index_js_vue_loader_options_SocialShare_vue_vue_type_style_index_0_id_a553b8a4_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(198);
/* harmony import */ var _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_vue_loader_lib_index_js_vue_loader_options_SocialShare_vue_vue_type_style_index_0_id_a553b8a4_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_vue_loader_lib_index_js_vue_loader_options_SocialShare_vue_vue_type_style_index_0_id_a553b8a4_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_vue_loader_lib_index_js_vue_loader_options_SocialShare_vue_vue_type_style_index_0_id_a553b8a4_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_vue_style_loader_index_js_ref_7_oneOf_1_0_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_vue_loader_lib_index_js_vue_loader_options_SocialShare_vue_vue_type_style_index_0_id_a553b8a4_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
/***/ }),
/***/ 202:
/***/ (function(module, exports, __webpack_require__) {
// Imports
var ___CSS_LOADER_API_IMPORT___ = __webpack_require__(12);
var ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(false);
// Module
___CSS_LOADER_EXPORT___.push([module.i, "a[data-v-a553b8a4]{align-items:center;background:transparent;border:1px solid #1a1a1a;border-radius:50%;color:#1a1a1a;display:inline-flex;height:calc(2.5rem - 1px);justify-content:center;text-decoration:none;transition:background .25s;width:calc(2.5rem - 1px)}a [class^=icon][data-v-a553b8a4]{color:#1a1a1a;font-size:1.25rem}a[data-v-a553b8a4]:hover{background:#1a1a1a}a:hover [class^=icon][data-v-a553b8a4]{color:#fff}", ""]);
// Exports
module.exports = ___CSS_LOADER_EXPORT___;
/***/ }),
/***/ 203:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/ContentCard.vue?vue&type=template&id=28c51dc4&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-card',{staticClass:"text-left content-card",class:_vm.cardClass,attrs:{"data-qa":"content card","no-body":""}},[_c('div',{staticClass:"card-wrapper"},[_c('SmartLink',{attrs:{"destination":_vm.url,"link-class":"card-link","aria-label":_vm.displayTitle ? _vm.displayTitle.value : null,"title":(_vm.variant === 'mosaic' && _vm.displayTitle) ? _vm.displayTitle.value : null}}),_vm._v(" "),(_vm.variant !== 'mini')?_c('MediaDefaultThumbnail',{directives:[{name:"show",rawName:"v-show",value:(!_vm.cardImageUrl),expression:"!cardImageUrl"}],attrs:{"media-type":_vm.mediaType,"offset":_vm.offset}}):_vm._e(),_vm._v(" "),(_vm.cardImageUrl)?_c('div',{staticClass:"card-img",class:{ logo: _vm.logo }},[(_vm.lazy)?_c('b-img-lazy',{attrs:{"src":_vm.optimisedImageUrl,"blank-width":_vm.blankImageWidth,"blank-height":_vm.blankImageHeight,"width":_vm.imageWidth,"height":_vm.imageHeight,"alt":_vm.imageAlt},nativeOn:{"error":function($event){return _vm.imageNotFound.apply(null, arguments)},"load":function($event){return _vm.imageLoaded.apply(null, arguments)}}}):_c('b-img',{attrs:{"src":_vm.optimisedImageUrl,"width":_vm.imageWidth,"height":_vm.imageHeight,"alt":_vm.imageAlt},on:{"error":_vm.imageNotFound,"load":_vm.imageLoaded}})],1):_vm._e(),_vm._v(" "),(_vm.variant !== 'mosaic')?_c('b-card-body',{attrs:{"data-qa":"card body"}},[((_vm.displaySubTitle && _vm.variant !== 'mini') && _vm.showSubtitle)?_c('b-card-sub-title',{staticClass:"mt-0",attrs:{"sub-title-tag":"div","sub-title-text-variant":"default"}},[_vm._v("\n "+_vm._s(_vm.displaySubTitle)+"\n ")]):_vm._e(),_vm._v(" "),_c('div',{staticClass:"title-texts-wrapper"},[(_vm.displayTitle)?_c('b-card-title',{attrs:{"title-tag":"div","data-qa":"card title","lang":_vm.displayTitle.code}},[_c('span',[_vm._v("\n "+_vm._s(_vm._f("truncate")(_vm.displayTitle.value,90, _vm.$t('formatting.ellipsis')))+"\n ")])]):_vm._e(),_vm._v(" "),(_vm.hitsText)?_c('b-card-text',{attrs:{"text-tag":"div","data-qa":"highlighted search term"}},[_c('p',[_vm._v("\n "+_vm._s(_vm.hitsText.prefix)),_c('strong',{staticClass:"has-text-highlight"},[_vm._v(_vm._s(_vm.hitsText.exact))]),_vm._v(_vm._s(_vm.hitsText.suffix)+"\n ")])]):_vm._e(),_vm._v(" "),(_vm.displayTexts.length > 0)?_vm._l((_vm.displayTexts),function(text,index){return _c('b-card-text',{key:index,attrs:{"lang":text.code,"text-tag":"div"}},[_c('p',{domProps:{"innerHTML":_vm._s(_vm.cardText(text.values))}})])}):_vm._e()],2),_vm._v(" "),_c('client-only',[_vm._t("footer")],2)],1):_vm._e()],1),_vm._v(" "),_c('client-only',[_vm._t("image-overlay")],2)],1)}
var staticRenderFns = []
// CONCATENATED MODULE: ./src/components/generic/ContentCard.vue?vue&type=template&id=28c51dc4&
// EXTERNAL MODULE: external "vue-client-only"
var external_vue_client_only_ = __webpack_require__(20);
var external_vue_client_only_default = /*#__PURE__*/__webpack_require__.n(external_vue_client_only_);
// EXTERNAL MODULE: ./src/components/generic/SmartLink.vue + 3 modules
var SmartLink = __webpack_require__(26);
// EXTERNAL MODULE: ./src/mixins/stripMarkdown.js
var stripMarkdown = __webpack_require__(204);
// EXTERNAL MODULE: ./src/plugins/europeana/utils.js
var utils = __webpack_require__(2);
// EXTERNAL MODULE: ./src/plugins/europeana/themes.js
var themes = __webpack_require__(27);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/ContentCard.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var ContentCardvue_type_script_lang_js_ = ({
name: 'ContentCard',
components: {
ClientOnly: external_vue_client_only_default.a,
SmartLink: SmartLink["a" /* default */],
MediaDefaultThumbnail: () => __webpack_require__.e(/* import() */ 15).then(__webpack_require__.bind(null, 578))
},
mixins: [stripMarkdown["a" /* default */]],
props: {
/**
* Card title
*
* If an object is supplied, it is expected to be a LangMap.
*/
title: {
type: [String, Object],
default: ''
},
/**
* Card subtitle
*/
subTitle: {
type: String,
default: null
},
/**
* Card texts
*
* Each element may be a string, an array of strings, or a LangMap
*/
texts: {
type: Array,
default: () => []
},
/**
* Hits from a search to highlight in the card texts
*/
hitsText: {
type: Object,
default: null
},
/**
* URL for the card to link to
*
* An object should be a Vue route
*/
url: {
type: [String, Object],
default: ''
},
/**
* URL of an image to display
*/
imageUrl: {
type: String,
default: ''
},
/**
* Content type of the image
*/
imageContentType: {
type: String,
default: null
},
/**
* Width of the image
*/
imageWidth: {
type: Number,
default: null
},
/**
* Height of the image
*/
imageHeight: {
type: Number,
default: null
},
/**
* Image alt text
*/
imageAlt: {
type: String,
default: ''
},
/**
* Image optimisation options
*
* Passed to `optimisedImageUrl` filter
*/
imageOptimisationOptions: {
type: Object,
default: () => ({})
},
/**
* If `true`, image will be lazy-loaded
*/
lazy: {
type: Boolean,
default: true
},
/**
* If `true`, subtitle will be shown
*/
showSubtitle: {
type: Boolean,
default: true
},
/**
* Style variant to use
* @values default, entity, mini, list, mosaic
*/
variant: {
type: String,
default: 'default'
},
/**
* If `true`, will omit all URIs from texts
*/
omitAllUris: {
type: Boolean,
default: false
},
/**
* If `true`, will omit URIs from texts only if other values are present
*/
omitUrisIfOtherValues: {
type: Boolean,
default: false
},
/**
* For each element of `texts`, limit the number of values shown
*
* Default is no limit
*/
limitValuesWithinEachText: {
type: Number,
default: -1
},
/**
* Height of image placeholder when lazy-loading image
*/
blankImageHeight: {
type: Number,
default: null
},
/**
* Width of image placeholder when lazy-loading image
*/
blankImageWidth: {
type: Number,
default: null
},
/**
* If `true`, the image is a logo and will be styled differently
*/
logo: {
type: Boolean,
default: false
},
/**
* Type of media
*/
mediaType: {
type: String,
default: null
},
/**
* Offset, used for random color picking
*/
offset: {
type: Number,
default: null
}
},
data() {
return {
cardImageUrl: this.imageUrl,
displayLabelTypes: 'exhibitions|galleries|blog|collections',
themes: themes["a" /* default */].map(theme => theme.id)
};
},
computed: {
cardClass() {
return `${this.variant}-card`;
},
displayTitle() {
if (!this.title) {
return null;
} else if (typeof this.title === 'string') {
return {
value: this.title,
code: null
};
} else {
const langMapValue = Object(utils["h" /* langMapValueForLocale */])(this.title, this.$i18n.locale);
return {
value: langMapValue.values[0],
code: langMapValue.code
};
}
},
displaySubTitle() {
return this.subTitle || this.displayLabel;
},
displayLabel() {
if (!this.displayLabelType) {
return false;
}
if (this.displayLabelType === 'collections') {
const entityId = typeof this.url === 'string' ? this.url.split('/').pop().split('-').shift() : this.url.params.pathMatch; // TODO: remove when thematic collections topics get their own 'theme' type
return this.themes.includes(entityId) ? this.$t('cardLabels.theme') : this.$t(`cardLabels.${this.displayLabelTypeCollections}`);
}
if (this.displayLabelType === 'blog') {
return this.$tc('blog.posts', 1);
}
return this.$tc(`${this.displayLabelType}.${this.displayLabelType}`, 1);
},
displayLabelTypeCollections() {
return typeof this.url === 'object' ? this.url.params.type : this.url.split('/').slice(-2, -1);
},
displayLabelType() {
return this.displayLabelMatch ? this.displayLabelMatch[1] : false;
},
displayLabelMatch() {
return typeof this.url === 'object' ? this.displayLabelMatchObject : this.displayLabelMatchString;
},
displayLabelMatchObject() {
return this.url.name.match(new RegExp(`(${this.displayLabelTypes})`));
},
displayLabelMatchString() {
return this.url.match(new RegExp(`/(${this.displayLabelTypes})[/.]`));
},
displayTexts() {
return this.texts.filter(Boolean).map(value => {
if (typeof value === 'string') {
return {
values: [value],
code: null
};
} else if (Array.isArray(value)) {
return {
values: value,
code: null
};
} else {
return Object(utils["h" /* langMapValueForLocale */])(value, 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(values) {
const limited = this.limitValuesWithinEachText > -1 ? values.slice(0, this.limitValuesWithinEachText) : [].concat(values);
if (values.length > limited.length) {
limited.push(this.$t('formatting.ellipsis'));
}
const joined = limited.join(this.$t('formatting.listSeperator') + ' ');
const stripped = this.stripMarkdown(joined);
return this.$options.filters.truncate(stripped, 255, this.$t('formatting.ellipsis'));
},
redrawMasonry() {
if (this.$redrawVueMasonry) {
this.$nextTick(() => {
this.$redrawVueMasonry();
});
}
},
imageNotFound() {
this.cardImageUrl = '';
this.redrawMasonry();
},
imageLoaded(event) {
// ignore b-img-lazy's blank placeholder images
if (!event.target.src.startsWith('data:')) {
this.redrawMasonry();
}
}
}
});
// CONCATENATED MODULE: ./src/components/generic/ContentCard.vue?vue&type=script&lang=js&
/* harmony default export */ var generic_ContentCardvue_type_script_lang_js_ = (ContentCardvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(3);
// EXTERNAL MODULE: ./src/components/generic/ContentCard.vue?vue&type=custom&index=0&blockType=docs&lang=md
var ContentCardvue_type_custom_index_0_blockType_docs_lang_md = __webpack_require__(205);
var ContentCardvue_type_custom_index_0_blockType_docs_lang_md_default = /*#__PURE__*/__webpack_require__.n(ContentCardvue_type_custom_index_0_blockType_docs_lang_md);
// CONCATENATED MODULE: ./src/components/generic/ContentCard.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
generic_ContentCardvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
"473081f0"
)
/* custom blocks */
if (typeof ContentCardvue_type_custom_index_0_blockType_docs_lang_md_default.a === 'function') ContentCardvue_type_custom_index_0_blockType_docs_lang_md_default()(component)
/* harmony default export */ var ContentCard = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ 204:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
/* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(184);
/* harmony import */ var marked__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(marked__WEBPACK_IMPORTED_MODULE_0__);
const htmlRemovalPatternsFromTags = tags => {
return [/\n$/].concat(tags.map(tag => new RegExp(`</?${tag}.*?>`, 'gi')));
};
/* harmony default export */ __webpack_exports__["a"] = ({
methods: {
/**
* Strip markdown from text.
* This method FIRST converts markdown to HTML, then removes HTML tags.
* WARNING: This also means any HTML tags already present before will be stripped.
*
* As an optional parameter specific HTML tag names can be supplied. In which case,
* only these will be removed.
* @param {string} text String containing mark1down
* @param {string[]} tags the HTML tags to be removed.
* @return {String} text value with HTML breaks
*/
stripMarkdown(text, tags = ['']) {
text = marked__WEBPACK_IMPORTED_MODULE_0__["marked"].parse(text); // Marked adds newlines to the end of the string, and wraps it in a <p> tag.
for (const pattern of htmlRemovalPatternsFromTags(tags)) {
text = text.replace(pattern, '');
}
return text;
}
}
});
/***/ }),
/***/ 205:
/***/ (function(module, exports) {
/***/ }),
/***/ 208:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/ContentHeader.vue?vue&type=template&id=70220f01&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('header',{staticClass:"row"},[_c('b-col',{staticClass:"col lead mt-3",attrs:{"cols":"12","lg":"9"}},[(_vm.contextLabel)?_c('div',{staticClass:"context-label",attrs:{"data-qa":"context label"}},[_vm._v("\n "+_vm._s(_vm.contextLabel)+"\n ")]):_vm._e(),_vm._v(" "),_c('h1',{attrs:{"data-qa":"page title"}},[_vm._v("\n "+_vm._s(_vm.title)+"\n ")]),_vm._v(" "),(_vm.description)?_c('div',{domProps:{"innerHTML":_vm._s(_vm.description)}}):_vm._e()]),_vm._ssrNode(" "),(_vm.mediaUrl)?_c('b-col',{staticClass:"pt-0 pb-3 py-lg-3 text-left text-lg-right",attrs:{"cols":"12","lg":"3"}},[_c('SocialShare',{attrs:{"media-url":_vm.mediaUrl}})],1):_vm._e()],2)}
var staticRenderFns = []
// CONCATENATED MODULE: ./src/components/generic/ContentHeader.vue?vue&type=template&id=70220f01&
// EXTERNAL MODULE: ./src/components/sharing/SocialShare.vue + 4 modules
var SocialShare = __webpack_require__(200);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/ContentHeader.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var ContentHeadervue_type_script_lang_js_ = ({
components: {
SocialShare: SocialShare["a" /* default */]
},
props: {
title: {
type: String,
required: true
},
description: {
type: String,
default: null
},
mediaUrl: {
type: String,
default: null
},
contextLabel: {
type: String,
default: null
}
}
});
// CONCATENATED MODULE: ./src/components/generic/ContentHeader.vue?vue&type=script&lang=js&
/* harmony default export */ var generic_ContentHeadervue_type_script_lang_js_ = (ContentHeadervue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(3);
// CONCATENATED MODULE: ./src/components/generic/ContentHeader.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
generic_ContentHeadervue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
"20f96ff6"
)
/* harmony default export */ var ContentHeader = __webpack_exports__["a"] = (component.exports);
/***/ }),
/***/ 231:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/PaginationNavInput.vue?vue&type=template&id=2367e688&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('nav',{directives:[{name:"show",rawName:"v-show",value:(_vm.showPagination),expression:"showPagination"}],staticClass:"pagination-nav-input",attrs:{"aria-hidden":"false","aria-label":_vm.$t('pagination.label'),"data-qa":"pagination navigation"}},[_vm._ssrNode("<ul class=\"pl-0 d-flex justify-content-center\">","</ul>",[_vm._ssrNode("<li data-qa=\"prev button\""+(_vm._ssrClass("page-item btn-prev pl-0",{ 'disabled' : _vm.prevDisabled }))+">","</li>",[_c('SmartLink',{staticClass:"page-link",attrs:{"destination":_vm.prevUrl,"aria-label":_vm.$t('actions.previous'),"disabled":_vm.prevDisabled,"aria-hidden":_vm.prevDisabled}},[_c('span',{staticClass:"icon-arrow-down"}),_vm._v("\n "+_vm._s(_vm.$t('actions.previous'))+"\n ")])],1),_vm._ssrNode(" "),_vm._ssrNode("<li class=\"page-item page-input\">","</li>",[_c('b-form-input',{attrs:{"aria-label":_vm.$t('pageNumber'),"lazy":true,"max":_vm.totalPages,"min":1,"number":true,"data-qa":"pagination input","type":"number"},model:{value:(_vm.page),callback:function ($$v) {_vm.page=$$v},expression:"page"}}),_vm._ssrNode(_vm._ssrEscape(" "+_vm._s(_vm.$t('of'))+" "+_vm._s(_vm.totalPages)+"\n "))],2),_vm._ssrNode(" "),_vm._ssrNode("<li data-qa=\"next button\""+(_vm._ssrClass("page-item btn-next pr-0",{ 'disabled' : _vm.nextDisabled }))+">","</li>",[_c('SmartLink',{staticClass:"page-link",attrs:{"destination":_vm.nextUrl,"aria-label":_vm.$t('actions.next'),"disabled":_vm.nextDisabled,"aria-hidden":_vm.nextDisabled}},[_vm._v("\n "+_vm._s(_vm.$t('actions.next'))+"\n "),_c('span',{staticClass:"icon-arrow-down"})])],1)],2)])}
var staticRenderFns = []
// CONCATENATED MODULE: ./src/components/generic/PaginationNavInput.vue?vue&type=template&id=2367e688&
// EXTERNAL MODULE: ./src/components/generic/SmartLink.vue + 3 modules
var SmartLink = __webpack_require__(26);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/generic/PaginationNavInput.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var PaginationNavInputvue_type_script_lang_js_ = ({
name: 'PaginationNavInput',
components: {
SmartLink: SmartLink["a" /* default */]
},
props: {
perPage: {
type: Number,
default: 24
},
totalResults: {
type: Number,
default: 0
},
maxResults: {
type: Number,
default: null
}
},
data() {
var _this$$route, _this$$route$query;
return {
page: Number((_this$$route = this.$route) === null || _this$$route === void 0 ? void 0 : (_this$$route$query = _this$$route.query) === null || _this$$route$query === void 0 ? void 0 : _this$$route$query.page) || 1
};
},
computed: {
showPagination() {
return this.totalResults > this.perPage;
},
totalPages() {
const atLeastOne = Math.max(this.totalResults, 1);
return Math.ceil(Math.min(atLeastOne, this.maxResults || atLeastOne) / this.perPage);
},
prevDisabled() {
return this.page <= 1;
},
prevUrl() {
return this.linkGen(this.page - 1);
},
nextUrl() {
return this.linkGen(this.page + 1);
},
nextDisabled() {
return this.page === this.totalPages;
}
},
watch: {
'$route.query.page'() {
var _this$$route2, _this$$route2$query;
this.page = Number((_this$$route2 = this.$route) === null || _this$$route2 === void 0 ? void 0 : (_this$$route2$query = _this$$route2.query) === null || _this$$route2$query === void 0 ? void 0 : _this$$route2$query.page) || 1;
},
page: 'changePaginationNav'
},
methods: {
changePaginationNav() {
const newRouteQuery = { ...this.$route.query,
page: this.page
};
const newRoute = {
path: this.$route.path,
query: newRouteQuery
};
this.$goto(newRoute);
},
linkGen(pageNo) {
return {
path: this.$route.path,
query: { ...this.$route.query,
page: pageNo
}
};
}
}
});
// CONCATENATED MODULE: ./src/components/generic/PaginationNavInput.vue?vue&type=script&lang=js&
/* harmony default export */ var generic_PaginationNavInputvue_type_script_lang_js_ = (PaginationNavInputvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(3);
// CONCATENATED MODULE: ./src/components/generic/PaginationNavInput.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
generic_PaginationNavInputvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
"61415edc"
)
/* harmony default export */ var PaginationNavInput = __webpack_exports__["default"] = (component.exports);
/***/ }),
/***/ 548:
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
// ESM COMPAT FLAG
__webpack_require__.r(__webpack_exports__);
// CONCATENATED MODULE: ./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/vue-loader/lib??vue-loader-options!./src/pages/collections/persons-or-places.vue?vue&type=template&id=49839033&
var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-container',[_c('ContentHeader',{attrs:{"title":_vm.title}}),_vm._v(" "),_c('b-row',{staticClass:"flex-md-row pb-5"},[_c('b-col',{attrs:{"cols":"12"}},[_c('b-card-group',{staticClass:"card-deck-4-cols",attrs:{"deck":"","data-qa":(_vm.entityTypeHumanReadable + " listing page")}},_vm._l((_vm.entities),function(entity){return _c('ContentCard',{key:entity.id,attrs:{"title":entity.prefLabel,"url":_vm.entityRoute(entity),"image-url":_vm.thumbnail(entity),"variant":"mini"}})}),1)],1)],1),_vm._v(" "),_c('b-row',[_c('b-col',[_c('PaginationNavInput',{attrs:{"total-results":_vm.total,"per-page":_vm.perPage}})],1)],1)],1)}
var staticRenderFns = []
// CONCATENATED MODULE: ./src/pages/collections/persons-or-places.vue?vue&type=template&id=49839033&
// EXTERNAL MODULE: ./src/plugins/europeana/entity.js
var europeana_entity = __webpack_require__(52);
// EXTERNAL MODULE: ./src/plugins/europeana/utils.js
var utils = __webpack_require__(2);
// EXTERNAL MODULE: ./src/components/generic/ContentHeader.vue + 4 modules
var ContentHeader = __webpack_require__(208);
// EXTERNAL MODULE: ./src/components/generic/ContentCard.vue + 4 modules
var ContentCard = __webpack_require__(203);
// EXTERNAL MODULE: ./src/components/generic/PaginationNavInput.vue + 4 modules
var PaginationNavInput = __webpack_require__(231);
// CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib??vue-loader-options!./src/pages/collections/persons-or-places.vue?vue&type=script&lang=js&
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
/* harmony default export */ var persons_or_placesvue_type_script_lang_js_ = ({
name: 'CollectionsPersonsOrPlacesIndexPage',
components: {
ContentHeader: ContentHeader["a" /* default */],
ContentCard: ContentCard["default"],
PaginationNavInput: PaginationNavInput["default"]
},
middleware: 'sanitisePageQuery',
data() {
return {
entities: [],
total: 0,
perPage: 24
};
},
async fetch() {
const entityIndexParams = {
query: '*:*',
page: this.page - 1,
type: this.entityTypeApi,
pageSize: this.perPage,
scope: 'europeana',
sort: `skos_prefLabel.${this.$i18n.locale}`,
qf: `skos_prefLabel.${this.$i18n.locale}:*`,
fl: 'skos_prefLabel.*,isShownBy,isShownBy.thumbnail'
};
try {
const response = await this.$apis.entity.search(entityIndexParams);
this.entities = response.entities;
this.total = response.total;
} finally {
this.$scrollTo && this.$scrollTo('#header');
}
},
head() {
return {
title: this.$pageHeadTitle(this.title)
};
},
computed: {
personsOrPlaces() {
return this.$route.path.split('/').pop();
},
entityTypeHumanReadable() {
return this.personsOrPlaces.slice(0, -1);
},
entityTypeApi() {
return Object(europeana_entity["d" /* getEntityTypeApi */])(this.entityTypeHumanReadable);
},
title() {
return this.$t(`pages.collections.${this.personsOrPlaces}.title`);
},
page() {
return this.$store.state.sanitised.page;
}
},
watch: {
'$route.query.page': '$fetch'
},
methods: {
entityRoute(entity) {
return {
name: 'collections-type-all',
params: {
type: Object(europeana_entity["e" /* getEntityTypeHumanReadable */])(entity.type),
pathMatch: Object(utils["f" /* getLabelledSlug */])(entity.id, entity.prefLabel.en)
}
};
},
thumbnail(entity) {
return this.$apis.entity.imageUrl(entity);
}
}
});
// CONCATENATED MODULE: ./src/pages/collections/persons-or-places.vue?vue&type=script&lang=js&
/* harmony default export */ var collections_persons_or_placesvue_type_script_lang_js_ = (persons_or_placesvue_type_script_lang_js_);
// EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
var componentNormalizer = __webpack_require__(3);
// CONCATENATED MODULE: ./src/pages/collections/persons-or-places.vue
/* normalize component */
var component = Object(componentNormalizer["a" /* default */])(
collections_persons_or_placesvue_type_script_lang_js_,
render,
staticRenderFns,
false,
null,
null,
"29b740bc"
)
/* harmony default export */ var persons_or_places = __webpack_exports__["default"] = (component.exports);
/***/ })
};;
//# sourceMappingURL=78.js.map