1- import * as React from 'react' ;
1+ import type { BaseSelectProps , BaseSelectPropsWithoutPrivate , BaseSelectRef } from 'rc-select' ;
2+ import { BaseSelect } from 'rc-select' ;
3+ import type { DisplayValueType , Placement } from 'rc-select/lib/BaseSelect' ;
24import useId from 'rc-select/lib/hooks/useId' ;
35import { conductCheck } from 'rc-tree/lib/utils/conductUtil' ;
46import useMergedState from 'rc-util/lib/hooks/useMergedState' ;
5- import type { DisplayValueType , Placement } from 'rc-select/lib/BaseSelect' ;
6- import type { BaseSelectRef , BaseSelectPropsWithoutPrivate , BaseSelectProps } from 'rc-select' ;
7- import { BaseSelect } from 'rc-select' ;
8- import OptionList from './OptionList' ;
7+ import * as React from 'react' ;
98import CascaderContext from './context' ;
10- import { fillFieldNames , toPathKey , toPathKeys , SHOW_PARENT , SHOW_CHILD } from './utils/commonUtil' ;
119import useDisplayValues from './hooks/useDisplayValues' ;
12- import useRefFunc from './hooks/useRefFunc' ;
1310import useEntities from './hooks/useEntities' ;
14- import { formatStrategyValues , toPathOptions } from './utils/treeUtil' ;
11+ import useMissingValues from './hooks/useMissingValues' ;
12+ import useRefFunc from './hooks/useRefFunc' ;
1513import useSearchConfig from './hooks/useSearchConfig' ;
1614import useSearchOptions from './hooks/useSearchOptions' ;
17- import warning from 'rc-util/lib/warning' ;
18- import useMissingValues from './hooks/useMissingValues' ;
15+ import OptionList from './OptionList' ;
16+ import { fillFieldNames , SHOW_CHILD , SHOW_PARENT , toPathKey , toPathKeys } from './utils/commonUtil' ;
17+ import { formatStrategyValues , toPathOptions } from './utils/treeUtil' ;
18+ import warningProps , { warningNullOptions } from './utils/warningPropsUtil' ;
1919
2020export interface ShowSearchType < OptionType extends BaseOptionType = DefaultOptionType > {
2121 filter ?: ( inputValue : string , options : OptionType [ ] , fieldNames : FieldNames ) => boolean ;
@@ -134,7 +134,7 @@ export type CascaderProps<OptionType extends BaseOptionType = DefaultOptionType>
134134 | SingleCascaderProps < OptionType >
135135 | MultipleCascaderProps < OptionType > ;
136136
137- type InternalCascaderProps < OptionType extends BaseOptionType = DefaultOptionType > = Omit <
137+ export type InternalCascaderProps < OptionType extends BaseOptionType = DefaultOptionType > = Omit <
138138 SingleCascaderProps < OptionType > | MultipleCascaderProps < OptionType > ,
139139 'onChange'
140140> & {
@@ -412,22 +412,6 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
412412 } ;
413413
414414 // ============================ Open ============================
415- if ( process . env . NODE_ENV !== 'production' ) {
416- warning (
417- ! onPopupVisibleChange ,
418- '`onPopupVisibleChange` is deprecated. Please use `onDropdownVisibleChange` instead.' ,
419- ) ;
420- warning ( popupVisible === undefined , '`popupVisible` is deprecated. Please use `open` instead.' ) ;
421- warning (
422- popupClassName === undefined ,
423- '`popupClassName` is deprecated. Please use `dropdownClassName` instead.' ,
424- ) ;
425- warning (
426- popupPlacement === undefined ,
427- '`popupPlacement` is deprecated. Please use `placement` instead.' ,
428- ) ;
429- }
430-
431415 const mergedOpen = open !== undefined ? open : popupVisible ;
432416
433417 const mergedDropdownClassName = dropdownClassName || popupClassName ;
@@ -439,6 +423,12 @@ const Cascader = React.forwardRef<CascaderRef, InternalCascaderProps>((props, re
439423 onPopupVisibleChange ?.( nextVisible ) ;
440424 } ;
441425
426+ // ========================== Warning ===========================
427+ if ( process . env . NODE_ENV !== 'production' ) {
428+ warningProps ( props ) ;
429+ warningNullOptions ( mergedOptions , mergedFieldNames ) ;
430+ }
431+
442432 // ========================== Context ===========================
443433 const cascaderContext = React . useMemo (
444434 ( ) => ( {
0 commit comments