初始化3.0.0版本

This commit is contained in:
zengqiao
2022-08-18 17:04:05 +08:00
parent 462303fca0
commit 51832385b1
2446 changed files with 93177 additions and 127211 deletions

View File

@@ -0,0 +1,39 @@
import React, { useState } from 'react';
import { Input, IconFont } from 'knowdesign';
import './style/index.less';
interface IObjectProps {
[propName: string]: any;
}
interface ISearchInputProps {
onSearch: (value?: string) => unknown;
iconType?: string;
attrs?: IObjectProps;
}
const SearchInput: React.FC<ISearchInputProps> = (props: ISearchInputProps) => {
const { onSearch, iconType = 'icon-fangdajing', attrs } = props;
const [changeVal, setChangeVal] = useState<string>('');
const onChange = (e: any) => {
if (e.target.value === '' || e.target.value === null || e.target.value === undefined) {
onSearch('');
}
attrs?.onChange && attrs?.onChange(e.target.value);
setChangeVal(e.target.value);
};
return (
<Input.Search
{...attrs}
suffix={<IconFont type={iconType} onClick={() => onSearch(changeVal)} />}
onChange={onChange}
className={'dcloud-clustom-input-serach ' + `${attrs?.className}`}
onSearch={(val: string) => {
onSearch(val);
}}
/>
);
};
export default SearchInput;

View File

@@ -0,0 +1,11 @@
.dcloud-clustom-input-serach{
.dcloud-input-affix-wrapper{
border-radius: 2px !important;
}
.dcloud-input-group-addon{
display: none !important;
}
}