Skip to content

Commit 8c5392e

Browse files
committed
feat: support prefix prop
1 parent 826726b commit 8c5392e

File tree

4 files changed

+6
-0
lines changed

4 files changed

+6
-0
lines changed

docs/examples/customize.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ class Customize extends React.Component<{}, DateRangeState> {
121121
// format="YYYY/MM/DD"
122122
format={['YYYY-MM-DD', 'YYYY/MM/DD']}
123123
allowClear
124+
prefix="Foobar"
124125
clearIcon={<span>X</span>}
125126
suffixIcon={<span>O</span>}
126127
prevIcon={<span>&lt;</span>}

src/PickerInput/Selector/RangeSelector.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ function RangeSelector<DateType extends object = any>(
5252
const {
5353
id,
5454

55+
prefix,
5556
clearIcon,
5657
suffixIcon,
5758
separator = '~',
@@ -238,6 +239,7 @@ function RangeSelector<DateType extends object = any>(
238239
onMouseDown?.(e);
239240
}}
240241
>
242+
{prefix && <div className={`${prefixCls}-prefix`}>{prefix}</div>}
241243
<Input
242244
ref={inputStartRef}
243245
{...getInputProps(0)}

src/PickerInput/Selector/SingleSelector/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function SingleSelector<DateType extends object = any>(
4343

4444
open,
4545

46+
prefix,
4647
clearIcon,
4748
suffixIcon,
4849
activeHelp,
@@ -224,6 +225,7 @@ function SingleSelector<DateType extends object = any>(
224225
onMouseDown?.(e);
225226
}}
226227
>
228+
{prefix && <div className={`${prefixCls}-prefix`}>{prefix}</div>}
227229
{selectorNode}
228230
</div>
229231
);

src/interface.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ export interface SharedPickerProps<DateType extends object = any>
354354
};
355355

356356
// Icons
357+
prefix?: React.ReactNode;
357358
suffixIcon?: React.ReactNode;
358359
allowClear?:
359360
| boolean

0 commit comments

Comments
 (0)