vuikit
Version:
A responsive Vue UI library for web site interfaces based on UIkit
104 lines (93 loc) • 2.3 kB
JavaScript
/**
* Vuikit 0.8.10
* (c) 2018 Miljan Aleksic
* @license MIT
**/
/* Substantial part of the code is adapted from UIkit,
Copyright (c) 2013-2018 YOOtheme GmbH, getuikit.com */
import { mergeData } from './util/vue';
import { assign } from './util/lang';
var props = {
active: {
type: Boolean,
default: false
},
size: {
type: String,
validator: function (val) { return !val || /^(small|large)$/.test(val); }
},
type: {
type: String,
validator: function (val) { return !val || /^(primary|secondary|danger|text|link)$/.test(val); }
}
};
var def = function (ref) {
var obj;
var type = ref.type;
var active = ref.active;
var size = ref.size;
return ({
class: ['uk-button', ("uk-button-" + (type || 'default')), ( obj = {
'uk-active': active
}, obj[("uk-button-" + size)] = size, obj)]
});
};
var ElementButton = {
functional: true,
props: assign({}, props, {
htmlType: {
type: String,
default: 'button'
}
}),
render: function render (h, ref) {
var props$$1 = ref.props;
var data = ref.data;
var children = ref.children;
var htmlType = props$$1.htmlType;
return h('button', mergeData(data, def(props$$1), {
attrs: {
type: htmlType
}
}), children)
}
}
var ElementButtonLink = {
functional: true,
props: props,
render: function render (h, ref) {
var props$$1 = ref.props;
var data = ref.data;
var children = ref.children;
return h('a', mergeData(data, def(props$$1)), children)
}
}
var ElementButtonGroup = {
functional: true,
render: function render (h, ref) {
var data = ref.data;
var children = ref.children;
return h('div', mergeData(data, {
class: 'uk-button-group'
}), children)
}
}
var button = {
name: 'VkButton',
functional: true,
props: ElementButton.props,
render: ElementButton.render
}
var buttonLink = {
name: 'VkButtonLink',
functional: true,
props: ElementButtonLink.props,
render: ElementButtonLink.render
}
var buttonGroup = {
name: 'VkButtonGroup',
functional: true,
props: ElementButtonGroup.props,
render: ElementButtonGroup.render
}
export { ElementButton, ElementButtonLink, ElementButtonGroup, button as Button, buttonLink as ButtonLink, buttonGroup as ButtonGroup };