diff --git a/components/affix/index.tsx b/components/affix/index.tsx index 78d402a93d..5722d0c620 100644 --- a/components/affix/index.tsx +++ b/components/affix/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import ResizeObserver from 'rc-resize-observer'; import { ConfigContext, ConfigConsumerProps } from '../config-provider'; import { throttleByAnimationFrameDecorator } from '../_util/throttleByAnimationFrame'; @@ -269,7 +269,7 @@ class Affix extends React.Component { let props = omit(this.props, ['prefixCls', 'offsetTop', 'offsetBottom', 'target', 'onChange']); // Omit this since `onTestUpdatePosition` only works on test. if (process.env.NODE_ENV === 'test') { - props = omit(props, ['onTestUpdatePosition']); + props = omit(props as typeof props & { onTestUpdatePosition: any }, ['onTestUpdatePosition']); } return ( diff --git a/components/auto-complete/index.tsx b/components/auto-complete/index.tsx index ff3c2391f5..31324a4a3a 100755 --- a/components/auto-complete/index.tsx +++ b/components/auto-complete/index.tsx @@ -1,14 +1,15 @@ /** * TODO: 4.0 - * - remove `dataSource` - * - `size` not work with customizeInput - * - customizeInput not feedback `ENTER` key since accessibility enhancement + * + * - Remove `dataSource` + * - `size` not work with customizeInput + * - CustomizeInput not feedback `ENTER` key since accessibility enhancement */ import * as React from 'react'; import toArray from 'rc-util/lib/Children/toArray'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import Select, { InternalSelectProps, OptionType, RefSelectProps } from '../select'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; import devWarning from '../_util/devWarning'; @@ -115,7 +116,10 @@ const AutoComplete: React.ForwardRefRenderFunction {optionChildren} diff --git a/components/back-top/index.tsx b/components/back-top/index.tsx index 5280eae535..84f33c2c8f 100644 --- a/components/back-top/index.tsx +++ b/components/back-top/index.tsx @@ -3,7 +3,7 @@ import CSSMotion from 'rc-motion'; import addEventListener from 'rc-util/lib/Dom/addEventListener'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import VerticalAlignTopOutlined from '@ant-design/icons/VerticalAlignTopOutlined'; import { throttleByAnimationFrame } from '../_util/throttleByAnimationFrame'; import { ConfigContext } from '../config-provider'; diff --git a/components/button/button.tsx b/components/button/button.tsx index 4888d92a84..fdc7c4d56d 100644 --- a/components/button/button.tsx +++ b/components/button/button.tsx @@ -1,7 +1,7 @@ /* eslint-disable react/button-has-type */ import * as React from 'react'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import Group from './button-group'; import { ConfigContext } from '../config-provider'; @@ -262,7 +262,7 @@ const InternalButton: React.ForwardRefRenderFunction = (pr ? spaceChildren(children, isNeedInserted() && autoInsertSpace) : null; - const linkButtonRestProps = omit(rest as AnchorButtonProps, ['navigate']); + const linkButtonRestProps = omit(rest as AnchorButtonProps & { navigate: any }, ['navigate']); if (linkButtonRestProps.href !== undefined) { return ( diff --git a/components/card/index.tsx b/components/card/index.tsx index 22982d9d74..f4df15bfa0 100644 --- a/components/card/index.tsx +++ b/components/card/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import Grid from './Grid'; import Meta from './Meta'; import Tabs, { TabsProps } from '../tabs'; diff --git a/components/cascader/index.tsx b/components/cascader/index.tsx index 93a1306886..eb1da4f7cf 100644 --- a/components/cascader/index.tsx +++ b/components/cascader/index.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import RcCascader from 'rc-cascader'; import arrayTreeFilter from 'array-tree-filter'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import KeyCode from 'rc-util/lib/KeyCode'; import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; import DownOutlined from '@ant-design/icons/DownOutlined'; @@ -89,9 +89,9 @@ export interface CascaderProps { placeholder?: string; /** 输入框大小,可选 `large` `default` `small` */ size?: SizeType; - /** 输入框name */ + /** 输入框 name */ name?: string; - /** 输入框id */ + /** 输入框 id */ id?: string; /** Whether has border style */ bordered?: boolean; @@ -119,6 +119,11 @@ export interface CascaderProps { fieldNames?: FieldNamesType; suffixIcon?: React.ReactNode; dropdownRender?: (menus: React.ReactNode) => React.ReactNode; + + // Miss prop defines. + autoComplete?: string; + transitionName?: string; + children?: React.ReactElement; } export interface CascaderState { @@ -547,26 +552,32 @@ class Cascader extends React.Component { // Fix bug of https://github.com/facebook/react/pull/5004 // and https://fb.me/react-unknown-prop - const inputProps = omit(otherProps, [ - 'onChange', - 'options', - 'popupPlacement', - 'transitionName', - 'displayRender', - 'onPopupVisibleChange', - 'changeOnSelect', - 'expandTrigger', - 'popupVisible', - 'getPopupContainer', - 'loadData', - 'popupClassName', - 'filterOption', - 'renderFilteredOption', - 'sortFilteredOption', - 'notFoundContent', - 'fieldNames', - 'bordered', - ]); + const inputProps = omit( + // Not know why these props left + otherProps as typeof otherProps & { + filterOption: any; + renderFilteredOption: any; + sortFilteredOption: any; + defaultValue: any; + }, + [ + 'onChange', + 'options', + 'popupPlacement', + 'transitionName', + 'displayRender', + 'onPopupVisibleChange', + 'changeOnSelect', + 'expandTrigger', + 'popupVisible', + 'getPopupContainer', + 'loadData', + 'filterOption', + 'renderFilteredOption', + 'sortFilteredOption', + 'fieldNames', + ], + ); let { options } = props; const names: FilledFieldNamesType = getFilledFieldNames(this.props); @@ -611,12 +622,12 @@ class Cascader extends React.Component { inputIcon = ; } - const input = children || ( + const input: React.ReactElement = children || ( {this.getLabel()} 0 ? undefined : placeholder} @@ -649,7 +660,7 @@ class Cascader extends React.Component { ); const getPopupContainer = props.getPopupContainer || getContextPopupContainer; - const rest = omit(props, [ + const rest = omit(props as typeof props & { inputIcon: any; loadingIcon: any }, [ 'inputIcon', 'expandIcon', 'loadingIcon', @@ -677,7 +688,8 @@ class Cascader extends React.Component { loadingIcon={loadingIcon} popupClassName={rcCascaderPopupClassName} popupPlacement={this.getPopupPlacement(direction)} - dropdownRender={dropdownRender} + // rc-cascader should update ts define to fix this case + dropdownRender={dropdownRender as any} > {input} diff --git a/components/checkbox/Group.tsx b/components/checkbox/Group.tsx index ac1a7e2582..57f2cab9ea 100644 --- a/components/checkbox/Group.tsx +++ b/components/checkbox/Group.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import Checkbox, { CheckboxChangeEvent } from './Checkbox'; import { ConfigContext } from '../config-provider'; diff --git a/components/collapse/Collapse.tsx b/components/collapse/Collapse.tsx index 457839f0f4..9ad5c24594 100644 --- a/components/collapse/Collapse.tsx +++ b/components/collapse/Collapse.tsx @@ -5,7 +5,7 @@ import classNames from 'classnames'; import RightOutlined from '@ant-design/icons/RightOutlined'; import toArray from 'rc-util/lib/Children/toArray'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import CollapsePanel, { CollapsibleType } from './CollapsePanel'; import { ConfigContext } from '../config-provider'; import collapseMotion from '../_util/motion'; @@ -95,8 +95,8 @@ const Collapse: CollapseInterface = props => { if (child.props?.disabled) { const key = child.key || String(index); const { disabled, collapsible } = child.props; - const childProps: CollapseProps = { - ...omit(child.props, 'disabled'), + const childProps: CollapseProps & { key: React.Key } = { + ...omit(child.props, ['disabled']), key, collapsible: collapsible ?? (disabled ? 'disabled' : undefined), }; diff --git a/components/drawer/index.tsx b/components/drawer/index.tsx index 8395f457b2..386db64672 100644 --- a/components/drawer/index.tsx +++ b/components/drawer/index.tsx @@ -3,7 +3,7 @@ import RcDrawer from 'rc-drawer'; import getScrollBarSize from 'rc-util/lib/getScrollBarSize'; import CloseOutlined from '@ant-design/icons/CloseOutlined'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import { ConfigContext, DirectionType } from '../config-provider'; import { tuple } from '../_util/type'; @@ -304,7 +304,6 @@ class Drawer extends React.Component { 'footer', 'title', 'push', - 'visible', 'width', 'height', ])} diff --git a/components/form/FormItem.tsx b/components/form/FormItem.tsx index 7ac8b4d1fb..aff0594448 100644 --- a/components/form/FormItem.tsx +++ b/components/form/FormItem.tsx @@ -7,7 +7,7 @@ import { FieldProps } from 'rc-field-form/lib/Field'; import FieldContext from 'rc-field-form/lib/FieldContext'; import { Meta, NamePath } from 'rc-field-form/lib/interface'; import { supportRef } from 'rc-util/lib/ref'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import Row from '../grid/row'; import { ConfigContext } from '../config-provider'; import { tuple } from '../_util/type'; @@ -204,24 +204,19 @@ function FormItem(props: FormItemProps): React.ReactElemen 'extra', 'getValueFromEvent', 'getValueProps', - 'hasFeedback', - 'help', 'htmlFor', 'id', // It is deprecated because `htmlFor` is its replacement. 'initialValue', 'isListField', - 'label', 'labelAlign', 'labelCol', 'normalize', 'preserve', - 'required', 'tooltip', 'validateFirst', - 'validateStatus', 'valuePropName', 'wrapperCol', - '_internalItemRender', + '_internalItemRender' as any, ])} > {/* Label */} diff --git a/components/form/context.tsx b/components/form/context.tsx index c5a55d5749..294c60d314 100644 --- a/components/form/context.tsx +++ b/components/form/context.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import { FormProvider as RcFormProvider } from 'rc-field-form'; import { FormProviderProps as RcFormProviderProps } from 'rc-field-form/lib/FormContext'; import { ColProps } from '../grid/col'; @@ -35,7 +35,9 @@ export const FormItemContext = React.createContext({ }); /** Form Provider */ -export interface FormProviderProps extends Omit {} +export interface FormProviderProps extends Omit { + prefixCls?: string; +} export const FormProvider: React.FC = props => { const providerProps = omit(props, ['prefixCls']); diff --git a/components/input/Input.tsx b/components/input/Input.tsx index bf96da2638..9e85e91a2a 100644 --- a/components/input/Input.tsx +++ b/components/input/Input.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import Group from './Group'; import Search from './Search'; import TextArea from './TextArea'; @@ -266,7 +266,7 @@ class Input extends React.Component { ) => { const { className, addonBefore, addonAfter, size: customizeSize, disabled } = this.props; // Fix https://fb.me/react-unknown-prop - const otherProps = omit(this.props, [ + const otherProps = omit(this.props as InputProps & { inputType: any }, [ 'prefixCls', 'onPressEnter', 'addonBefore', diff --git a/components/input/Password.tsx b/components/input/Password.tsx index dd2dd4710f..efcf854746 100644 --- a/components/input/Password.tsx +++ b/components/input/Password.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import EyeOutlined from '@ant-design/icons/EyeOutlined'; import EyeInvisibleOutlined from '@ant-design/icons/EyeInvisibleOutlined'; @@ -20,7 +20,7 @@ const ActionMap: Record = { hover: 'onMouseOver', }; -const Password = React.forwardRef((props, ref) => { +const Password = React.forwardRef((props, ref) => { const [visible, setVisible] = useState(false); const onVisibleChange = () => { @@ -78,7 +78,7 @@ const Password = React.forwardRef((props, ref) => { className: inputClassName, prefixCls: inputPrefixCls, suffix: suffixIcon, - }; + } as InputProps; if (size) { omittedProps.size = size; diff --git a/components/input/TextArea.tsx b/components/input/TextArea.tsx index 9953c95c0b..a47ef364df 100644 --- a/components/input/TextArea.tsx +++ b/components/input/TextArea.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import RcTextArea, { TextAreaProps as RcTextAreaProps } from 'rc-textarea'; import ResizableTextArea from 'rc-textarea/lib/ResizableTextArea'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import classNames from 'classnames'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; import ClearableLabeledInput from './ClearableLabeledInput'; @@ -44,7 +44,7 @@ const TextArea = React.forwardRef( const { getPrefixCls, direction } = React.useContext(ConfigContext); const size = React.useContext(SizeContext); - const innerRef = React.useRef(); + const innerRef = React.useRef(null); const clearableInputRef = React.useRef(null); const [value, setValue] = useMergedState(props.defaultValue, { @@ -99,7 +99,7 @@ const TextArea = React.forwardRef( [`${prefixCls}-sm`]: size === 'small' || customizeSize === 'small', [`${prefixCls}-lg`]: size === 'large' || customizeSize === 'large', })} - style={showCount ? null : style} + style={showCount ? undefined : style} prefixCls={prefixCls} onChange={handleChange} ref={innerRef} diff --git a/components/layout/Sider.tsx b/components/layout/Sider.tsx index b17e8221f1..4d69ec5f9f 100644 --- a/components/layout/Sider.tsx +++ b/components/layout/Sider.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { useContext, useRef, useState, useEffect } from 'react'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import BarsOutlined from '@ant-design/icons/BarsOutlined'; import RightOutlined from '@ant-design/icons/RightOutlined'; import LeftOutlined from '@ant-design/icons/LeftOutlined'; diff --git a/components/menu/SubMenu.tsx b/components/menu/SubMenu.tsx index 94b7103236..efee0bd19c 100644 --- a/components/menu/SubMenu.tsx +++ b/components/menu/SubMenu.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import { SubMenu as RcSubMenu } from 'rc-menu'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import MenuContext, { MenuContextProps } from './MenuContext'; import { isValidElement } from '../_util/reactNode'; diff --git a/components/progress/progress.tsx b/components/progress/progress.tsx index c73cc99081..b282a81ff9 100644 --- a/components/progress/progress.tsx +++ b/components/progress/progress.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import CloseOutlined from '@ant-design/icons/CloseOutlined'; import CheckOutlined from '@ant-design/icons/CheckOutlined'; import CheckCircleFilled from '@ant-design/icons/CheckCircleFilled'; @@ -171,10 +171,8 @@ export default class Progress extends React.Component { 'width', 'gapDegree', 'gapPosition', - 'strokeColor', 'strokeLinecap', 'percent', - 'steps', 'success', 'successPercent', ])} diff --git a/components/select/index.tsx b/components/select/index.tsx index 166fa92200..56866e52a7 100755 --- a/components/select/index.tsx +++ b/components/select/index.tsx @@ -1,7 +1,7 @@ // TODO: 4.0 - codemod should help to change `filterOption` to support node props. import * as React from 'react'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import classNames from 'classnames'; import RcSelect, { Option, OptGroup, SelectProps as RcSelectProps } from 'rc-select'; import { OptionProps } from 'rc-select/lib/Option'; @@ -103,7 +103,7 @@ const InternalSelect = ( prefixCls, }); - const selectProps = omit(props, ['suffixIcon', 'itemIcon']); + const selectProps = omit(props as typeof props & { itemIcon: any }, ['suffixIcon', 'itemIcon']); const rcSelectRtlDropDownClassName = classNames(dropdownClassName, { [`${prefixCls}-dropdown-${direction}`]: direction === 'rtl', @@ -122,7 +122,7 @@ const InternalSelect = ( return ( - ref={ref} + ref={ref as any} virtual={virtual} dropdownMatchSelectWidth={dropdownMatchSelectWidth} {...selectProps} diff --git a/components/skeleton/Avatar.tsx b/components/skeleton/Avatar.tsx index e4f16ba4d4..1c523b2430 100644 --- a/components/skeleton/Avatar.tsx +++ b/components/skeleton/Avatar.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import classNames from 'classnames'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; import Element, { SkeletonElementProps } from './Element'; diff --git a/components/skeleton/Button.tsx b/components/skeleton/Button.tsx index c34c248b7c..f357680308 100644 --- a/components/skeleton/Button.tsx +++ b/components/skeleton/Button.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import classNames from 'classnames'; import Element, { SkeletonElementProps } from './Element'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; diff --git a/components/skeleton/Input.tsx b/components/skeleton/Input.tsx index f2d5634ea1..4287615227 100644 --- a/components/skeleton/Input.tsx +++ b/components/skeleton/Input.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import classNames from 'classnames'; import Element, { SkeletonElementProps } from './Element'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; diff --git a/components/spin/index.tsx b/components/spin/index.tsx index 9ffa735f45..95e169981d 100644 --- a/components/spin/index.tsx +++ b/components/spin/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import debounce from 'lodash/debounce'; import { ConfigConsumer, ConfigConsumerProps } from '../config-provider'; import { tuple } from '../_util/type'; diff --git a/components/steps/index.tsx b/components/steps/index.tsx index 8ac2f99e16..b02fe18d31 100644 --- a/components/steps/index.tsx +++ b/components/steps/index.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import RcSteps from 'rc-steps'; import CheckOutlined from '@ant-design/icons/CheckOutlined'; import CloseOutlined from '@ant-design/icons/CloseOutlined'; diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 5639b088df..44e6e549c9 100644 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import RcTable, { Summary } from 'rc-table'; import { TableProps as RcTableProps, INTERNAL_HOOKS } from 'rc-table/lib/Table'; import { convertChildrenToColumns } from 'rc-table/lib/hooks/useColumns'; @@ -236,11 +236,7 @@ function Table(props: TableProps) { } }; - /** - * Controlled state in `columns` is not a good idea that makes too many code (1000+ line?) to read - * state out and then put it back to title render. Move these code into `hooks` but still too - * complex. We should provides Table props like `sorter` & `filter` to handle control in next big version. - */ + /** Controlled state in `columns` is not a good idea that makes too many code (1000+ line?) to read state out and then put it back to title render. Move these code into `hooks` but still too complex. We should provides Table props like `sorter` & `filter` to handle control in next big version. */ // ============================ Sorter ============================= const onSorterChange = ( diff --git a/components/tag/index.tsx b/components/tag/index.tsx index 4130fe7e28..583790b409 100644 --- a/components/tag/index.tsx +++ b/components/tag/index.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import CloseOutlined from '@ant-design/icons/CloseOutlined'; import CheckableTag from './CheckableTag'; @@ -36,7 +36,7 @@ export interface TagType CheckableTag: typeof CheckableTag; } -const InternalTag: React.ForwardRefRenderFunction = ( +const InternalTag: React.ForwardRefRenderFunction = ( { prefixCls: customizePrefixCls, className, diff --git a/components/transfer/list.tsx b/components/transfer/list.tsx index b5a5685ef8..5ce325c4ad 100644 --- a/components/transfer/list.tsx +++ b/components/transfer/list.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import classNames from 'classnames'; import DownOutlined from '@ant-design/icons/DownOutlined'; import Checkbox from '../checkbox'; diff --git a/components/tree-select/index.tsx b/components/tree-select/index.tsx index 00c5ee145b..09d3a4460e 100644 --- a/components/tree-select/index.tsx +++ b/components/tree-select/index.tsx @@ -7,7 +7,7 @@ import RcTreeSelect, { TreeSelectProps as RcTreeSelectProps, } from 'rc-tree-select'; import classNames from 'classnames'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import { DefaultValueType } from 'rc-tree-select/lib/interface'; import { ConfigContext } from '../config-provider'; import devWarning from '../_util/devWarning'; @@ -90,7 +90,7 @@ const InternalTreeSelect = ( const isMultiple = !!(treeCheckable || multiple); // ===================== Icons ===================== - const { suffixIcon, itemIcon, removeIcon, clearIcon } = getIcons({ + const { suffixIcon, removeIcon, clearIcon } = getIcons({ ...props, multiple: isMultiple, prefixCls, @@ -105,7 +105,7 @@ const InternalTreeSelect = ( } // ==================== Render ===================== - const selectProps = omit(props, [ + const selectProps = omit(props as typeof props & { itemIcon: any; switcherIcon: any }, [ 'suffixIcon', 'itemIcon', 'removeIcon', @@ -130,7 +130,7 @@ const InternalTreeSelect = ( virtual={virtual} dropdownMatchSelectWidth={dropdownMatchSelectWidth} {...selectProps} - ref={ref} + ref={ref as any} prefixCls={prefixCls} className={mergedClassName} listHeight={listHeight} @@ -139,14 +139,13 @@ const InternalTreeSelect = ( treeCheckable ? : treeCheckable } inputIcon={suffixIcon} - menuItemSelectedIcon={itemIcon} multiple={multiple} removeIcon={removeIcon} clearIcon={clearIcon} switcherIcon={(nodeProps: AntTreeNodeProps) => renderSwitcherIcon(treePrefixCls, switcherIcon, treeLine, nodeProps) } - showTreeIcon={treeIcon} + showTreeIcon={treeIcon as any} notFoundContent={mergedNotFound} getPopupContainer={getPopupContainer || getContextPopupContainer} treeMotion={null} diff --git a/components/typography/Base.tsx b/components/typography/Base.tsx index bc4a09f33c..2a2fa8981f 100644 --- a/components/typography/Base.tsx +++ b/components/typography/Base.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import classNames from 'classnames'; import toArray from 'rc-util/lib/Children/toArray'; import copy from 'copy-to-clipboard'; -import omit from 'omit.js'; +import omit from 'rc-util/lib/omit'; import EditOutlined from '@ant-design/icons/EditOutlined'; import CheckOutlined from '@ant-design/icons/CheckOutlined'; import CopyOutlined from '@ant-design/icons/CopyOutlined'; @@ -456,8 +456,9 @@ class Base extends React.Component { 'underline', 'strong', 'keyboard', - ...configConsumerProps, - ]); + ...(configConsumerProps as any), + ]) as any; + const cssEllipsis = this.canUseCSSEllipsis(); const cssTextOverflow = rows === 1 && cssEllipsis; const cssLineClamp = rows && rows > 1 && cssEllipsis; @@ -519,7 +520,7 @@ class Base extends React.Component { )} style={{ ...style, - WebkitLineClamp: cssLineClamp ? rows : null, + WebkitLineClamp: cssLineClamp ? rows : undefined, }} component={component} ref={this.contentRef} diff --git a/package.json b/package.json index bfaf115efc..2253a85c41 100644 --- a/package.json +++ b/package.json @@ -116,7 +116,6 @@ "copy-to-clipboard": "^3.2.0", "lodash": "^4.17.20", "moment": "^2.25.3", - "omit.js": "^2.0.2", "rc-cascader": "~1.4.0", "rc-checkbox": "~2.3.0", "rc-collapse": "~3.1.0", @@ -146,7 +145,7 @@ "rc-tree": "~4.1.0", "rc-tree-select": "~4.3.0", "rc-upload": "~3.3.4", - "rc-util": "^5.6.6", + "rc-util": "^5.7.0", "scroll-into-view-if-needed": "^2.2.25", "warning": "^4.0.3" }, diff --git a/typings/custom-typings.d.ts b/typings/custom-typings.d.ts index c0d2123070..02d7d9ac40 100644 --- a/typings/custom-typings.d.ts +++ b/typings/custom-typings.d.ts @@ -18,8 +18,6 @@ declare module 'jsonml.js/*'; declare module 'rc-pagination/*'; -declare module 'omit.js'; - declare module 'rc-animate*'; declare module 'rc-util*';