Skip to content

Commit 9b2757a

Browse files
committed
feat: Add more dropdown className
1 parent ba35bf1 commit 9b2757a

File tree

3 files changed

+30
-24
lines changed

3 files changed

+30
-24
lines changed

src/Picker.tsx

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -368,28 +368,28 @@ function InnerPicker<DateType>(props: PickerProps<DateType>) {
368368
panelRef: panelDivRef,
369369
}}
370370
>
371-
<div
372-
className={classNames(prefixCls, className, {
373-
[`${prefixCls}-disabled`]: disabled,
374-
[`${prefixCls}-focused`]: focused,
375-
})}
376-
style={style}
377-
onMouseDown={onMouseDown}
378-
onMouseUp={onMouseUp}
379-
onMouseEnter={onMouseEnter}
380-
onMouseLeave={onMouseLeave}
381-
onContextMenu={onContextMenu}
382-
onClick={onClick}
371+
<PickerTrigger
372+
visible={mergedOpen}
373+
popupElement={panel}
374+
popupStyle={popupStyle}
375+
prefixCls={prefixCls}
376+
dropdownClassName={dropdownClassName}
377+
dropdownAlign={dropdownAlign}
378+
getPopupContainer={getPopupContainer}
379+
transitionName={transitionName}
383380
>
384-
<PickerTrigger
385-
visible={mergedOpen}
386-
popupElement={panel}
387-
popupStyle={popupStyle}
388-
prefixCls={prefixCls}
389-
dropdownClassName={dropdownClassName}
390-
dropdownAlign={dropdownAlign}
391-
getPopupContainer={getPopupContainer}
392-
transitionName={transitionName}
381+
<div
382+
className={classNames(prefixCls, className, {
383+
[`${prefixCls}-disabled`]: disabled,
384+
[`${prefixCls}-focused`]: focused,
385+
})}
386+
style={style}
387+
onMouseDown={onMouseDown}
388+
onMouseUp={onMouseUp}
389+
onMouseEnter={onMouseEnter}
390+
onMouseLeave={onMouseLeave}
391+
onContextMenu={onContextMenu}
392+
onClick={onClick}
393393
>
394394
<div className={`${prefixCls}-input`} ref={inputDivRef}>
395395
<input
@@ -407,8 +407,8 @@ function InnerPicker<DateType>(props: PickerProps<DateType>) {
407407
{suffixNode}
408408
{clearNode}
409409
</div>
410-
</PickerTrigger>
411-
</div>
410+
</div>
411+
</PickerTrigger>
412412
</PanelContext.Provider>
413413
);
414414
}

src/PickerTrigger.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as React from 'react';
2+
import classNames from 'classnames';
23
import Trigger from 'rc-trigger';
34
import { AlignType } from 'rc-trigger/lib/interface';
45

@@ -47,6 +48,7 @@ export interface PickerTriggerProps {
4748
transitionName?: string;
4849
getPopupContainer?: (node: HTMLElement) => HTMLElement;
4950
dropdownAlign?: AlignType;
51+
range?: boolean;
5052
}
5153

5254
function PickerTrigger({
@@ -59,6 +61,7 @@ function PickerTrigger({
5961
transitionName,
6062
getPopupContainer,
6163
children,
64+
range,
6265
}: PickerTriggerProps) {
6366
const dropdownPrefixCls = `${prefixCls}-dropdown`;
6467

@@ -73,7 +76,9 @@ function PickerTrigger({
7376
popup={popupElement}
7477
popupAlign={dropdownAlign}
7578
popupVisible={visible}
76-
popupClassName={dropdownClassName}
79+
popupClassName={classNames(dropdownClassName, {
80+
[`${dropdownPrefixCls}-range`]: range,
81+
})}
7782
popupStyle={popupStyle}
7883
getPopupContainer={getPopupContainer}
7984
>

src/RangePicker.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -825,6 +825,7 @@ function InnerRangePicker<DateType>(props: RangePickerProps<DateType>) {
825825
dropdownAlign={dropdownAlign}
826826
getPopupContainer={getPopupContainer}
827827
transitionName={transitionName}
828+
range
828829
>
829830
<div
830831
ref={containerRef}

0 commit comments

Comments
 (0)