@meve/ui
Version:
Argon design system components library
52 lines (47 loc) • 1.49 kB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
import { createNamespace } from '../utils/create';
import { createParentMixin } from '../utils/mixins/relation';
import { toPxNum } from '../utils/elements';
import { props } from './props';
var _createNamespace = createNamespace('row'),
createComponent = _createNamespace.createComponent,
namespace = _createNamespace.namespace;
var RowPlugin = createComponent({
mixins: [createParentMixin('row')],
props: props,
computed: {
gutterNum: function gutterNum() {
return toPxNum(this.gutter);
}
},
methods: {
handleClick: function handleClick(e) {
this.$emit('click', e);
}
},
render: function render() {
var h = arguments[0];
var justify = this.justify,
align = this.align,
gutterNum = this.gutterNum,
handleClick = this.handleClick;
return h("div", {
"class": [namespace(), 'm--box'],
"style": {
justifyContent: justify,
alignItems: align,
margin: "0 " + -gutterNum + "px"
},
"on": _extends({}, {
"click": function click($event) {
for (var _len = arguments.length, attrs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
attrs[_key - 1] = arguments[_key];
}
handleClick.apply(void 0, [$event].concat(attrs));
}
})
}, [this.slots()]);
}
});
export var _RowComponent = RowPlugin;
export default RowPlugin;