UNPKG

1.55 kBJavaScriptView Raw
1import { createVNode as _createVNode, isVNode as _isVNode } from "vue";
2
3function _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; }
4
5import CalendarOutlined from '@ant-design/icons-vue/CalendarOutlined';
6import { isValidElement } from '../_util/props-util';
7import { cloneElement } from '../_util/vnode';
8import classNames from '../_util/classNames';
9
10function _isSlot(s) {
11 return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !_isVNode(s);
12}
13
14var InputIcon = function InputIcon(_, _ref) {
15 var _classNames;
16
17 var attrs = _ref.attrs;
18
19 var _a, _b;
20
21 var suffixIcon = attrs.suffixIcon,
22 prefixCls = attrs.prefixCls;
23 return (suffixIcon && isValidElement(suffixIcon) ? cloneElement(suffixIcon, {
24 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))
25 }) : _createVNode("span", {
26 "class": "".concat(prefixCls, "-picker-icon")
27 }, _isSlot(suffixIcon) ? suffixIcon : {
28 default: function _default() {
29 return [suffixIcon];
30 }
31 })) || _createVNode(CalendarOutlined, {
32 "class": "".concat(prefixCls, "-picker-icon")
33 }, null);
34};
35
36InputIcon.inheritAttrs = false;
37export default InputIcon;
\No newline at end of file