1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// eslint-disable-next-line no-unused-vars
import React, { useContext } from 'react';
import classNames from 'classnames';
import { Select, TreeSelect, ConfigProvider } from 'antd';
import './index.less';
const { Option, OptGroup } = Select;
const { SHOW_PARENT } = TreeSelect;
const SelectCustom = (props) => {
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('select-custom');
return (
<div className={classNames(`${prefixCls}`, props.prefixIcon ? `${prefixCls}-prefix` : '')}>
{props.prefixIcon ? (
<div className={classNames(`${prefixCls}-icon`)} style={props.prefixStyle}>
{props.prefixIcon}
</div>
) : null}
<Select
{...props}
className={classNames(`${prefixCls}-base`, props.className || '')}
popupClassName={classNames(`${prefixCls}-base-poup`, props.popupClassName || '')}
></Select>
</div>
);
};
const TreeSelectCustom = (props) => {
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('tree-select-custom');
return (
<TreeSelect {...props} className={classNames(`${prefixCls}-base`, props.className || '')} />
);
};
export { SelectCustom, TreeSelectCustom, Option, OptGroup, SHOW_PARENT };