@appbaseio/reactivesearch-vue
Version:
A Vue UI components library for building search experiences
103 lines (97 loc) • 3.13 kB
JavaScript
import { b as _objectWithoutPropertiesLoose } from './_rollupPluginBabelHelpers-5e8399d7.js';
import { createVNode, isVNode, mergeProps } from 'vue';
import VueTypes from 'vue-types';
import '@appbaseio/vue-emotion';
import '@emotion/css';
import 'polished';
import { t as types } from './vueTypes-5d575822.js';
import { T as Title } from './Title-100fe896.js';
import { I as Image, C as Card } from './Card-3a81ac7b.js';
function _isSlot(s) {
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
}
var ResultCardTitle = {
name: 'ResultCardTitle',
render: function render() {
var _slot;
var children = this.$slots["default"];
return createVNode(Title, this.$props, _isSlot(_slot = children()) ? _slot : {
"default": function _default() {
return [_slot];
}
});
}
};
ResultCardTitle.install = function (Vue) {
Vue.component(ResultCardTitle.name, ResultCardTitle);
};
var _excluded = ["src"];
var ResultCardImage = {
name: 'ResultCardImage',
props: {
src: VueTypes.string.isRequired
},
render: function render() {
var _this$$props = this.$props,
src = _this$$props.src,
props = _objectWithoutPropertiesLoose(_this$$props, _excluded);
return createVNode(Image, mergeProps({
"style": {
backgroundImage: "url(" + src + ")"
}
}, props), null);
}
};
ResultCardImage.install = function (Vue) {
Vue.component(ResultCardImage.name, ResultCardImage);
};
var ResultCardDescription = {
name: 'ResultCardDescription',
functional: true,
render: function render(context) {
return createVNode("article", context.$props, [context.$slots["default"]()]);
}
};
ResultCardDescription.install = function (Vue) {
Vue.component(ResultCardDescription.name, ResultCardDescription);
};
var _excluded$1 = ["href", "target"];
function _isSlot$1(s) {
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !isVNode(s);
}
var ResultCard = {
name: 'ResultCard',
components: {
ResultCardTitle: ResultCardTitle,
ResultCardImage: ResultCardImage,
ResultCardDescription: ResultCardDescription
},
props: {
target: VueTypes.string.def('_blank'),
href: types.string
},
render: function render() {
var _slot;
var children = this.$slots["default"];
var _this$$props = this.$props,
href = _this$$props.href,
target = _this$$props.target,
rest = _objectWithoutPropertiesLoose(_this$$props, _excluded$1);
return createVNode(Card, mergeProps({
"href": href,
"target": target,
"rel": target === '_blank' ? 'noopener noreferrer' : null
}, rest), _isSlot$1(_slot = children()) ? _slot : {
"default": function _default() {
return [_slot];
}
});
}
};
ResultCard.install = function (Vue) {
Vue.component(ResultCard.name, ResultCard);
Vue.component(ResultCardTitle.name, ResultCardTitle);
Vue.component(ResultCardImage.name, ResultCardImage);
Vue.component(ResultCardDescription.name, ResultCardDescription);
};
export default ResultCard;