Skip to content

Commit 92f7eb6

Browse files
authored
Merge pull request #970 from oceanbase/feat/date-ranger-add-overlay-classname
feat(ui): [date-ranger] add overlayClassName and overlayStyle props
2 parents e4d3bd0 + f03418d commit 92f7eb6

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

packages/ui/src/DateRanger/Ranger.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ export interface DateRangerProps
8989
size?: 'small' | 'large' | 'middle';
9090
tooltipProps?: TooltipProps;
9191
autoAdjustOverflow?: boolean;
92+
overlayClassName?: string;
93+
overlayStyle?: React.CSSProperties;
9294
locale?: any;
9395
}
9496

@@ -130,6 +132,8 @@ const Ranger = React.forwardRef((props: DateRangerProps, ref) => {
130132
rules,
131133
tip,
132134
autoAdjustOverflow,
135+
overlayClassName,
136+
overlayStyle,
133137
...rest
134138
} = props;
135139

@@ -358,7 +362,10 @@ const Ranger = React.forwardRef((props: DateRangerProps, ref) => {
358362
}}
359363
dropdownRender={originNode => {
360364
return (
361-
<div className={`${prefix}-dropdown-picker`}>
365+
<div
366+
className={classNames(`${prefix}-dropdown-picker`, overlayClassName)}
367+
style={overlayStyle}
368+
>
362369
{originNode}
363370
<Divider type="vertical" style={{ height: 'auto', margin: '0px 4px 0px 0px' }} />
364371
<InternalPickerPanel

packages/ui/src/DateRanger/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ markdown: |
4343
| hideYear | 当时间范围在本年时,隐藏年份 | boolean | false | - |
4444
| hideSecond | 隐藏"秒” | boolean | false | - |
4545
| autoCalcRange | 自动计算时间范围并回显到选择器tag | boolean | false | - |
46+
| autoAdjustOverflow | 选择面板被遮挡时自动调整位置 | boolean | true | - |
47+
| overlayClassName | 选择面板根元素的类名称 | string | - | - |
48+
| overlayStyle | 选择面板根元素的样式 | CSSProperties | - | - |
4649
| ref | updateCurrentTime 手动更新当前时间 | function | - | - |
4750
| 其他 antd/RangePicker 的 `props` | [antd-RangePicker](https://ant.design/components/date-picker-cn/#RangePicker) | - | - | - |
4851

0 commit comments

Comments
 (0)