mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
chore: prettier components (#36171)
This commit is contained in:
parent
15b8b85ce8
commit
2c2c631bfd
@ -1,7 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import useState from 'rc-util/lib/hooks/useState';
|
||||
import * as React from 'react';
|
||||
import Button from '../button';
|
||||
import type { LegacyButtonType, ButtonProps } from '../button/button';
|
||||
import type { ButtonProps, LegacyButtonType } from '../button/button';
|
||||
import { convertLegacyProps } from '../button/button';
|
||||
|
||||
export interface ActionButtonProps {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import scrollTo from '../scrollTo';
|
||||
import { sleep } from '../../../tests/utils';
|
||||
import scrollTo from '../scrollTo';
|
||||
|
||||
describe('Test ScrollTo function', () => {
|
||||
let dateNowMock;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import React from 'react';
|
||||
import TransButton from '../transButton';
|
||||
|
||||
describe('transButton component', () => {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import React from 'react';
|
||||
import useSyncState from '../hooks/useSyncState';
|
||||
|
||||
describe('Table', () => {
|
||||
|
@ -1,18 +1,18 @@
|
||||
/* eslint-disable class-methods-use-this */
|
||||
import raf from 'rc-util/lib/raf';
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import KeyCode from 'rc-util/lib/KeyCode';
|
||||
import raf from 'rc-util/lib/raf';
|
||||
import React from 'react';
|
||||
import { sleep } from '../../../tests/utils';
|
||||
import getDataOrAriaProps from '../getDataOrAriaProps';
|
||||
import delayRaf from '../raf';
|
||||
import { isStyleSupport } from '../styleChecker';
|
||||
import {
|
||||
throttleByAnimationFrame,
|
||||
throttleByAnimationFrameDecorator,
|
||||
} from '../throttleByAnimationFrame';
|
||||
import getDataOrAriaProps from '../getDataOrAriaProps';
|
||||
import Wave from '../wave';
|
||||
import TransButton from '../transButton';
|
||||
import { isStyleSupport } from '../styleChecker';
|
||||
import { sleep } from '../../../tests/utils';
|
||||
import Wave from '../wave';
|
||||
|
||||
describe('Test utils function', () => {
|
||||
describe('throttle', () => {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import Wave from '../wave';
|
||||
import ConfigProvider from '../../config-provider';
|
||||
import React from 'react';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import { sleep } from '../../../tests/utils';
|
||||
import ConfigProvider from '../../config-provider';
|
||||
import Wave from '../wave';
|
||||
|
||||
describe('Wave component', () => {
|
||||
mountTest(Wave);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { CSSMotionProps, MotionEventHandler, MotionEndEventHandler } from 'rc-motion';
|
||||
import type { CSSMotionProps, MotionEndEventHandler, MotionEventHandler } from 'rc-motion';
|
||||
import type { MotionEvent } from 'rc-motion/lib/interface';
|
||||
import { tuple } from './type';
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
import raf from 'rc-util/lib/raf';
|
||||
import getScroll, { isWindow } from './getScroll';
|
||||
import { easeInOutCubic } from './easings';
|
||||
import getScroll, { isWindow } from './getScroll';
|
||||
|
||||
interface ScrollToOptions {
|
||||
/** Scroll container, default as window */
|
||||
|
@ -3,8 +3,8 @@
|
||||
*
|
||||
* This helps accessibility reader to tread as a interactive button to operation.
|
||||
*/
|
||||
import * as React from 'react';
|
||||
import KeyCode from 'rc-util/lib/KeyCode';
|
||||
import * as React from 'react';
|
||||
|
||||
interface TransButtonProps extends React.HTMLAttributes<HTMLDivElement> {
|
||||
onClick?: (e?: React.MouseEvent<HTMLDivElement>) => void;
|
||||
|
@ -1,9 +1,9 @@
|
||||
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 { composeRef, supportRef } from 'rc-util/lib/ref';
|
||||
import * as React from 'react';
|
||||
import type { ConfigConsumerProps, CSPConfig } from '../config-provider';
|
||||
import { ConfigConsumer, ConfigContext } from '../config-provider';
|
||||
import raf from './raf';
|
||||
import { cloneElement } from './reactNode';
|
||||
|
||||
let styleForPseudo: HTMLStyleElement | null;
|
||||
|
@ -1,13 +1,13 @@
|
||||
import React from 'react';
|
||||
import type { ReactWrapper } from 'enzyme';
|
||||
import { mount } from 'enzyme';
|
||||
import React from 'react';
|
||||
import type { AffixProps, AffixState, InternalAffixClass } from '..';
|
||||
import Affix from '..';
|
||||
import { getObserverEntities } from '../utils';
|
||||
import Button from '../../button';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import accessibilityTest from '../../../tests/shared/accessibilityTest';
|
||||
import { sleep, render } from '../../../tests/utils';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import { render, sleep } from '../../../tests/utils';
|
||||
import Button from '../../button';
|
||||
import { getObserverEntities } from '../utils';
|
||||
|
||||
const events: Partial<Record<keyof HTMLElementEventMap, (ev: Partial<Event>) => void>> = {};
|
||||
|
||||
|
@ -1,17 +1,17 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import omit from 'rc-util/lib/omit';
|
||||
import ResizeObserver from 'rc-resize-observer';
|
||||
import omit from 'rc-util/lib/omit';
|
||||
import * as React from 'react';
|
||||
import type { ConfigConsumerProps } from '../config-provider';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import { throttleByAnimationFrameDecorator } from '../_util/throttleByAnimationFrame';
|
||||
|
||||
import {
|
||||
addObserveTarget,
|
||||
removeObserveTarget,
|
||||
getTargetRect,
|
||||
getFixedTop,
|
||||
getFixedBottom,
|
||||
getFixedTop,
|
||||
getTargetRect,
|
||||
removeObserveTarget,
|
||||
} from './utils';
|
||||
|
||||
function getDefaultTarget() {
|
||||
|
@ -1,20 +1,20 @@
|
||||
import * as React from 'react';
|
||||
import CloseOutlined from '@ant-design/icons/CloseOutlined';
|
||||
import CheckCircleOutlined from '@ant-design/icons/CheckCircleOutlined';
|
||||
import ExclamationCircleOutlined from '@ant-design/icons/ExclamationCircleOutlined';
|
||||
import InfoCircleOutlined from '@ant-design/icons/InfoCircleOutlined';
|
||||
import CloseCircleOutlined from '@ant-design/icons/CloseCircleOutlined';
|
||||
import CheckCircleFilled from '@ant-design/icons/CheckCircleFilled';
|
||||
import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled';
|
||||
import InfoCircleFilled from '@ant-design/icons/InfoCircleFilled';
|
||||
import CheckCircleOutlined from '@ant-design/icons/CheckCircleOutlined';
|
||||
import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';
|
||||
import CSSMotion from 'rc-motion';
|
||||
import CloseCircleOutlined from '@ant-design/icons/CloseCircleOutlined';
|
||||
import CloseOutlined from '@ant-design/icons/CloseOutlined';
|
||||
import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled';
|
||||
import ExclamationCircleOutlined from '@ant-design/icons/ExclamationCircleOutlined';
|
||||
import InfoCircleFilled from '@ant-design/icons/InfoCircleFilled';
|
||||
import InfoCircleOutlined from '@ant-design/icons/InfoCircleOutlined';
|
||||
import classNames from 'classnames';
|
||||
import CSSMotion from 'rc-motion';
|
||||
import * as React from 'react';
|
||||
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import getDataOrAriaProps from '../_util/getDataOrAriaProps';
|
||||
import ErrorBoundary from './ErrorBoundary';
|
||||
import { replaceElement } from '../_util/reactNode';
|
||||
import ErrorBoundary from './ErrorBoundary';
|
||||
|
||||
export interface AlertProps {
|
||||
/** Type of Alert styles, options:`success`, `info`, `warning`, `error` */
|
||||
|
@ -1,12 +1,12 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import memoizeOne from 'memoize-one';
|
||||
import addEventListener from 'rc-util/lib/Dom/addEventListener';
|
||||
import * as React from 'react';
|
||||
import Affix from '../affix';
|
||||
import type { ConfigConsumerProps } from '../config-provider';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import scrollTo from '../_util/scrollTo';
|
||||
import getScroll from '../_util/getScroll';
|
||||
import scrollTo from '../_util/scrollTo';
|
||||
import AnchorContext from './context';
|
||||
|
||||
export type AnchorContainer = HTMLElement | Window;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import type { AntAnchor } from './Anchor';
|
||||
import * as React from 'react';
|
||||
import type { ConfigConsumerProps } from '../config-provider';
|
||||
import { ConfigConsumer } from '../config-provider';
|
||||
import type { AntAnchor } from './Anchor';
|
||||
import AnchorContext from './context';
|
||||
|
||||
export interface AnchorLinkProps {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import Anchor from '..';
|
||||
import { fireEvent, render, sleep } from '../../../tests/utils';
|
||||
import type { InternalAnchorClass } from '../Anchor';
|
||||
import { sleep, render, fireEvent } from '../../../tests/utils';
|
||||
|
||||
const { Link } = Anchor;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { memo, useState, useRef, useContext } from 'react';
|
||||
import React, { memo, useContext, useRef, useState } from 'react';
|
||||
import { fireEvent, getNodeText, render } from '../../../tests/utils';
|
||||
import Anchor from '../Anchor';
|
||||
import AnchorContext from '../context';
|
||||
import { getNodeText, render, fireEvent } from '../../../tests/utils';
|
||||
|
||||
// we use'memo' here in order to only render inner component while context changed.
|
||||
const CacheInner = memo(() => {
|
||||
|
@ -6,11 +6,13 @@
|
||||
* - 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 'rc-util/lib/omit';
|
||||
import type { BaseSelectRef } from 'rc-select';
|
||||
import toArray from 'rc-util/lib/Children/toArray';
|
||||
import omit from 'rc-util/lib/omit';
|
||||
import * as React from 'react';
|
||||
import type { ConfigConsumerProps } from '../config-provider';
|
||||
import { ConfigConsumer } from '../config-provider';
|
||||
import type {
|
||||
BaseOptionType,
|
||||
DefaultOptionType,
|
||||
@ -18,11 +20,9 @@ import type {
|
||||
RefSelectProps,
|
||||
} from '../select';
|
||||
import Select from '../select';
|
||||
import type { ConfigConsumerProps } from '../config-provider';
|
||||
import { ConfigConsumer } from '../config-provider';
|
||||
import warning from '../_util/warning';
|
||||
import { isValidElement } from '../_util/reactNode';
|
||||
import type { InputStatus } from '../_util/statusUtils';
|
||||
import warning from '../_util/warning';
|
||||
|
||||
const { Option } = Select;
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
import { mount } from 'enzyme';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { mount } from 'enzyme';
|
||||
import { render, fireEvent } from '../../../tests/utils';
|
||||
import Avatar from '..';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import { fireEvent, render } from '../../../tests/utils';
|
||||
import useBreakpoint from '../../grid/hooks/useBreakpoint';
|
||||
|
||||
jest.mock('../../grid/hooks/useBreakpoint');
|
||||
|
@ -1,10 +1,10 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import toArray from 'rc-util/lib/Children/toArray';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import Avatar from './avatar';
|
||||
import Popover from '../popover';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
import Avatar from './avatar';
|
||||
import type { AvatarSize } from './SizeContext';
|
||||
import { SizeContextProvider } from './SizeContext';
|
||||
|
||||
|
@ -5,6 +5,7 @@ import Group from './group';
|
||||
|
||||
export { AvatarProps } from './avatar';
|
||||
export { GroupProps } from './group';
|
||||
export { Group };
|
||||
|
||||
interface CompoundedComponent
|
||||
extends ForwardRefExoticComponent<AvatarProps & RefAttributes<HTMLElement>> {
|
||||
@ -14,5 +15,4 @@ interface CompoundedComponent
|
||||
const Avatar = InternalAvatar as CompoundedComponent;
|
||||
Avatar.Group = Group;
|
||||
|
||||
export { Group };
|
||||
export default Avatar;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import { sleep, render, fireEvent } from '../../../tests/utils';
|
||||
import BackTop from '..';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import BackTop from '..';
|
||||
import { fireEvent, render, sleep } from '../../../tests/utils';
|
||||
|
||||
describe('BackTop', () => {
|
||||
mountTest(BackTop);
|
||||
|
@ -1,15 +1,15 @@
|
||||
import * as React from 'react';
|
||||
import VerticalAlignTopOutlined from '@ant-design/icons/VerticalAlignTopOutlined';
|
||||
import classNames from 'classnames';
|
||||
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 'rc-util/lib/omit';
|
||||
import VerticalAlignTopOutlined from '@ant-design/icons/VerticalAlignTopOutlined';
|
||||
import { throttleByAnimationFrame } from '../_util/throttleByAnimationFrame';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import getScroll from '../_util/getScroll';
|
||||
import scrollTo from '../_util/scrollTo';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
import scrollTo from '../_util/scrollTo';
|
||||
import { throttleByAnimationFrame } from '../_util/throttleByAnimationFrame';
|
||||
|
||||
export interface BackTopProps {
|
||||
visibilityHeight?: number;
|
||||
|
@ -1,7 +1,7 @@
|
||||
@media screen and (max-width: @screen-md) {
|
||||
.@{backtop-prefix-cls} {
|
||||
right: 60px;
|
||||
|
||||
|
||||
&-rtl {
|
||||
right: auto;
|
||||
left: 60px;
|
||||
@ -12,7 +12,7 @@
|
||||
@media screen and (max-width: @screen-xs) {
|
||||
.@{backtop-prefix-cls} {
|
||||
right: 20px;
|
||||
|
||||
|
||||
&-rtl {
|
||||
right: auto;
|
||||
left: 20px;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import type { LiteralUnion } from '../_util/type';
|
||||
import type { PresetColorType } from '../_util/colors';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import type { PresetColorType } from '../_util/colors';
|
||||
import type { LiteralUnion } from '../_util/type';
|
||||
import { isPresetColor } from './utils';
|
||||
|
||||
type RibbonPlacement = 'start' | 'end';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
import SingleNumber from './SingleNumber';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import * as React from 'react';
|
||||
|
||||
export interface UnitNumberProps {
|
||||
prefixCls: string;
|
||||
|
@ -1,10 +1,10 @@
|
||||
import { fireEvent, render } from '@testing-library/react';
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { fireEvent, render } from '@testing-library/react';
|
||||
import Badge from '../index';
|
||||
import Tooltip from '../../tooltip';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import Tooltip from '../../tooltip';
|
||||
import Badge from '../index';
|
||||
|
||||
describe('Badge', () => {
|
||||
mountTest(Badge);
|
||||
|
@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import { render } from '@testing-library/react';
|
||||
import Badge from '../index';
|
||||
import React from 'react';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import Badge from '../index';
|
||||
|
||||
describe('Ribbon', () => {
|
||||
mountTest(Badge.Ribbon);
|
||||
|
@ -1,13 +1,13 @@
|
||||
import classNames from 'classnames';
|
||||
import CSSMotion from 'rc-motion';
|
||||
import * as React from 'react';
|
||||
import { useMemo, useRef } from 'react';
|
||||
import CSSMotion from 'rc-motion';
|
||||
import classNames from 'classnames';
|
||||
import ScrollNumber from './ScrollNumber';
|
||||
import Ribbon from './Ribbon';
|
||||
import type { PresetColorType, PresetStatusColorType } from '../_util/colors';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import type { LiteralUnion } from '../_util/type';
|
||||
import type { PresetColorType, PresetStatusColorType } from '../_util/colors';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
import type { LiteralUnion } from '../_util/type';
|
||||
import Ribbon from './Ribbon';
|
||||
import ScrollNumber from './ScrollNumber';
|
||||
import { isPresetColor } from './utils';
|
||||
|
||||
export { ScrollNumberProps } from './ScrollNumber';
|
||||
|
@ -1,12 +1,12 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import toArray from 'rc-util/lib/Children/toArray';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import Menu from '../menu';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
import warning from '../_util/warning';
|
||||
import BreadcrumbItem from './BreadcrumbItem';
|
||||
import BreadcrumbSeparator from './BreadcrumbSeparator';
|
||||
import Menu from '../menu';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import warning from '../_util/warning';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
|
||||
export interface Route {
|
||||
path: string;
|
||||
|
@ -1,9 +1,9 @@
|
||||
import * as React from 'react';
|
||||
import DownOutlined from '@ant-design/icons/DownOutlined';
|
||||
import * as React from 'react';
|
||||
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import type { DropdownProps } from '../dropdown/dropdown';
|
||||
import Dropdown from '../dropdown/dropdown';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
|
||||
export interface BreadcrumbItemProps {
|
||||
prefixCls?: string;
|
||||
|
@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { render } from '../../../tests/utils';
|
||||
import Breadcrumb from '../index';
|
||||
import React from 'react';
|
||||
import accessibilityTest from '../../../tests/shared/accessibilityTest';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import accessibilityTest from '../../../tests/shared/accessibilityTest';
|
||||
import { render } from '../../../tests/utils';
|
||||
import Breadcrumb from '../index';
|
||||
|
||||
describe('Breadcrumb', () => {
|
||||
mountTest(Breadcrumb);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import { Route, Routes, Link, useLocation, useNavigate, MemoryRouter } from 'react-router-dom';
|
||||
import { mount } from 'enzyme';
|
||||
import React from 'react';
|
||||
import { Link, MemoryRouter, Route, Routes, useLocation, useNavigate } from 'react-router-dom';
|
||||
import Breadcrumb from '../index';
|
||||
|
||||
const Apps = () => (
|
||||
|
@ -2,5 +2,5 @@ import '../../style/index.less';
|
||||
import './index.less';
|
||||
|
||||
// style dependencies
|
||||
import '../../menu/style';
|
||||
import '../../dropdown/style';
|
||||
import '../../menu/style';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import CSSMotion from 'rc-motion';
|
||||
import LoadingOutlined from '@ant-design/icons/LoadingOutlined';
|
||||
import CSSMotion from 'rc-motion';
|
||||
import React from 'react';
|
||||
|
||||
export interface LoadingIconProps {
|
||||
prefixCls: string;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React, { useState } from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { fireEvent, render } from '../../../tests/utils';
|
||||
import Button from '../button';
|
||||
import { render, fireEvent } from '../../../tests/utils';
|
||||
|
||||
const specialDelay = 9529;
|
||||
const Content = () => {
|
||||
|
@ -1,13 +1,13 @@
|
||||
import React, { Component } from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { SearchOutlined } from '@ant-design/icons';
|
||||
import { mount } from 'enzyme';
|
||||
import { resetWarned } from 'rc-util/lib/warning';
|
||||
import React, { Component } from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import Button from '..';
|
||||
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 { fireEvent, render, sleep } from '../../../tests/utils';
|
||||
import ConfigProvider from '../../config-provider';
|
||||
import type { SizeType } from '../../config-provider/SizeContext';
|
||||
|
||||
describe('Button', () => {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import Button from '..';
|
||||
import { sleep, render, fireEvent } from '../../../tests/utils';
|
||||
import { fireEvent, render, sleep } from '../../../tests/utils';
|
||||
|
||||
// Mock Wave ref
|
||||
let waveInstanceMock: any;
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import type { SizeType } from '../config-provider/SizeContext';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import type { SizeType } from '../config-provider/SizeContext';
|
||||
import warning from '../_util/warning';
|
||||
|
||||
export interface ButtonGroupProps {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import Button from './button';
|
||||
|
||||
export { SizeType as ButtonSize } from '../config-provider/SizeContext';
|
||||
export { ButtonProps, ButtonShape, ButtonType } from './button';
|
||||
export { ButtonGroupProps } from './button-group';
|
||||
export { SizeType as ButtonSize } from '../config-provider/SizeContext';
|
||||
|
||||
export default Button;
|
||||
|
@ -1,10 +1,10 @@
|
||||
import * as React from 'react';
|
||||
import type { GenerateConfig } from 'rc-picker/lib/generate';
|
||||
import type { Locale } from 'rc-picker/lib/interface';
|
||||
import * as React from 'react';
|
||||
import { useContext, useMemo } from 'react';
|
||||
import { FormItemInputContext } from '../form/context';
|
||||
import { Button, Group } from '../radio';
|
||||
import Select from '../select';
|
||||
import { Group, Button } from '../radio';
|
||||
import type { CalendarMode } from './generateCalendar';
|
||||
|
||||
const YearSelectOffset = 10;
|
||||
|
@ -1,16 +1,16 @@
|
||||
import React from 'react';
|
||||
import Moment from 'moment';
|
||||
import momentGenerateConfig from 'rc-picker/lib/generate/moment';
|
||||
import { mount } from 'enzyme';
|
||||
import MockDate from 'mockdate';
|
||||
import Moment from 'moment';
|
||||
import momentGenerateConfig from 'rc-picker/lib/generate/moment';
|
||||
import React from 'react';
|
||||
import Calendar from '..';
|
||||
import Header from '../Header';
|
||||
import Select from '../../select';
|
||||
import Group from '../../radio/group';
|
||||
import Button from '../../radio/radioButton';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import { render, fireEvent } from '../../../tests/utils';
|
||||
import { fireEvent, render } from '../../../tests/utils';
|
||||
import Group from '../../radio/group';
|
||||
import Button from '../../radio/radioButton';
|
||||
import Select from '../../select';
|
||||
import Header from '../Header';
|
||||
|
||||
describe('Calendar', () => {
|
||||
mountTest(Calendar);
|
||||
|
@ -1,19 +1,19 @@
|
||||
import * as React from 'react';
|
||||
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 type { Locale } from 'rc-picker/lib/interface';
|
||||
import type { GenerateConfig } from 'rc-picker/lib/generate';
|
||||
import type { Locale } from 'rc-picker/lib/interface';
|
||||
import type {
|
||||
PickerPanelBaseProps as RCPickerPanelBaseProps,
|
||||
PickerPanelDateProps as RCPickerPanelDateProps,
|
||||
PickerPanelTimeProps as RCPickerPanelTimeProps,
|
||||
} from 'rc-picker/lib/PickerPanel';
|
||||
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
||||
import enUS from './locale/en_US';
|
||||
import useMergedState from 'rc-util/lib/hooks/useMergedState';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
||||
import CalendarHeader from './Header';
|
||||
import enUS from './locale/en_US';
|
||||
|
||||
type InjectDefaultProps<Props> = Omit<
|
||||
Props,
|
||||
|
@ -3,6 +3,6 @@ import './index.less';
|
||||
|
||||
// style dependencies
|
||||
// deps-lint-skip: date-picker, form
|
||||
import '../../select/style';
|
||||
import '../../radio/style';
|
||||
import '../../date-picker/style';
|
||||
import '../../radio/style';
|
||||
import '../../select/style';
|
||||
|
@ -1,12 +1,12 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import omit from 'rc-util/lib/omit';
|
||||
import Tabs from '../tabs';
|
||||
import Grid from './Grid';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import SizeContext from '../config-provider/SizeContext';
|
||||
import type { TabsProps } from '../tabs';
|
||||
import Skeleton from '../skeleton';
|
||||
import type { TabsProps } from '../tabs';
|
||||
import Tabs from '../tabs';
|
||||
import Grid from './Grid';
|
||||
|
||||
export type CardType = 'inner';
|
||||
export type CardSize = 'default' | 'small';
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import * as React from 'react';
|
||||
import type { ConfigConsumerProps } from '../config-provider';
|
||||
import { ConfigConsumer } from '../config-provider';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import * as React from 'react';
|
||||
import type { ConfigConsumerProps } from '../config-provider';
|
||||
import { ConfigConsumer } from '../config-provider';
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import Card from '../index';
|
||||
import Button from '../../button/index';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import { render, fireEvent } from '../../../tests/utils';
|
||||
import { fireEvent, render } from '../../../tests/utils';
|
||||
import Button from '../../button/index';
|
||||
import Card from '../index';
|
||||
|
||||
describe('Card', () => {
|
||||
mountTest(Card);
|
||||
|
@ -1,10 +1,10 @@
|
||||
import InternalCard from './Card';
|
||||
import Grid from './Grid';
|
||||
import Meta from './Meta';
|
||||
import InternalCard from './Card';
|
||||
|
||||
export { CardProps, CardTabListType } from './Card';
|
||||
export { CardGridProps } from './Grid';
|
||||
export { CardMetaProps } from './Meta';
|
||||
export { CardProps, CardTabListType } from './Card';
|
||||
|
||||
type InternalCardType = typeof InternalCard;
|
||||
|
||||
|
@ -2,5 +2,5 @@ import '../../style/index.less';
|
||||
import './index.less';
|
||||
|
||||
// style dependencies
|
||||
import '../../tabs/style';
|
||||
import '../../skeleton/style';
|
||||
import '../../tabs/style';
|
||||
|
@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import React from 'react';
|
||||
import Carousel from '..';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import { sleep, render } from '../../../tests/utils';
|
||||
import { render, sleep } from '../../../tests/utils';
|
||||
|
||||
describe('Carousel', () => {
|
||||
mountTest(Carousel);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import type { Settings } from '@ant-design/react-slick';
|
||||
import SlickCarousel from '@ant-design/react-slick';
|
||||
import classNames from 'classnames';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
|
||||
export type CarouselEffect = 'scrollx' | 'fade';
|
||||
|
@ -1,12 +1,12 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import KeyCode from 'rc-util/lib/KeyCode';
|
||||
import React from 'react';
|
||||
import Cascader from '..';
|
||||
import ConfigProvider from '../../config-provider';
|
||||
import excludeAllWarning from '../../../tests/shared/excludeWarning';
|
||||
import focusTest from '../../../tests/shared/focusTest';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import ConfigProvider from '../../config-provider';
|
||||
|
||||
const { SHOW_CHILD, SHOW_PARENT } = Cascader;
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import omit from 'rc-util/lib/omit';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import type { CheckboxChangeEvent } from './Checkbox';
|
||||
import Checkbox from './Checkbox';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
|
||||
export type CheckboxValueType = string | number | boolean;
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import { render, fireEvent } from '../../../tests/utils';
|
||||
import Checkbox from '..';
|
||||
import focusTest from '../../../tests/shared/focusTest';
|
||||
import { resetWarned } from '../../_util/warning';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import { fireEvent, render } from '../../../tests/utils';
|
||||
import { resetWarned } from '../../_util/warning';
|
||||
|
||||
describe('Checkbox', () => {
|
||||
focusTest(Checkbox, { refFocus: true });
|
||||
|
@ -1,11 +1,11 @@
|
||||
import React, { useState } from 'react';
|
||||
import Collapse from '../../collapse';
|
||||
import Table from '../../table';
|
||||
import Checkbox from '../index';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import { render, fireEvent } from '../../../tests/utils';
|
||||
import { fireEvent, render } from '../../../tests/utils';
|
||||
import Collapse from '../../collapse';
|
||||
import Input from '../../input';
|
||||
import Table from '../../table';
|
||||
import Checkbox from '../index';
|
||||
|
||||
describe('CheckboxGroup', () => {
|
||||
mountTest(Checkbox.Group);
|
||||
|
@ -3,7 +3,7 @@ import type { CheckboxProps } from './Checkbox';
|
||||
import InternalCheckbox from './Checkbox';
|
||||
import Group from './Group';
|
||||
|
||||
export { CheckboxProps, CheckboxChangeEvent } from './Checkbox';
|
||||
export { CheckboxChangeEvent, CheckboxProps } from './Checkbox';
|
||||
export { CheckboxGroupProps, CheckboxOptionType } from './Group';
|
||||
|
||||
interface CompoundedComponent
|
||||
|
@ -1,17 +1,17 @@
|
||||
import * as React from 'react';
|
||||
import RightOutlined from '@ant-design/icons/RightOutlined';
|
||||
import classNames from 'classnames';
|
||||
import RcCollapse from 'rc-collapse';
|
||||
import type { CSSMotionProps } from 'rc-motion';
|
||||
import classNames from 'classnames';
|
||||
import RightOutlined from '@ant-design/icons/RightOutlined';
|
||||
import * as React from 'react';
|
||||
|
||||
import toArray from 'rc-util/lib/Children/toArray';
|
||||
import omit from 'rc-util/lib/omit';
|
||||
import type { CollapsibleType } from './CollapsePanel';
|
||||
import CollapsePanel from './CollapsePanel';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import collapseMotion from '../_util/motion';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
import warning from '../_util/warning';
|
||||
import type { CollapsibleType } from './CollapsePanel';
|
||||
import CollapsePanel from './CollapsePanel';
|
||||
|
||||
/** @deprecated Please use `start` | `end` instead */
|
||||
type ExpandIconPositionLegacy = 'left' | 'right';
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import RcCollapse from 'rc-collapse';
|
||||
import classNames from 'classnames';
|
||||
import RcCollapse from 'rc-collapse';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import warning from '../_util/warning';
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { sleep, render } from '../../../tests/utils';
|
||||
import { render, sleep } from '../../../tests/utils';
|
||||
import { resetWarned } from '../../_util/warning';
|
||||
|
||||
describe('Collapse', () => {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import Comment from '../index';
|
||||
import React from 'react';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import Comment from '../index';
|
||||
|
||||
describe('Comment', () => {
|
||||
mountTest(Comment);
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
|
||||
export interface CommentProps {
|
||||
|
@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import React from 'react';
|
||||
import ConfigProvider from '..';
|
||||
import DatePicker from '../../date-picker';
|
||||
import Slider from '../../slider';
|
||||
import Drawer from '../../drawer';
|
||||
import Cascader from '../../cascader';
|
||||
import DatePicker from '../../date-picker';
|
||||
import Drawer from '../../drawer';
|
||||
import Slider from '../../slider';
|
||||
|
||||
describe('ConfigProvider.GetPopupContainer', () => {
|
||||
it('Datepicker', () => {
|
||||
|
@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import React from 'react';
|
||||
import { act } from 'react-dom/test-utils';
|
||||
import { render } from '../../../tests/utils';
|
||||
import ConfigProvider from '..';
|
||||
import zhCN from '../../locale/zh_CN';
|
||||
import { render } from '../../../tests/utils';
|
||||
import Form from '../../form';
|
||||
import zhCN from '../../locale/zh_CN';
|
||||
|
||||
describe('ConfigProvider.Form', () => {
|
||||
beforeAll(() => {
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { SmileOutlined } from '@ant-design/icons';
|
||||
import IconContext from '@ant-design/icons/lib/components/Context';
|
||||
import { mount } from 'enzyme';
|
||||
import React from 'react';
|
||||
import ConfigProvider from '..';
|
||||
|
||||
describe('ConfigProvider.Icon', () => {
|
||||
|
@ -1,12 +1,12 @@
|
||||
import React, { useState } from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { SmileOutlined } from '@ant-design/icons';
|
||||
import { mount } from 'enzyme';
|
||||
import React, { useState } from 'react';
|
||||
import ConfigProvider, { ConfigContext } from '..';
|
||||
import Button from '../../button';
|
||||
import Table from '../../table';
|
||||
import Input from '../../input';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import { render, fireEvent } from '../../../tests/utils';
|
||||
import { fireEvent, render } from '../../../tests/utils';
|
||||
import Button from '../../button';
|
||||
import Input from '../../input';
|
||||
import Table from '../../table';
|
||||
|
||||
describe('ConfigProvider', () => {
|
||||
mountTest(() => (
|
||||
|
@ -1,14 +1,14 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import React from 'react';
|
||||
import ConfigProvider from '..';
|
||||
import LocaleProvider from '../../locale-provider';
|
||||
import zhCN from '../../locale/zh_CN';
|
||||
import enUS from '../../locale/en_US';
|
||||
import TimePicker from '../../time-picker';
|
||||
import DatePicker from '../../date-picker';
|
||||
import { openPicker, selectCell, closePicker } from '../../date-picker/__tests__/utils';
|
||||
import Pagination from '../../pagination';
|
||||
import { closePicker, openPicker, selectCell } from '../../date-picker/__tests__/utils';
|
||||
import LocaleProvider from '../../locale-provider';
|
||||
import enUS from '../../locale/en_US';
|
||||
import zhCN from '../../locale/zh_CN';
|
||||
import Modal from '../../modal';
|
||||
import Pagination from '../../pagination';
|
||||
import TimePicker from '../../time-picker';
|
||||
|
||||
describe('ConfigProvider.Locale', () => {
|
||||
function $$(className) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React, { useState } from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import React, { useState } from 'react';
|
||||
import ConfigProvider from '..';
|
||||
import Tooltip from '../../tooltip';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import React from 'react';
|
||||
import ConfigProvider from '..';
|
||||
import Affix from '../../affix';
|
||||
import Anchor from '../../anchor';
|
||||
|
@ -1,11 +1,11 @@
|
||||
/* eslint-disable import/prefer-default-export, prefer-destructuring */
|
||||
|
||||
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 type { Theme } from './context';
|
||||
import { TinyColor } from '@ctrl/tinycolor';
|
||||
import canUseDom from 'rc-util/lib/Dom/canUseDom';
|
||||
import { updateCSS } from 'rc-util/lib/Dom/dynamicCSS';
|
||||
import warning from '../_util/warning';
|
||||
import type { Theme } from './context';
|
||||
|
||||
const dynamicStyleMark = `-ant-${Date.now()}-${Math.random()}`;
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import Empty from '../empty';
|
||||
import type { ConfigConsumerProps } from '.';
|
||||
import { ConfigConsumer } from '.';
|
||||
import Empty from '../empty';
|
||||
|
||||
const defaultRenderEmpty = (componentName?: string): React.ReactNode => (
|
||||
<ConfigConsumer>
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import moment from 'moment';
|
||||
import MockDate from 'mockdate';
|
||||
import moment from 'moment';
|
||||
import React from 'react';
|
||||
import DatePicker from '..';
|
||||
import focusTest from '../../../tests/shared/focusTest';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import React from 'react';
|
||||
import DatePicker from '..';
|
||||
import { resetWarned } from '../../_util/warning';
|
||||
|
||||
|
@ -1,11 +1,11 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import moment from 'moment';
|
||||
import React from 'react';
|
||||
import DatePicker from '..';
|
||||
import { setMockDate, resetMockDate } from '../../../tests/utils';
|
||||
import { openPicker, selectCell, closePicker } from './utils';
|
||||
import focusTest from '../../../tests/shared/focusTest';
|
||||
import { resetMockDate, setMockDate } from '../../../tests/utils';
|
||||
import enUS from '../locale/en_US';
|
||||
import { closePicker, openPicker, selectCell } from './utils';
|
||||
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import { setMockDate, resetMockDate } from '../../../tests/utils';
|
||||
import React from 'react';
|
||||
import DatePicker from '..';
|
||||
import focusTest from '../../../tests/shared/focusTest';
|
||||
import { resetMockDate, setMockDate } from '../../../tests/utils';
|
||||
|
||||
const { WeekPicker } = DatePicker;
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
import React from 'react';
|
||||
import { mount, render } from 'enzyme';
|
||||
import moment from 'moment';
|
||||
import React from 'react';
|
||||
import DatePicker from '..';
|
||||
import ConfigProvider from '../../config-provider';
|
||||
import LocaleProvider from '../../locale-provider';
|
||||
import locale from '../../locale-provider/zh_CN';
|
||||
import ConfigProvider from '../../config-provider';
|
||||
import jaJP from '../../locale/ja_JP';
|
||||
import zhTW from '../locale/zh_TW';
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import type { Moment } from 'moment';
|
||||
import * as React from 'react';
|
||||
import DatePicker from '..';
|
||||
import type { DatePickRef, RangePickerRef } from '../generatePicker/interface';
|
||||
|
||||
|
@ -1,23 +1,23 @@
|
||||
import * as React from 'react';
|
||||
import { forwardRef, useContext, useImperativeHandle } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import CalendarOutlined from '@ant-design/icons/CalendarOutlined';
|
||||
import ClockCircleOutlined from '@ant-design/icons/ClockCircleOutlined';
|
||||
import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';
|
||||
import SwapRightOutlined from '@ant-design/icons/SwapRightOutlined';
|
||||
import classNames from 'classnames';
|
||||
import { RangePicker as RCRangePicker } from 'rc-picker';
|
||||
import type { GenerateConfig } from 'rc-picker/lib/generate/index';
|
||||
import enUS from '../locale/en_US';
|
||||
import { ConfigContext } from '../../config-provider';
|
||||
import SizeContext from '../../config-provider/SizeContext';
|
||||
import DisabledContext from '../../config-provider/DisabledContext';
|
||||
import LocaleReceiver from '../../locale-provider/LocaleReceiver';
|
||||
import { getRangePlaceholder, transPlacement2DropdownAlign } from '../util';
|
||||
import * as React from 'react';
|
||||
import { forwardRef, useContext, useImperativeHandle } from 'react';
|
||||
import type { PickerLocale, RangePickerProps } from '.';
|
||||
import { Components, getTimeProps } from '.';
|
||||
import { ConfigContext } from '../../config-provider';
|
||||
import DisabledContext from '../../config-provider/DisabledContext';
|
||||
import SizeContext from '../../config-provider/SizeContext';
|
||||
import { FormItemInputContext } from '../../form/context';
|
||||
import LocaleReceiver from '../../locale-provider/LocaleReceiver';
|
||||
import { getMergedStatus, getStatusClassNames } from '../../_util/statusUtils';
|
||||
import type { PickerComponentClass, CommonPickerMethods } from './interface';
|
||||
import enUS from '../locale/en_US';
|
||||
import { getRangePlaceholder, transPlacement2DropdownAlign } from '../util';
|
||||
import type { CommonPickerMethods, PickerComponentClass } from './interface';
|
||||
|
||||
export default function generateRangePicker<DateType>(
|
||||
generateConfig: GenerateConfig<DateType>,
|
||||
|
@ -1,25 +1,25 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import CalendarOutlined from '@ant-design/icons/CalendarOutlined';
|
||||
import ClockCircleOutlined from '@ant-design/icons/ClockCircleOutlined';
|
||||
import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled';
|
||||
import classNames from 'classnames';
|
||||
import RCPicker from 'rc-picker';
|
||||
import type { PickerMode } from 'rc-picker/lib/interface';
|
||||
import type { GenerateConfig } from 'rc-picker/lib/generate/index';
|
||||
import type { PickerMode } from 'rc-picker/lib/interface';
|
||||
import * as React from 'react';
|
||||
import { forwardRef, useContext, useImperativeHandle } from 'react';
|
||||
import enUS from '../locale/en_US';
|
||||
import { getPlaceholder, transPlacement2DropdownAlign } from '../util';
|
||||
import warning from '../../_util/warning';
|
||||
import type { PickerDateProps, PickerLocale, PickerProps, PickerTimeProps } from '.';
|
||||
import { Components, getTimeProps } from '.';
|
||||
import { ConfigContext } from '../../config-provider';
|
||||
import LocaleReceiver from '../../locale-provider/LocaleReceiver';
|
||||
import SizeContext from '../../config-provider/SizeContext';
|
||||
import DisabledContext from '../../config-provider/DisabledContext';
|
||||
import type { PickerProps, PickerLocale, PickerDateProps, PickerTimeProps } from '.';
|
||||
import { getTimeProps, Components } from '.';
|
||||
import SizeContext from '../../config-provider/SizeContext';
|
||||
import { FormItemInputContext } from '../../form/context';
|
||||
import LocaleReceiver from '../../locale-provider/LocaleReceiver';
|
||||
import type { InputStatus } from '../../_util/statusUtils';
|
||||
import { getMergedStatus, getStatusClassNames } from '../../_util/statusUtils';
|
||||
import type { DatePickRef, PickerComponentClass, CommonPickerMethods } from './interface';
|
||||
import warning from '../../_util/warning';
|
||||
import enUS from '../locale/en_US';
|
||||
import { getPlaceholder, transPlacement2DropdownAlign } from '../util';
|
||||
import type { CommonPickerMethods, DatePickRef, PickerComponentClass } from './interface';
|
||||
|
||||
export default function generatePicker<DateType>(generateConfig: GenerateConfig<DateType>) {
|
||||
type DatePickerProps = PickerProps<DateType> & {
|
||||
|
@ -1,24 +1,24 @@
|
||||
import type { GenerateConfig } from 'rc-picker/lib/generate/index';
|
||||
import type { Locale as RcPickerLocale, PickerMode } from 'rc-picker/lib/interface';
|
||||
import type { SharedTimeProps } from 'rc-picker/lib/panels/TimePanel';
|
||||
import type {
|
||||
PickerBaseProps as RCPickerBaseProps,
|
||||
PickerDateProps as RCPickerDateProps,
|
||||
PickerTimeProps as RCPickerTimeProps,
|
||||
} from 'rc-picker/lib/Picker';
|
||||
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 type { PickerMode, Locale as RcPickerLocale } from 'rc-picker/lib/interface';
|
||||
import type { SizeType } from '../../config-provider/SizeContext';
|
||||
import type { TimePickerLocale } from '../../time-picker';
|
||||
import type { InputStatus } from '../../_util/statusUtils';
|
||||
import { tuple } from '../../_util/type';
|
||||
import PickerButton from '../PickerButton';
|
||||
import PickerTag from '../PickerTag';
|
||||
import type { TimePickerLocale } from '../../time-picker';
|
||||
import generateSinglePicker from './generateSinglePicker';
|
||||
import generateRangePicker from './generateRangePicker';
|
||||
import { tuple } from '../../_util/type';
|
||||
import type { InputStatus } from '../../_util/statusUtils';
|
||||
import generateSinglePicker from './generateSinglePicker';
|
||||
|
||||
export const Components = { button: PickerButton, rangeItem: PickerTag };
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
import type { ComponentClass, ForwardedRef, Component } from 'react';
|
||||
import type { Component, ComponentClass, ForwardedRef } from 'react';
|
||||
import type { PickerProps, RangePickerProps } from '.';
|
||||
|
||||
export interface CommonPickerMethods {
|
||||
|
@ -1,8 +1,8 @@
|
||||
import type { Moment } from 'moment';
|
||||
import momentGenerateConfig from 'rc-picker/lib/generate/moment';
|
||||
import type {
|
||||
PickerProps,
|
||||
PickerDateProps,
|
||||
PickerProps,
|
||||
RangePickerProps as BaseRangePickerProps,
|
||||
} from './generatePicker';
|
||||
import generatePicker from './generatePicker';
|
||||
|
@ -1,7 +1,7 @@
|
||||
import './index.less';
|
||||
|
||||
// style dependencies
|
||||
import '../../tag/style';
|
||||
import '../../button/style';
|
||||
import '../../tag/style';
|
||||
|
||||
// deps-lint-skip: form
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import * as React from 'react';
|
||||
|
||||
function notEmpty(val: any) {
|
||||
return val !== undefined && val !== null;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import * as React from 'react';
|
||||
import type { DescriptionsItemProps } from './Item';
|
||||
import Cell from './Cell';
|
||||
import type { DescriptionsContextProps } from '.';
|
||||
import { DescriptionsContext } from '.';
|
||||
import Cell from './Cell';
|
||||
import type { DescriptionsItemProps } from './Item';
|
||||
|
||||
interface CellConfig {
|
||||
component: string | [string, string];
|
||||
|
@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import MockDate from 'mockdate';
|
||||
import { mount } from 'enzyme';
|
||||
import MockDate from 'mockdate';
|
||||
import React from 'react';
|
||||
import Descriptions from '..';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import { resetWarned } from '../../_util/warning';
|
||||
|
@ -1,14 +1,14 @@
|
||||
/* eslint-disable react/no-array-index-key */
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import toArray from 'rc-util/lib/Children/toArray';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
import type { Breakpoint, ScreenMap } from '../_util/responsiveObserve';
|
||||
import ResponsiveObserve, { responsiveArray } from '../_util/responsiveObserve';
|
||||
import warning from '../_util/warning';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import Row from './Row';
|
||||
import DescriptionsItem from './Item';
|
||||
import { cloneElement } from '../_util/reactNode';
|
||||
import Row from './Row';
|
||||
|
||||
export interface DescriptionsContextProps {
|
||||
labelStyle?: React.CSSProperties;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
|
||||
export interface DividerProps {
|
||||
|
@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import { render } from '../../../tests/utils';
|
||||
import Drawer from '..';
|
||||
import ConfigProvider from '../../config-provider';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import { render } from '../../../tests/utils';
|
||||
import ConfigProvider from '../../config-provider';
|
||||
|
||||
const DrawerTest = ({ getContainer }) => (
|
||||
<div>
|
||||
|
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import Drawer from '..';
|
||||
import { fireEvent, render } from '../../../tests/utils';
|
||||
import Button from '../../button';
|
||||
import { render, fireEvent } from '../../../tests/utils';
|
||||
|
||||
class MultiDrawer extends React.Component {
|
||||
state = { visible: false, childrenDrawer: false, hasChildren: true };
|
||||
|
@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import { mount } from 'enzyme';
|
||||
import React from 'react';
|
||||
import Dropdown from '..';
|
||||
import Menu from '../../menu';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import Menu from '../../menu';
|
||||
|
||||
describe('DropdownButton', () => {
|
||||
mountTest(Dropdown.Button);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import EllipsisOutlined from '@ant-design/icons/EllipsisOutlined';
|
||||
import classNames from 'classnames';
|
||||
import * as React from 'react';
|
||||
import type { ButtonProps } from '../button';
|
||||
import Button from '../button';
|
||||
import type { ButtonHTMLType } from '../button/button';
|
||||
|
@ -1,9 +1,9 @@
|
||||
import React from 'react';
|
||||
import Empty from '..';
|
||||
import ConfigProvider from '../../config-provider';
|
||||
import { render } from '../../../tests/utils';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import { render } from '../../../tests/utils';
|
||||
import ConfigProvider from '../../config-provider';
|
||||
|
||||
describe('Empty', () => {
|
||||
mountTest(Empty);
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import LocaleReceiver from '../locale-provider/LocaleReceiver';
|
||||
import DefaultEmptyImg from './empty';
|
||||
|
@ -1,10 +1,10 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import CSSMotion, { CSSMotionList } from 'rc-motion';
|
||||
import { FormItemPrefixContext } from './context';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import type { ValidateStatus } from './FormItem';
|
||||
import collapseMotion from '../_util/motion';
|
||||
import { FormItemPrefixContext } from './context';
|
||||
import type { ValidateStatus } from './FormItem';
|
||||
|
||||
const EMPTY_LIST: React.ReactNode[] = [];
|
||||
|
||||
|
@ -1,19 +1,19 @@
|
||||
import * as React from 'react';
|
||||
import { useMemo } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import FieldForm, { List, useWatch } from 'rc-field-form';
|
||||
import type { FormProps as RcFormProps } from 'rc-field-form/lib/Form';
|
||||
import type { ValidateErrorEntity } from 'rc-field-form/lib/interface';
|
||||
import * as React from 'react';
|
||||
import { useMemo } from 'react';
|
||||
import type { Options } from 'scroll-into-view-if-needed';
|
||||
import type { ColProps } from '../grid/col';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import type { FormContextProps } from './context';
|
||||
import { FormContext } from './context';
|
||||
import type { FormLabelAlign } from './interface';
|
||||
import useForm, { FormInstance } from './hooks/useForm';
|
||||
import DisabledContext, { DisabledContextProvider } from '../config-provider/DisabledContext';
|
||||
import type { SizeType } from '../config-provider/SizeContext';
|
||||
import SizeContext, { SizeContextProvider } from '../config-provider/SizeContext';
|
||||
import DisabledContext, { DisabledContextProvider } from '../config-provider/DisabledContext';
|
||||
import type { ColProps } from '../grid/col';
|
||||
import type { FormContextProps } from './context';
|
||||
import { FormContext } from './context';
|
||||
import useForm, { FormInstance } from './hooks/useForm';
|
||||
import type { FormLabelAlign } from './interface';
|
||||
|
||||
export type RequiredMark = boolean | 'optional';
|
||||
export type FormLayout = 'horizontal' | 'inline' | 'vertical';
|
||||
|
@ -1,10 +1,10 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import * as React from 'react';
|
||||
import type { ColProps } from '../grid/col';
|
||||
import Col from '../grid/col';
|
||||
import type { ValidateStatus } from './FormItem';
|
||||
import { FormContext, FormItemPrefixContext } from './context';
|
||||
import ErrorList from './ErrorList';
|
||||
import type { ValidateStatus } from './FormItem';
|
||||
|
||||
interface FormItemInputMiscProps {
|
||||
prefixCls: string;
|
||||
|
@ -1,16 +1,16 @@
|
||||
import * as React from 'react';
|
||||
import classNames from 'classnames';
|
||||
import QuestionCircleOutlined from '@ant-design/icons/QuestionCircleOutlined';
|
||||
import classNames from 'classnames';
|
||||
import * as React from 'react';
|
||||
import type { ColProps } from '../grid/col';
|
||||
import Col from '../grid/col';
|
||||
import type { FormLabelAlign } from './interface';
|
||||
import type { FormContextProps } from './context';
|
||||
import { FormContext } from './context';
|
||||
import type { RequiredMark } from './Form';
|
||||
import { useLocaleReceiver } from '../locale-provider/LocaleReceiver';
|
||||
import defaultLocale from '../locale/default';
|
||||
import type { TooltipProps } from '../tooltip';
|
||||
import Tooltip from '../tooltip';
|
||||
import type { FormContextProps } from './context';
|
||||
import { FormContext } from './context';
|
||||
import type { RequiredMark } from './Form';
|
||||
import type { FormLabelAlign } from './interface';
|
||||
|
||||
export type WrapperTooltipProps = TooltipProps & {
|
||||
icon?: React.ReactElement;
|
||||
|
@ -1,8 +1,8 @@
|
||||
import * as React from 'react';
|
||||
import { List } from 'rc-field-form';
|
||||
import type { ValidatorRule, StoreValue } from 'rc-field-form/lib/interface';
|
||||
import warning from '../_util/warning';
|
||||
import type { StoreValue, ValidatorRule } from 'rc-field-form/lib/interface';
|
||||
import * as React from 'react';
|
||||
import { ConfigContext } from '../config-provider';
|
||||
import warning from '../_util/warning';
|
||||
import { FormItemPrefixContext } from './context';
|
||||
|
||||
export interface FormListFieldData {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user