Skip to content

Commit

Permalink
chore: rename popupColumn
Browse files Browse the repository at this point in the history
  • Loading branch information
committed Jun 21, 2023
1 parent 93a5421 commit 8dd950a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
18 changes: 9 additions & 9 deletions src/Cascader.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { BuildInPlacements } from '@rc-component/trigger/lib/interface';
import type { BaseSelectProps, BaseSelectPropsWithoutPrivate, BaseSelectRef } from 'rc-select';
import type { BaseSelectProps,BaseSelectPropsWithoutPrivate,BaseSelectRef } from 'rc-select';
import { BaseSelect } from 'rc-select';
import type { DisplayValueType, Placement } from 'rc-select/lib/BaseSelect';
import type { DisplayValueType,Placement } from 'rc-select/lib/BaseSelect';
import useId from 'rc-select/lib/hooks/useId';
import { conductCheck } from 'rc-tree/lib/utils/conductUtil';
import useMergedState from 'rc-util/lib/hooks/useMergedState';
Expand All @@ -14,9 +14,9 @@ import useRefFunc from './hooks/useRefFunc';
import useSearchConfig from './hooks/useSearchConfig';
import useSearchOptions from './hooks/useSearchOptions';
import OptionList from './OptionList';
import { fillFieldNames, SHOW_CHILD, SHOW_PARENT, toPathKey, toPathKeys } from './utils/commonUtil';
import { formatStrategyValues, toPathOptions } from './utils/treeUtil';
import warningProps, { warningNullOptions } from './utils/warningPropsUtil';
import { fillFieldNames,SHOW_CHILD,SHOW_PARENT,toPathKey,toPathKeys } from './utils/commonUtil';
import { formatStrategyValues,toPathOptions } from './utils/treeUtil';
import warningProps,{ warningNullOptions } from './utils/warningPropsUtil';

export interface ShowSearchType<OptionType extends BaseOptionType = DefaultOptionType> {
filter?: (inputValue: string, options: OptionType[], fieldNames: FieldNames) => boolean;
Expand Down Expand Up @@ -97,13 +97,13 @@ export interface BaseCascaderProps<OptionType extends BaseOptionType = DefaultOp
/** @deprecated Use `dropdownClassName` instead */
popupClassName?: string;
dropdownClassName?: string;
/** @deprecated Use `styles.dropdownMenuColumn` instead */
/** @deprecated Use `styles.popupColumn` instead */
dropdownMenuColumnStyle?: React.CSSProperties;

// styles
styles?: {
popup?: React.CSSProperties;
popupMenuColumn?: React.CSSProperties;
popupColumn?: React.CSSProperties;
};

/** @deprecated Use `placement` instead */
Expand Down Expand Up @@ -458,7 +458,7 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
expandTrigger,
expandIcon,
loadingIcon,
dropdownMenuColumnStyle: styles?.popupMenuColumn ?? dropdownMenuColumnStyle,
dropdownMenuColumnStyle: styles?.popupColumn ?? dropdownMenuColumnStyle,
}),
[
mergedOptions,
Expand All @@ -475,7 +475,7 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
expandIcon,
loadingIcon,
dropdownMenuColumnStyle,
styles?.popupMenuColumn,
styles?.popupColumn,
],
);

Expand Down
2 changes: 1 addition & 1 deletion src/utils/warningPropsUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function warningProps(props: BaseCascaderProps) {
);
warning(
dropdownMenuColumnStyle === undefined,
'`dropdownMenuColumnStyle` is deprecated. Please use `styles.popupMenuColumn` instead.',
'`dropdownMenuColumnStyle` is deprecated. Please use `styles.popupColumn` instead.',
);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/index.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1069,7 +1069,7 @@ describe('Cascader.Basic', () => {
mount(<Cascader dropdownMenuColumnStyle={{}} options={[]} />);

expect(errorSpy).toHaveBeenCalledWith(
'Warning: `dropdownMenuColumnStyle` is deprecated. Please use `styles.popupMenuColumn` instead.',
'Warning: `dropdownMenuColumnStyle` is deprecated. Please use `styles.popupColumn` instead.',
);
errorSpy.mockReset();
});
Expand All @@ -1079,7 +1079,7 @@ describe('Cascader.Basic', () => {
<Cascader
styles={{
popup: { backgroundColor: 'red' },
popupMenuColumn: { backgroundColor: 'blue' },
popupColumn: { backgroundColor: 'blue' },
}}
options={[]}
open
Expand Down

0 comments on commit 8dd950a

Please sign in to comment.