Skip to content

Commit 036a088

Browse files
committed
feat(ui): [date-ranger] add overlayClassName and overlayStyle props
1 parent a23acc1 commit 036a088

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/ui/src/DateRanger/Ranger.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ export interface DateRangerProps
8888
defaultValue?: RangeValue;
8989
size?: 'small' | 'large' | 'middle';
9090
tooltipProps?: TooltipProps;
91+
overlayClassName?: string;
92+
overlayStyle?: React.CSSProperties;
9193
locale?: any;
9294
}
9395

@@ -128,6 +130,8 @@ const Ranger = React.forwardRef((props: DateRangerProps, ref) => {
128130
isMoment: isMomentProps,
129131
rules,
130132
tip,
133+
overlayClassName,
134+
overlayStyle,
131135
...rest
132136
} = props;
133137

@@ -354,7 +358,10 @@ const Ranger = React.forwardRef((props: DateRangerProps, ref) => {
354358
}}
355359
dropdownRender={originNode => {
356360
return (
357-
<div className={`${prefix}-dropdown-picker`}>
361+
<div
362+
className={classNames(`${prefix}-dropdown-picker`, overlayClassName)}
363+
style={overlayStyle}
364+
>
358365
{originNode}
359366
<Divider type="vertical" style={{ height: 'auto', margin: '0px 4px 0px 0px' }} />
360367
<InternalPickerPanel

packages/ui/src/DateRanger/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ nav:
3939
| hideYear | 当时间范围在本年时,隐藏年份 | boolean | false | - |
4040
| hideSecond | 隐藏"秒” | boolean | false | - |
4141
| autoCalcRange | 自动计算时间范围并回显到选择器tag | boolean | false | - |
42+
| overlayClassName | 选择面板根元素的类名称 | string | - | - |
43+
| overlayStyle | 选择面板根元素的样式 | CSSProperties | - | - |
4244
| ref | updateCurrentTime 手动更新当前时间 | function | - | - |
4345
| 其他 antd/RangePicker 的 `props` | [antd-RangePicker](https://ant.design/components/date-picker-cn/#RangePicker) | - | - | - |
4446

0 commit comments

Comments
 (0)