ant-design-vue
Version:
An enterprise-class UI design language and Vue-based implementation
54 lines (50 loc) • 1.66 kB
JavaScript
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
import { createVNode as _createVNode } from "vue";
import { computed, defineComponent } from 'vue';
import useConfigInject from '../_util/hooks/useConfigInject';
export default defineComponent({
name: 'AInputGroup',
props: {
prefixCls: String,
size: {
type: String
},
compact: {
type: Boolean,
default: undefined
},
onMouseenter: {
type: Function
},
onMouseleave: {
type: Function
},
onFocus: {
type: Function
},
onBlur: {
type: Function
}
},
setup: function setup(props, _ref) {
var slots = _ref.slots;
var _useConfigInject = useConfigInject('input-group', props),
prefixCls = _useConfigInject.prefixCls,
direction = _useConfigInject.direction;
var cls = computed(function () {
var _ref2;
var pre = prefixCls.value;
return _ref2 = {}, _defineProperty(_ref2, "".concat(pre), true), _defineProperty(_ref2, "".concat(pre, "-lg"), props.size === 'large'), _defineProperty(_ref2, "".concat(pre, "-sm"), props.size === 'small'), _defineProperty(_ref2, "".concat(pre, "-compact"), props.compact), _defineProperty(_ref2, "".concat(pre, "-rtl"), direction.value === 'rtl'), _ref2;
});
return function () {
var _a;
return _createVNode("span", {
"class": cls.value,
"onMouseenter": props.onMouseEnter,
"onMouseleave": props.onMouseLeave,
"onFocus": props.onFocus,
"onBlur": props.onBlur
}, [(_a = slots.default) === null || _a === void 0 ? void 0 : _a.call(slots)]);
};
}
});