Skip to content

Commit d59c833

Browse files
committed
feat: add suffix and deprecate suffixIcon
1 parent a975a11 commit d59c833

15 files changed

Lines changed: 53 additions & 32 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ Then open `http://localhost:8000`.
126126
| showTime | `boolean \| SharedTimeProps` | `false` | Enable time selection. |
127127
| showToday | `boolean` | - | Show the "today" button. |
128128
| styles | `SemanticStyles` | - | Semantic styles for root and popup slots. |
129-
| suffixIcon | `ReactNode` | - | Custom suffix icon. |
129+
| suffix | `ReactNode` | - | Custom suffix. |
130130
| onOpenChange | `(open: boolean) => void` | - | Triggered when popup open state changes. |
131131
| onPanelChange | `(value, mode) => void` | - | Triggered when panel mode changes. |
132132

README.zh-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ npm start
126126
| showTime | `boolean \| SharedTimeProps` | `false` | 启用时间选择。 |
127127
| showToday | `boolean` | - | 显示“今天”按钮。 |
128128
| styles | `SemanticStyles` | - | 根槽和弹层槽的语义样式。 |
129-
| suffixIcon | `ReactNode` | - | 自定义后缀图标|
129+
| suffix | `ReactNode` | - | 自定义后缀|
130130
| onOpenChange | `(open: boolean) => void` | - | 当弹层窗口打开状态改变时触发。 |
131131
| onPanelChange | `(value, mode) => void` | - | 当面板模式改变时触发。 |
132132

docs/examples/basic.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export default () => {
5454
<Picker<Moment>
5555
{...sharedProps}
5656
locale={zhCN}
57-
suffixIcon="SUFFIX"
57+
suffix="SUFFIX"
5858
rootClassName="bamboo"
5959
className="little"
6060
classNames={{

docs/examples/customize.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ class Customize extends React.Component<{}, DateRangeState> {
123123
allowClear
124124
prefix="Foobar"
125125
clearIcon={<span>X</span>}
126-
suffixIcon={<span>O</span>}
126+
suffix={<span>O</span>}
127127
prevIcon={<span>&lt;</span>}
128128
nextIcon={<span>&gt;</span>}
129129
superPrevIcon={<span>&lt;&lt;</span>}

docs/examples/range.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export default () => {
6161
ref={rangePickerRef}
6262
defaultValue={[moment('1990-09-03'), moment('1989-11-28')]}
6363
clearIcon={<span>X</span>}
64-
suffixIcon={<span>O</span>}
64+
suffix={<span>O</span>}
6565
presets={[
6666
{
6767
label: 'Last week',

docs/examples/time.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default () => {
3333
<Picker
3434
classNames={testClassNames}
3535
prefix="prefix"
36-
suffixIcon="suffix"
36+
suffix="suffix"
3737
defaultValue={defaultValue}
3838
picker="time"
3939
locale={zhCN}

src/PickerInput/RangePicker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ function RangePicker<DateType extends object = any>(
218218
// Format
219219
inputReadOnly,
220220

221-
suffixIcon,
221+
suffix,
222222

223223
// Focus
224224
onFocus,
@@ -790,7 +790,7 @@ function RangePicker<DateType extends object = any>(
790790
className={clsx(filledProps.className, rootClassName, mergedClassNames.root)}
791791
style={{ ...mergedStyles.root, ...filledProps.style }}
792792
// Icon
793-
suffixIcon={suffixIcon}
793+
suffix={suffix}
794794
// Active
795795
activeIndex={focused || mergedOpen ? activeIndex : null}
796796
activeHelp={!!internalHoverValues}

src/PickerInput/Selector/Input.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
3131
active?: boolean;
3232
/** Used for single picker only */
3333
showActiveCls?: boolean;
34-
suffixIcon?: React.ReactNode;
34+
suffix?: React.ReactNode;
3535
value?: string;
3636
onChange: (value: string) => void;
3737
onSubmit: VoidFunction;
@@ -53,7 +53,7 @@ const Input = React.forwardRef<InputRef, InputProps>((props, ref) => {
5353
className,
5454
active,
5555
showActiveCls = true,
56-
suffixIcon,
56+
suffix,
5757
format,
5858
validateFormat,
5959
onChange,
@@ -417,7 +417,7 @@ const Input = React.forwardRef<InputRef, InputProps>((props, ref) => {
417417
className={classNames.input}
418418
style={styles.input}
419419
/>
420-
<Icon icon={suffixIcon} />
420+
<Icon icon={suffix} />
421421
{clearIcon}
422422
</div>
423423
);

src/PickerInput/Selector/RangeSelector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function RangeSelector<DateType extends object = any>(
6161

6262
prefix,
6363
clearIcon,
64-
suffixIcon,
64+
suffix,
6565
separator = '~',
6666
activeIndex,
6767
activeHelp,
@@ -270,7 +270,7 @@ function RangeSelector<DateType extends object = any>(
270270
date-range="end"
271271
/>
272272
<div className={`${prefixCls}-active-bar`} style={activeBarStyle} />
273-
<Icon icon={suffixIcon} />
273+
<Icon icon={suffix} />
274274
{showClear && <ClearIcon icon={clearIcon} onClear={onClear} />}
275275
</div>
276276
</ResizeObserver>

src/PickerInput/Selector/SingleSelector/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function SingleSelector<DateType extends object = any>(
4646

4747
prefix,
4848
clearIcon,
49-
suffixIcon,
49+
suffix,
5050
activeHelp,
5151
allHelp,
5252

@@ -184,7 +184,7 @@ function SingleSelector<DateType extends object = any>(
184184
autoFocus={autoFocus}
185185
tabIndex={tabIndex}
186186
/>
187-
<Icon icon={suffixIcon} />
187+
<Icon icon={suffix} />
188188
{showClear && <ClearIcon icon={clearIcon} onClear={onClear} />}
189189
</>
190190
) : (
@@ -193,7 +193,7 @@ function SingleSelector<DateType extends object = any>(
193193
{...getInputProps()}
194194
autoFocus={autoFocus}
195195
tabIndex={tabIndex}
196-
suffixIcon={suffixIcon}
196+
suffix={suffix}
197197
clearIcon={showClear && <ClearIcon icon={clearIcon} onClear={onClear} />}
198198
showActiveCls={false}
199199
/>

0 commit comments

Comments
 (0)