Browse Source

chore(all): delete useless Omit define (#31661)

pull/31688/head
Zuobin Wang 3 years ago
committed by GitHub
parent
commit
7f16838631
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      components/_util/type.ts
  2. 1
      components/breadcrumb/Breadcrumb.tsx
  3. 2
      components/button/button.tsx
  4. 1
      components/card/index.tsx
  5. 1
      components/input-number/index.tsx
  6. 6
      components/input/Input.tsx
  7. 1
      components/time-picker/index.tsx
  8. 2
      components/transfer/ListBody.tsx
  9. 2
      components/typography/Title.tsx
  10. 1
      docs/react/replace-moment.en-US.md
  11. 1
      docs/react/replace-moment.zh-CN.md

1
components/_util/type.ts

@ -1,4 +1,3 @@
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
// https://stackoverflow.com/questions/46176165/ways-to-get-string-literal-type-of-array-values-without-enum-overhead
export const tuple = <T extends string[]>(...args: T) => args;

1
components/breadcrumb/Breadcrumb.tsx

@ -6,7 +6,6 @@ import BreadcrumbSeparator from './BreadcrumbSeparator';
import Menu from '../menu';
import { ConfigContext } from '../config-provider';
import devWarning from '../_util/devWarning';
import { Omit } from '../_util/type';
import { cloneElement } from '../_util/reactNode';
export interface Route {

2
components/button/button.tsx

@ -6,7 +6,7 @@ import omit from 'rc-util/lib/omit';
import Group from './button-group';
import { ConfigContext } from '../config-provider';
import Wave from '../_util/wave';
import { Omit, tuple } from '../_util/type';
import { tuple } from '../_util/type';
import devWarning from '../_util/devWarning';
import SizeContext, { SizeType } from '../config-provider/SizeContext';
import LoadingIcon from './LoadingIcon';

1
components/card/index.tsx

@ -7,7 +7,6 @@ import Tabs, { TabsProps } from '../tabs';
import Row from '../row';
import Col from '../col';
import { ConfigContext } from '../config-provider';
import { Omit } from '../_util/type';
import SizeContext from '../config-provider/SizeContext';
function getAction(actions: React.ReactNode[]) {

1
components/input-number/index.tsx

@ -5,7 +5,6 @@ import UpOutlined from '@ant-design/icons/UpOutlined';
import DownOutlined from '@ant-design/icons/DownOutlined';
import { ConfigContext } from '../config-provider';
import { Omit } from '../_util/type';
import SizeContext, { SizeType } from '../config-provider/SizeContext';
type ValueType = string | number;

6
components/input/Input.tsx

@ -5,7 +5,7 @@ import Group from './Group';
import Search from './Search';
import TextArea from './TextArea';
import Password from './Password';
import { Omit, LiteralUnion } from '../_util/type';
import { LiteralUnion } from '../_util/type';
import ClearableLabeledInput, { hasPrefixSuffix } from './ClearableLabeledInput';
import { ConfigConsumer, ConfigConsumerProps, DirectionType } from '../config-provider';
import SizeContext, { SizeType } from '../config-provider/SizeContext';
@ -67,9 +67,7 @@ export function resolveOnChange<E extends HTMLInputElement | HTMLTextAreaElement
| React.ChangeEvent<E>
| React.MouseEvent<HTMLElement, MouseEvent>
| React.CompositionEvent<HTMLElement>,
onChange:
| undefined
| ((event: React.ChangeEvent<E>) => void),
onChange: undefined | ((event: React.ChangeEvent<E>) => void),
targetValue?: string,
) {
if (!onChange) {

1
components/time-picker/index.tsx

@ -3,7 +3,6 @@ import * as React from 'react';
import DatePicker from '../date-picker';
import { PickerTimeProps, RangePickerTimeProps } from '../date-picker/generatePicker';
import devWarning from '../_util/devWarning';
import { Omit } from '../_util/type';
const { TimePicker: InternalTimePicker, RangePicker: InternalRangePicker } = DatePicker;

2
components/transfer/ListBody.tsx

@ -1,6 +1,6 @@
import * as React from 'react';
import classNames from 'classnames';
import { ElementOf, Omit, tuple } from '../_util/type';
import { ElementOf, tuple } from '../_util/type';
import Pagination from '../pagination';
import { TransferListProps, RenderedItem } from './list';
import ListItem from './ListItem';

2
components/typography/Title.tsx

@ -1,7 +1,7 @@
import * as React from 'react';
import devWarning from '../_util/devWarning';
import Base, { BlockProps } from './Base';
import { tupleNum, Omit } from '../_util/type';
import { tupleNum } from '../_util/type';
const TITLE_ELE_LIST = tupleNum(1, 2, 3, 4, 5);

1
docs/react/replace-moment.en-US.md

@ -39,7 +39,6 @@ import { Dayjs } from 'dayjs';
import * as React from 'react';
import DatePicker from './DatePicker';
import { PickerTimeProps } from 'antd/es/date-picker/generatePicker';
import { Omit } from 'antd/es/_util/type';
export interface TimePickerProps extends Omit<PickerTimeProps<Dayjs>, 'picker'> {}

1
docs/react/replace-moment.zh-CN.md

@ -39,7 +39,6 @@ import { Dayjs } from 'dayjs';
import * as React from 'react';
import DatePicker from './DatePicker';
import { PickerTimeProps } from 'antd/es/date-picker/generatePicker';
import { Omit } from 'antd/es/_util/type';
export interface TimePickerProps extends Omit<PickerTimeProps<Dayjs>, 'picker'> {}

Loading…
Cancel
Save