ant-design-vue
Version:
An enterprise-class UI design language and Vue-based implementation
37 lines (29 loc) • 1.55 kB
JavaScript
import { createVNode as _createVNode, isVNode as _isVNode } from "vue";
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
import CalendarOutlined from '@ant-design/icons-vue/CalendarOutlined';
import { isValidElement } from '../_util/props-util';
import { cloneElement } from '../_util/vnode';
import classNames from '../_util/classNames';
function _isSlot(s) {
return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
}
var InputIcon = function InputIcon(_, _ref) {
var _classNames;
var attrs = _ref.attrs;
var _a, _b;
var suffixIcon = attrs.suffixIcon,
prefixCls = attrs.prefixCls;
return (suffixIcon && isValidElement(suffixIcon) ? cloneElement(suffixIcon, {
class: classNames((_classNames = {}, _defineProperty(_classNames, (_a = suffixIcon.props) === null || _a === void 0 ? void 0 : _a.class, (_b = suffixIcon.props) === null || _b === void 0 ? void 0 : _b.class), _defineProperty(_classNames, "".concat(prefixCls, "-picker-icon"), true), _classNames))
}) : _createVNode("span", {
"class": "".concat(prefixCls, "-picker-icon")
}, _isSlot(suffixIcon) ? suffixIcon : {
default: function _default() {
return [suffixIcon];
}
})) || _createVNode(CalendarOutlined, {
"class": "".concat(prefixCls, "-picker-icon")
}, null);
};
InputIcon.inheritAttrs = false;
export default InputIcon;