From a30c78b7638db759db12a0feb347f88ab5d0a7d8 Mon Sep 17 00:00:00 2001 From: MuxinFeng <434980373@qq.com> Date: Mon, 3 Jul 2023 19:01:44 +0800 Subject: [PATCH] fix: rename inputIcon --- README.md | 9 +++-- docs/examples/custom-icon.tsx | 4 +-- docs/examples/multiple.tsx | 66 +++++++++++++++++++---------------- docs/examples/suggest.tsx | 2 +- src/BaseSelect.tsx | 8 ++--- tests/Multiple.test.tsx | 49 ++++++++++---------------- 6 files changed, 68 insertions(+), 70 deletions(-) diff --git a/README.md b/README.md index 54d66851..11aced2b 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,12 @@ React Select -[![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] [![build status][github-actions-image]][github-actions-url] [![Codecov][codecov-image]][codecov-url] [![bundle size][bundlephobia-image]][bundlephobia-url] [![dumi][dumi-image]][dumi-url] +[![NPM version][npm-image]][npm-url] +[![npm download][download-image]][download-url] +[![build status][github-actions-image]][github-actions-url] +[![Codecov][codecov-image]][codecov-url] +[![bundle size][bundlephobia-image]][bundlephobia-url] +[![dumi][dumi-image]][dumi-url] [npm-image]: http://img.shields.io/npm/v/rc-select.svg?style=flat-square [npm-url]: http://npmjs.org/package/rc-select @@ -113,7 +118,7 @@ export default () => ( | showAction | actions trigger the dropdown to show | String[]? | - | | autoFocus | focus select after mount | Bool | - | | autoClearSearchValue | auto clear search input value when multiple select is selected/deselected | boolean | true | -| inputIcon | specify the select arrow icon | ReactNode | - | +| suffixIcon | specify the select arrow icon | ReactNode | - | | clearIcon | specify the clear icon | ReactNode | - | | removeIcon | specify the remove icon | ReactNode | - | | menuItemSelectedIcon | specify the item selected icon | ReactNode \| (props: MenuItemProps) => ReactNode | - | diff --git a/docs/examples/custom-icon.tsx b/docs/examples/custom-icon.tsx index 938ad418..59daa7b8 100644 --- a/docs/examples/custom-icon.tsx +++ b/docs/examples/custom-icon.tsx @@ -102,7 +102,7 @@ class CustomIconComponent extends React.Component { value={value} mode="combobox" backfill - inputIcon={({ searchValue }) => { + suffixIcon={({ searchValue }) => { if (searchValue) { return '😺'; } @@ -192,7 +192,7 @@ class Test extends React.Component { onChange={this.onChange} onFocus={() => console.log('focus')} tokenSeparators={[' ', ',']} - inputIcon={getSvg(arrowPath)} + suffixIcon={getSvg(arrowPath)} clearIcon={getSvg(clearPath)} removeIcon={getSvg(clearPath)} menuItemSelectedIcon={menuItemSelectedIcon} diff --git a/docs/examples/multiple.tsx b/docs/examples/multiple.tsx index 80fba7af..5edae7f7 100644 --- a/docs/examples/multiple.tsx +++ b/docs/examples/multiple.tsx @@ -1,6 +1,6 @@ /* eslint-disable no-console */ -import React from 'react'; import Select, { Option } from 'rc-select'; +import React from 'react'; import '../../assets/index.less'; const children = []; @@ -15,10 +15,10 @@ for (let i = 10; i < 36; i += 1) { class Test extends React.Component { state = { useAnim: false, - inputIcon: null, + suffixIcon: null, loading: false, value: ['a10'], - searchValue: "", + searchValue: '', }; onChange = (value, options) => { @@ -36,32 +36,32 @@ class Test extends React.Component { console.log(args); }; - useAnim = e => { + useAnim = (e) => { this.setState({ useAnim: e.target.checked, }); }; - showArrow = e => { + showArrow = (e) => { this.setState({ - inputIcon: e.target.checked ?
@@ -93,7 +98,7 @@ class Test extends React.Component { style={{ width: 500 }} mode="multiple" loading={loading} - inputIcon={inputIcon} + suffixIcon={suffixIcon} allowClear optionFilterProp="children" optionLabelProp="children" @@ -102,33 +107,32 @@ class Test extends React.Component { placeholder="please select" onChange={this.onChange} onFocus={() => console.log('focus')} - onBlur={v => console.log('blur', v)} + onBlur={(v) => console.log('blur', v)} tokenSeparators={[' ', ',']} > {children}