chore: eslint add consistent-type-imports (#35419)

* chore: eslint add consistent-type-imports

* fix avatar

* Update Item.tsx
This commit is contained in:
Tom Xu 2022-05-07 14:31:54 +08:00 committed by GitHub
parent 00fb82276f
commit 1719748a29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
400 changed files with 782 additions and 649 deletions

View File

@ -31,6 +31,7 @@ module.exports = {
'@typescript-eslint/no-unused-vars': [2, { args: 'none' }],
'no-unused-expressions': 'off',
'@typescript-eslint/no-unused-expressions': 2,
'@typescript-eslint/consistent-type-imports': 2,
},
},
{

View File

@ -1,7 +1,8 @@
import * as React from 'react';
import useState from 'rc-util/lib/hooks/useState';
import Button from '../button';
import { LegacyButtonType, ButtonProps, convertLegacyProps } from '../button/button';
import type { LegacyButtonType, ButtonProps } from '../button/button';
import { convertLegacyProps } from '../button/button';
export interface ActionButtonProps {
type?: LegacyButtonType;

View File

@ -1,4 +1,5 @@
import { ElementOf, tuple } from './type';
import type { ElementOf } from './type';
import { tuple } from './type';
export const PresetStatusColorTypes = tuple('success', 'processing', 'error', 'default', 'warning');
// eslint-disable-next-line import/prefer-default-export

View File

@ -1,4 +1,4 @@
import * as React from 'react';
import type * as React from 'react';
export type RenderFunction = () => React.ReactNode;

View File

@ -1,5 +1,5 @@
import { CSSMotionProps, MotionEventHandler, MotionEndEventHandler } from 'rc-motion';
import { MotionEvent } from 'rc-motion/lib/interface';
import type { CSSMotionProps, MotionEventHandler, MotionEndEventHandler } from 'rc-motion';
import type { MotionEvent } from 'rc-motion/lib/interface';
import { tuple } from './type';
// ================== Collapse Motion ==================

View File

@ -1,5 +1,5 @@
import { placements } from 'rc-tooltip/lib/placements';
import { BuildInPlacements } from 'rc-trigger';
import type { BuildInPlacements } from 'rc-trigger';
const autoAdjustOverflowEnabled = {
adjustX: 1,

View File

@ -1,5 +1,5 @@
import classNames from 'classnames';
import { ValidateStatus } from '../form/FormItem';
import type { ValidateStatus } from '../form/FormItem';
import { tuple } from './type';
const InputStatuses = tuple('warning', 'error', '');

View File

@ -2,7 +2,8 @@ import * as React from 'react';
import { updateCSS } from 'rc-util/lib/Dom/dynamicCSS';
import { supportRef, composeRef } from 'rc-util/lib/ref';
import raf from './raf';
import { ConfigConsumer, ConfigConsumerProps, CSPConfig, ConfigContext } from '../config-provider';
import type { ConfigConsumerProps, CSPConfig } from '../config-provider';
import { ConfigConsumer, ConfigContext } from '../config-provider';
import { cloneElement } from './reactNode';
let styleForPseudo: HTMLStyleElement | null;

View File

@ -1,6 +1,8 @@
import React from 'react';
import { mount, ReactWrapper } from 'enzyme';
import Affix, { AffixProps, AffixState } from '..';
import type { ReactWrapper } from 'enzyme';
import { mount } from 'enzyme';
import type { AffixProps, AffixState } from '..';
import Affix from '..';
import { getObserverEntities } from '../utils';
import Button from '../../button';
import rtlTest from '../../../tests/shared/rtlTest';

View File

@ -2,7 +2,8 @@ import * as React from 'react';
import classNames from 'classnames';
import omit from 'rc-util/lib/omit';
import ResizeObserver from 'rc-resize-observer';
import { ConfigContext, ConfigConsumerProps } from '../config-provider';
import type { ConfigConsumerProps } from '../config-provider';
import { ConfigContext } from '../config-provider';
import { throttleByAnimationFrameDecorator } from '../_util/throttleByAnimationFrame';
import {

View File

@ -3,7 +3,8 @@ import classNames from 'classnames';
import memoizeOne from 'memoize-one';
import addEventListener from 'rc-util/lib/Dom/addEventListener';
import Affix from '../affix';
import { ConfigContext, ConfigConsumerProps } from '../config-provider';
import type { ConfigConsumerProps } from '../config-provider';
import { ConfigContext } from '../config-provider';
import scrollTo from '../_util/scrollTo';
import getScroll from '../_util/getScroll';
import AnchorContext from './context';

View File

@ -1,7 +1,8 @@
import * as React from 'react';
import classNames from 'classnames';
import { AntAnchor } from './Anchor';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import type { AntAnchor } from './Anchor';
import type { ConfigConsumerProps } from '../config-provider';
import { ConfigConsumer } from '../config-provider';
import AnchorContext from './context';
export interface AnchorLinkProps {

View File

@ -1,5 +1,5 @@
import * as React from 'react';
import { AntAnchor } from './Anchor';
import type { AntAnchor } from './Anchor';
const AnchorContext = React.createContext<AntAnchor>(null as any);

View File

@ -16,7 +16,7 @@ Demonstration of [Lookup Patterns: Uncertain Category](https://ant.design/docs/s
```tsx
import React, { useState } from 'react';
import { Input, AutoComplete } from 'antd';
import { SelectProps } from 'antd/es/select';
import type { SelectProps } from 'antd/es/select';
function getRandomInt(max: number, min: number = 0) {
return Math.floor(Math.random() * (max - min + 1)) + min; // eslint-disable-line no-mixed-operators

View File

@ -11,16 +11,18 @@ import toArray from 'rc-util/lib/Children/toArray';
import classNames from 'classnames';
import omit from 'rc-util/lib/omit';
import type { BaseSelectRef } from 'rc-select';
import Select, {
import type {
BaseOptionType,
DefaultOptionType,
InternalSelectProps,
RefSelectProps,
} from '../select';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import Select from '../select';
import type { ConfigConsumerProps } from '../config-provider';
import { ConfigConsumer } from '../config-provider';
import devWarning from '../_util/devWarning';
import { isValidElement } from '../_util/reactNode';
import { InputStatus } from '../_util/statusUtils';
import type { InputStatus } from '../_util/statusUtils';
const { Option } = Select;

View File

@ -1,5 +1,5 @@
import * as React from 'react';
import { ScreenSizeMap } from '../_util/responsiveObserve';
import type { ScreenSizeMap } from '../_util/responsiveObserve';
export type AvatarSize = 'large' | 'small' | 'default' | number | ScreenSizeMap;

View File

@ -4,9 +4,11 @@ import ResizeObserver from 'rc-resize-observer';
import { composeRef } from 'rc-util/lib/ref';
import { ConfigContext } from '../config-provider';
import devWarning from '../_util/devWarning';
import { Breakpoint, responsiveArray } from '../_util/responsiveObserve';
import type { Breakpoint } from '../_util/responsiveObserve';
import { responsiveArray } from '../_util/responsiveObserve';
import useBreakpoint from '../grid/hooks/useBreakpoint';
import SizeContext, { AvatarSize } from './SizeContext';
import type { AvatarSize } from './SizeContext';
import SizeContext from './SizeContext';
export interface AvatarProps {
/** Shape of avatar, options: `circle`, `square` */

View File

@ -5,7 +5,8 @@ import { cloneElement } from '../_util/reactNode';
import { ConfigContext } from '../config-provider';
import Avatar from './avatar';
import Popover from '../popover';
import { AvatarSize, SizeContextProvider } from './SizeContext';
import type { AvatarSize } from './SizeContext';
import { SizeContextProvider } from './SizeContext';
export interface GroupProps {
className?: string;

View File

@ -1,12 +1,13 @@
import * as React from 'react';
import InternalAvatar, { AvatarProps } from './avatar';
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
import type { AvatarProps } from './avatar';
import InternalAvatar from './avatar';
import Group from './group';
export { AvatarProps } from './avatar';
export { GroupProps } from './group';
interface CompoundedComponent
extends React.ForwardRefExoticComponent<AvatarProps & React.RefAttributes<HTMLElement>> {
extends ForwardRefExoticComponent<AvatarProps & RefAttributes<HTMLElement>> {
Group: typeof Group;
}

View File

@ -1,7 +1,7 @@
import * as React from 'react';
import classNames from 'classnames';
import { LiteralUnion } from '../_util/type';
import { PresetColorType } from '../_util/colors';
import type { LiteralUnion } from '../_util/type';
import type { PresetColorType } from '../_util/colors';
import { ConfigContext } from '../config-provider';
import { isPresetColor } from './utils';

View File

@ -4,9 +4,9 @@ import CSSMotion from 'rc-motion';
import classNames from 'classnames';
import ScrollNumber from './ScrollNumber';
import Ribbon from './Ribbon';
import { PresetColorType, PresetStatusColorType } from '../_util/colors';
import type { PresetColorType, PresetStatusColorType } from '../_util/colors';
import { ConfigContext } from '../config-provider';
import { LiteralUnion } from '../_util/type';
import type { LiteralUnion } from '../_util/type';
import { cloneElement } from '../_util/reactNode';
import { isPresetColor } from './utils';

View File

@ -1,7 +1,8 @@
import * as React from 'react';
import DownOutlined from '@ant-design/icons/DownOutlined';
import Dropdown, { DropdownProps } from '../dropdown/dropdown';
import type { DropdownProps } from '../dropdown/dropdown';
import Dropdown from '../dropdown/dropdown';
import { ConfigContext } from '../config-provider';
export interface BreadcrumbItemProps {

View File

@ -8,7 +8,7 @@ import ConfigProvider from '../../config-provider';
import mountTest from '../../../tests/shared/mountTest';
import rtlTest from '../../../tests/shared/rtlTest';
import { sleep, render, fireEvent } from '../../../tests/utils';
import { SizeType } from '../../config-provider/SizeContext';
import type { SizeType } from '../../config-provider/SizeContext';
describe('Button', () => {
mountTest(Button);

View File

@ -1,6 +1,6 @@
import * as React from 'react';
import classNames from 'classnames';
import { SizeType } from '../config-provider/SizeContext';
import type { SizeType } from '../config-provider/SizeContext';
import { ConfigContext } from '../config-provider';
import devWarning from '../_util/devWarning';

View File

@ -8,7 +8,8 @@ import { ConfigContext } from '../config-provider';
import Wave from '../_util/wave';
import { tuple } from '../_util/type';
import devWarning from '../_util/devWarning';
import SizeContext, { SizeType } from '../config-provider/SizeContext';
import type { SizeType } from '../config-provider/SizeContext';
import SizeContext from '../config-provider/SizeContext';
import LoadingIcon from './LoadingIcon';
import { cloneElement } from '../_util/reactNode';

View File

@ -14,7 +14,8 @@ title:
If you need several buttons, we recommend that you use 1 primary button + n secondary buttons, and if there are more than three operations, you can group some of them into [Dropdown.Button](/components/dropdown/#components-dropdown-demo-dropdown-button).
```tsx
import { Button, Menu, Dropdown, MenuProps } from 'antd';
import type { MenuProps } from 'antd';
import { Button, Menu, Dropdown } from 'antd';
const onMenuClick: MenuProps['onClick'] = e => {
console.log('click', e);

View File

@ -1,11 +1,11 @@
import * as React from 'react';
import { GenerateConfig } from 'rc-picker/lib/generate';
import { Locale } from 'rc-picker/lib/interface';
import type { GenerateConfig } from 'rc-picker/lib/generate';
import type { Locale } from 'rc-picker/lib/interface';
import { useContext, useMemo } from 'react';
import { FormItemInputContext } from '../form/context';
import Select from '../select';
import { Group, Button } from '../radio';
import { CalendarMode } from './generateCalendar';
import type { CalendarMode } from './generateCalendar';
const YearSelectOffset = 10;
const YearSelectTotal = 20;

View File

@ -3,9 +3,9 @@ import useMergedState from 'rc-util/lib/hooks/useMergedState';
import classNames from 'classnames';
import padStart from 'lodash/padStart';
import { PickerPanel as RCPickerPanel } from 'rc-picker';
import { Locale } from 'rc-picker/lib/interface';
import { GenerateConfig } from 'rc-picker/lib/generate';
import {
import type { Locale } from 'rc-picker/lib/interface';
import type { GenerateConfig } from 'rc-picker/lib/generate';
import type {
PickerPanelBaseProps as RCPickerPanelBaseProps,
PickerPanelDateProps as RCPickerPanelDateProps,
PickerPanelTimeProps as RCPickerPanelTimeProps,

View File

@ -1,4 +1,4 @@
import { Moment } from 'moment';
import type { Moment } from 'moment';
import momentGenerateConfig from 'rc-picker/lib/generate/moment';
import generateCalendar, { CalendarProps } from './generateCalendar';

View File

@ -1,6 +1,7 @@
import * as React from 'react';
import classNames from 'classnames';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import type { ConfigConsumerProps } from '../config-provider';
import { ConfigConsumer } from '../config-provider';
export interface CardGridProps extends React.HTMLAttributes<HTMLDivElement> {
prefixCls?: string;

View File

@ -1,6 +1,7 @@
import * as React from 'react';
import classNames from 'classnames';
import { ConfigConsumer, ConfigConsumerProps } from '../config-provider';
import type { ConfigConsumerProps } from '../config-provider';
import { ConfigConsumer } from '../config-provider';
export interface CardMetaProps {
prefixCls?: string;

View File

@ -3,7 +3,8 @@ import classNames from 'classnames';
import omit from 'rc-util/lib/omit';
import Grid from './Grid';
import Meta from './Meta';
import Tabs, { TabsProps } from '../tabs';
import type { TabsProps } from '../tabs';
import Tabs from '../tabs';
import Row from '../row';
import Col from '../col';
import { ConfigContext } from '../config-provider';

View File

@ -1,5 +1,6 @@
import * as React from 'react';
import SlickCarousel, { Settings } from '@ant-design/react-slick';
import type { Settings } from '@ant-design/react-slick';
import SlickCarousel from '@ant-design/react-slick';
import classNames from 'classnames';
import { ConfigContext } from '../config-provider';

View File

@ -1,6 +1,7 @@
import { mount } from 'enzyme';
import * as React from 'react';
import Cascader, { BaseOptionType } from '..';
import type { BaseOptionType } from '..';
import Cascader from '..';
describe('Cascader.typescript', () => {
it('options value', () => {

View File

@ -19,9 +19,11 @@ import { ConfigContext } from '../config-provider';
import type { SizeType } from '../config-provider/SizeContext';
import SizeContext from '../config-provider/SizeContext';
import getIcons from '../select/utils/iconUtil';
import { getTransitionName, getTransitionDirection, SelectCommonPlacement } from '../_util/motion';
import type { SelectCommonPlacement } from '../_util/motion';
import { getTransitionName, getTransitionDirection } from '../_util/motion';
import { FormItemInputContext } from '../form/context';
import { getMergedStatus, getStatusClassNames, InputStatus } from '../_util/statusUtils';
import type { InputStatus } from '../_util/statusUtils';
import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils';
// Align the design since we use `rc-select` in root. This help:
// - List search content will show all content

View File

@ -1,7 +1,8 @@
import * as React from 'react';
import classNames from 'classnames';
import omit from 'rc-util/lib/omit';
import Checkbox, { CheckboxChangeEvent } from './Checkbox';
import type { CheckboxChangeEvent } from './Checkbox';
import Checkbox from './Checkbox';
import { ConfigContext } from '../config-provider';
export type CheckboxValueType = string | number | boolean;

View File

@ -1,5 +1,6 @@
import * as React from 'react';
import InternalCheckbox, { CheckboxProps } from './Checkbox';
import type * as React from 'react';
import type { CheckboxProps } from './Checkbox';
import InternalCheckbox from './Checkbox';
import Group from './Group';
export { CheckboxProps, CheckboxChangeEvent } from './Checkbox';

View File

@ -1,12 +1,13 @@
import * as React from 'react';
import RcCollapse from 'rc-collapse';
import { CSSMotionProps } from 'rc-motion';
import type { CSSMotionProps } from 'rc-motion';
import classNames from 'classnames';
import RightOutlined from '@ant-design/icons/RightOutlined';
import toArray from 'rc-util/lib/Children/toArray';
import omit from 'rc-util/lib/omit';
import CollapsePanel, { CollapsibleType } from './CollapsePanel';
import type { CollapsibleType } from './CollapsePanel';
import CollapsePanel from './CollapsePanel';
import { ConfigContext } from '../config-provider';
import collapseMotion from '../_util/motion';
import { cloneElement } from '../_util/reactNode';

View File

@ -1,8 +1,9 @@
import * as React from 'react';
import defaultRenderEmpty, { RenderEmptyHandler } from './renderEmpty';
import { Locale } from '../locale-provider';
import { SizeType } from './SizeContext';
import { RequiredMark } from '../form/Form';
import type { RenderEmptyHandler } from './renderEmpty';
import defaultRenderEmpty from './renderEmpty';
import type { Locale } from '../locale-provider';
import type { SizeType } from './SizeContext';
import type { RequiredMark } from '../form/Form';
export interface Theme {
primaryColor?: string;

View File

@ -4,7 +4,7 @@ import { updateCSS } from 'rc-util/lib/Dom/dynamicCSS';
import canUseDom from 'rc-util/lib/Dom/canUseDom';
import { TinyColor } from '@ctrl/tinycolor';
import { generate } from '@ant-design/colors';
import { Theme } from './context';
import type { Theme } from './context';
import devWarning from '../_util/devWarning';
const dynamicStyleMark = `-ant-${Date.now()}-${Math.random()}`;

View File

@ -1,23 +1,25 @@
import * as React from 'react';
import IconContext from '@ant-design/icons/lib/components/Context';
import { FormProvider as RcFormProvider } from 'rc-field-form';
import { ValidateMessages } from 'rc-field-form/lib/interface';
import type { ValidateMessages } from 'rc-field-form/lib/interface';
import useMemo from 'rc-util/lib/hooks/useMemo';
import { RenderEmptyHandler } from './renderEmpty';
import LocaleProvider, { ANT_MARK, Locale } from '../locale-provider';
import type { Locale } from '../locale-provider';
import LocaleProvider, { ANT_MARK } from '../locale-provider';
import LocaleReceiver from '../locale-provider/LocaleReceiver';
import type { Theme } from './context';
import {
ConfigConsumer,
ConfigContext,
CSPConfig,
DirectionType,
ConfigConsumerProps,
Theme,
} from './context';
import SizeContext, { SizeContextProvider, SizeType } from './SizeContext';
import type { SizeType } from './SizeContext';
import SizeContext, { SizeContextProvider } from './SizeContext';
import message from '../message';
import notification from '../notification';
import { RequiredMark } from '../form/Form';
import type { RequiredMark } from '../form/Form';
import { registerTheme } from './cssVariables';
import defaultLocale from '../locale/default';

View File

@ -1,6 +1,7 @@
import * as React from 'react';
import Empty from '../empty';
import { ConfigConsumer, ConfigConsumerProps } from '.';
import type { ConfigConsumerProps } from '.';
import { ConfigConsumer } from '.';
const renderEmpty = (componentName?: string): React.ReactNode => (
<ConfigConsumer>

View File

@ -1,5 +1,6 @@
import * as React from 'react';
import Button, { ButtonProps } from '../button';
import type { ButtonProps } from '../button';
import Button from '../button';
export default function PickerButton(props: ButtonProps) {
return <Button size="small" type="primary" {...props} />;

View File

@ -1,5 +1,6 @@
import * as React from 'react';
import Tag, { TagProps } from '../tag';
import type { TagProps } from '../tag';
import Tag from '../tag';
export default function PickerTag(props: TagProps) {
return <Tag color="blue" {...props} />;

View File

@ -1,7 +1,7 @@
import * as React from 'react';
import { Moment } from 'moment';
import type { Moment } from 'moment';
import DatePicker from '..';
import { DatePickRef, RangePickerRef } from '../generatePicker/interface';
import type { DatePickRef, RangePickerRef } from '../generatePicker/interface';
describe('DatePicker.typescript', () => {
it('DatePicker ref methods', () => {

View File

@ -6,16 +6,18 @@ import ClockCircleOutlined from '@ant-design/icons/ClockCircleOutlined';
import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';
import SwapRightOutlined from '@ant-design/icons/SwapRightOutlined';
import { RangePicker as RCRangePicker } from 'rc-picker';
import { GenerateConfig } from 'rc-picker/lib/generate/index';
import type { GenerateConfig } from 'rc-picker/lib/generate/index';
import enUS from '../locale/en_US';
import { ConfigConsumerProps, ConfigContext } from '../../config-provider';
import type { ConfigConsumerProps } from '../../config-provider';
import { ConfigContext } from '../../config-provider';
import SizeContext from '../../config-provider/SizeContext';
import LocaleReceiver from '../../locale-provider/LocaleReceiver';
import { getRangePlaceholder, transPlacement2DropdownAlign } from '../util';
import { Components, getTimeProps, PickerLocale, RangePickerProps } from '.';
import type { PickerLocale, RangePickerProps } from '.';
import { Components, getTimeProps } from '.';
import { FormItemInputContext } from '../../form/context';
import { getMergedStatus, getStatusClassNames } from '../../_util/statusUtils';
import { PickerComponentClass } from './interface';
import type { PickerComponentClass } from './interface';
export default function generateRangePicker<DateType>(
generateConfig: GenerateConfig<DateType>,

View File

@ -4,26 +4,22 @@ import CalendarOutlined from '@ant-design/icons/CalendarOutlined';
import ClockCircleOutlined from '@ant-design/icons/ClockCircleOutlined';
import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';
import RCPicker from 'rc-picker';
import { PickerMode } from 'rc-picker/lib/interface';
import { GenerateConfig } from 'rc-picker/lib/generate/index';
import type { PickerMode } from 'rc-picker/lib/interface';
import type { GenerateConfig } from 'rc-picker/lib/generate/index';
import { forwardRef, useContext } from 'react';
import enUS from '../locale/en_US';
import { getPlaceholder, transPlacement2DropdownAlign } from '../util';
import devWarning from '../../_util/devWarning';
import { ConfigContext, ConfigConsumerProps } from '../../config-provider';
import type { ConfigConsumerProps } from '../../config-provider';
import { ConfigContext } from '../../config-provider';
import LocaleReceiver from '../../locale-provider/LocaleReceiver';
import SizeContext from '../../config-provider/SizeContext';
import {
PickerProps,
PickerLocale,
PickerDateProps,
PickerTimeProps,
getTimeProps,
Components,
} from '.';
import type { PickerProps, PickerLocale, PickerDateProps, PickerTimeProps } from '.';
import { getTimeProps, Components } from '.';
import { FormItemInputContext } from '../../form/context';
import { getMergedStatus, getStatusClassNames, InputStatus } from '../../_util/statusUtils';
import { DatePickRef, PickerComponentClass } from './interface';
import type { InputStatus } from '../../_util/statusUtils';
import { getMergedStatus, getStatusClassNames } from '../../_util/statusUtils';
import type { DatePickRef, PickerComponentClass } from './interface';
export default function generatePicker<DateType>(generateConfig: GenerateConfig<DateType>) {
type DatePickerProps = PickerProps<DateType> & {

View File

@ -1,24 +1,24 @@
import { GenerateConfig } from 'rc-picker/lib/generate/index';
import {
import type { GenerateConfig } from 'rc-picker/lib/generate/index';
import type {
PickerBaseProps as RCPickerBaseProps,
PickerDateProps as RCPickerDateProps,
PickerTimeProps as RCPickerTimeProps,
} from 'rc-picker/lib/Picker';
import { SharedTimeProps } from 'rc-picker/lib/panels/TimePanel';
import {
import type { SharedTimeProps } from 'rc-picker/lib/panels/TimePanel';
import type {
RangePickerBaseProps as RCRangePickerBaseProps,
RangePickerDateProps as RCRangePickerDateProps,
RangePickerTimeProps as RCRangePickerTimeProps,
} from 'rc-picker/lib/RangePicker';
import { PickerMode, Locale as RcPickerLocale } from 'rc-picker/lib/interface';
import { SizeType } from '../../config-provider/SizeContext';
import type { PickerMode, Locale as RcPickerLocale } from 'rc-picker/lib/interface';
import type { SizeType } from '../../config-provider/SizeContext';
import PickerButton from '../PickerButton';
import PickerTag from '../PickerTag';
import { TimePickerLocale } from '../../time-picker';
import type { TimePickerLocale } from '../../time-picker';
import generateSinglePicker from './generateSinglePicker';
import generateRangePicker from './generateRangePicker';
import { tuple } from '../../_util/type';
import { InputStatus } from '../../_util/statusUtils';
import type { InputStatus } from '../../_util/statusUtils';
export const Components = { button: PickerButton, rangeItem: PickerTag };

View File

@ -1,5 +1,5 @@
import type { ComponentClass, ForwardedRef, Component } from 'react';
import { PickerProps, RangePickerProps } from '.';
import type { PickerProps, RangePickerProps } from '.';
export interface CommonPickerMethods {
focus: () => void;

View File

@ -1,10 +1,11 @@
import { Moment } from 'moment';
import type { Moment } from 'moment';
import momentGenerateConfig from 'rc-picker/lib/generate/moment';
import generatePicker, {
import type {
PickerProps,
PickerDateProps,
RangePickerProps as BaseRangePickerProps,
} from './generatePicker';
import generatePicker from './generatePicker';
export type DatePickerProps = PickerProps<Moment>;
export type MonthPickerProps = Omit<PickerDateProps<Moment>, 'picker'>;

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/ar_EG';
import TimePickerLocale from '../../time-picker/locale/ar_EG';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/az_AZ';
import TimePickerLocale from '../../time-picker/locale/az_AZ';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
const locale: PickerLocale = {
lang: {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/bg_BG';
import TimePickerLocale from '../../time-picker/locale/bg_BG';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/bn_BD';
import TimePickerLocale from '../../time-picker/locale/bn_BD';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/by_BY';
import TimePickerLocale from '../../time-picker/locale/by_BY';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
const locale: PickerLocale = {
lang: {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/ca_ES';
import TimePickerLocale from '../../time-picker/locale/ca_ES';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/cs_CZ';
import TimePickerLocale from '../../time-picker/locale/cs_CZ';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/da_DK';
import TimePickerLocale from '../../time-picker/locale/da_DK';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/de_DE';
import TimePickerLocale from '../../time-picker/locale/de_DE';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/el_GR';
import TimePickerLocale from '../../time-picker/locale/el_GR';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/en_GB';
import TimePickerLocale from '../../time-picker/locale/en_GB';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/en_US';
import TimePickerLocale from '../../time-picker/locale/en_US';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/es_ES';
import TimePickerLocale from '../../time-picker/locale/es_ES';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/et_EE';
import TimePickerLocale from '../../time-picker/locale/et_EE';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// 统一合并为完整的 Locale
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/fa_IR';
import TimePickerLocale from '../../time-picker/locale/fa_IR';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/fi_FI';
import TimePickerLocale from '../../time-picker/locale/fi_FI';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/fr_BE';
import TimePickerLocale from '../../time-picker/locale/fr_BE';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/fr_CA';
import TimePickerLocale from '../../time-picker/locale/fr_CA';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/fr_FR';
import TimePickerLocale from '../../time-picker/locale/fr_FR';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/ga_IE';
import TimePickerLocale from '../../time-picker/locale/ga_IE';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/gl_ES';
import TimePickerLocale from '../../time-picker/locale/gl_ES';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/he_IL';
import TimePickerLocale from '../../time-picker/locale/he_IL';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/hi_IN';
import TimePickerLocale from '../../time-picker/locale/hi_IN';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/hr_HR';
import TimePickerLocale from '../../time-picker/locale/hr_HR';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/hu_HU';
import TimePickerLocale from '../../time-picker/locale/hu_HU';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/id_ID';
import TimePickerLocale from '../../time-picker/locale/id_ID';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/is_IS';
import TimePickerLocale from '../../time-picker/locale/is_IS';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/it_IT';
import TimePickerLocale from '../../time-picker/locale/it_IT';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/ja_JP';
import TimePickerLocale from '../../time-picker/locale/ja_JP';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/ka_GE';
import TimePickerLocale from '../../time-picker/locale/ka_GE';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
const locale: PickerLocale = {
lang: {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/kk_KZ';
import TimePickerLocale from '../../time-picker/locale/kk_KZ';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/km_KH';
import TimePickerLocale from '../../time-picker/locale/km_KH';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/kmr_IQ';
import TimePickerLocale from '../../time-picker/locale/kmr_IQ';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/kn_IN';
import TimePickerLocale from '../../time-picker/locale/kn_IN';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/ko_KR';
import TimePickerLocale from '../../time-picker/locale/ko_KR';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/lt_LT';
import TimePickerLocale from '../../time-picker/locale/lt_LT';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/lv_LV';
import TimePickerLocale from '../../time-picker/locale/lv_LV';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/mk_MK';
import TimePickerLocale from '../../time-picker/locale/mk_MK';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/ml_IN';
import TimePickerLocale from '../../time-picker/locale/ml_IN';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/mn_MN';
import TimePickerLocale from '../../time-picker/locale/mn_MN';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/ms_MY';
import TimePickerLocale from '../../time-picker/locale/ms_MY';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/nb_NO';
import TimePickerLocale from '../../time-picker/locale/nb_NO';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/nl_BE';
import TimePickerLocale from '../../time-picker/locale/nl_BE';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/nl_NL';
import TimePickerLocale from '../../time-picker/locale/nl_NL';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/pl_PL';
import TimePickerLocale from '../../time-picker/locale/pl_PL';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/pt_BR';
import TimePickerLocale from '../../time-picker/locale/pt_BR';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/pt_PT';
import TimePickerLocale from '../../time-picker/locale/pt_PT';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/ro_RO';
import TimePickerLocale from '../../time-picker/locale/ro_RO';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -2,7 +2,7 @@
import CalendarLocale from 'rc-picker/lib/locale/ru_RU';
import TimePickerLocale from '../../time-picker/locale/ru_RU';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// Merge into a locale object
const locale: PickerLocale = {

View File

@ -1,6 +1,6 @@
import CalendarLocale from 'rc-picker/lib/locale/sk_SK';
import TimePickerLocale from '../../time-picker/locale/sk_SK';
import { PickerLocale } from '../generatePicker';
import type { PickerLocale } from '../generatePicker';
// 统一合并为完整的 Locale
const locale: PickerLocale = {

Some files were not shown because too many files have changed in this diff Show More