From 2c2c631bfddd7f6eee8cb76a1cdea55fcd06d17b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 22 Jun 2022 14:57:09 +0800 Subject: [PATCH] chore: prettier components (#36171) --- components/_util/ActionButton.tsx | 4 +- components/_util/__tests__/scrollTo.test.js | 2 +- .../_util/__tests__/transButton.test.js | 2 +- .../_util/__tests__/useSyncState.test.js | 2 +- components/_util/__tests__/util.test.js | 12 +- components/_util/__tests__/wave.test.js | 6 +- components/_util/motion.tsx | 2 +- components/_util/scrollTo.ts | 2 +- components/_util/transButton.tsx | 2 +- components/_util/wave.tsx | 6 +- components/affix/__tests__/Affix.test.tsx | 10 +- components/affix/index.tsx | 10 +- components/alert/index.tsx | 20 +- components/anchor/Anchor.tsx | 4 +- components/anchor/AnchorLink.tsx | 4 +- components/anchor/__tests__/Anchor.test.tsx | 2 +- .../anchor/__tests__/cached-context.test.tsx | 4 +- components/auto-complete/index.tsx | 12 +- components/avatar/__tests__/Avatar.test.js | 4 +- components/avatar/group.tsx | 6 +- components/avatar/index.tsx | 2 +- components/back-top/__tests__/index.test.js | 4 +- components/back-top/index.tsx | 10 +- components/back-top/style/responsive.less | 4 +- components/badge/Ribbon.tsx | 6 +- components/badge/ScrollNumber.tsx | 2 +- components/badge/SingleNumber.tsx | 2 +- components/badge/__tests__/index.test.tsx | 6 +- components/badge/__tests__/ribbon.test.tsx | 4 +- components/badge/index.tsx | 12 +- components/breadcrumb/Breadcrumb.tsx | 10 +- components/breadcrumb/BreadcrumbItem.tsx | 4 +- .../breadcrumb/__tests__/Breadcrumb.test.js | 8 +- .../breadcrumb/__tests__/router.test.js | 4 +- components/breadcrumb/style/index.tsx | 2 +- components/button/LoadingIcon.tsx | 4 +- .../button/__tests__/delay-timer.test.tsx | 2 +- components/button/__tests__/index.test.tsx | 10 +- components/button/__tests__/wave.test.tsx | 2 +- components/button/button-group.tsx | 4 +- components/button/index.tsx | 2 +- components/calendar/Header.tsx | 4 +- components/calendar/__tests__/index.test.js | 16 +- components/calendar/generateCalendar.tsx | 10 +- components/calendar/style/index.tsx | 4 +- components/card/Card.tsx | 8 +- components/card/Grid.tsx | 2 +- components/card/Meta.tsx | 2 +- components/card/__tests__/index.test.tsx | 6 +- components/card/index.tsx | 4 +- components/card/style/index.tsx | 2 +- components/carousel/__tests__/index.test.js | 4 +- components/carousel/index.tsx | 2 +- components/cascader/__tests__/index.test.js | 4 +- components/checkbox/Group.tsx | 4 +- .../checkbox/__tests__/checkbox.test.js | 4 +- components/checkbox/__tests__/group.test.js | 8 +- components/checkbox/index.tsx | 2 +- components/collapse/Collapse.tsx | 10 +- components/collapse/CollapsePanel.tsx | 4 +- components/collapse/__tests__/index.test.js | 4 +- components/comment/__tests__/index.test.js | 4 +- components/comment/index.tsx | 2 +- .../__tests__/container.test.js | 8 +- .../config-provider/__tests__/form.test.js | 6 +- .../config-provider/__tests__/icon.test.js | 4 +- .../config-provider/__tests__/index.test.js | 12 +- .../config-provider/__tests__/locale.test.js | 14 +- .../config-provider/__tests__/memo.test.js | 2 +- .../config-provider/__tests__/target.test.js | 2 +- components/config-provider/cssVariables.tsx | 8 +- .../config-provider/defaultRenderEmpty.tsx | 2 +- .../date-picker/__tests__/DatePicker.test.js | 4 +- .../__tests__/QuarterPicker.test.js | 2 +- .../date-picker/__tests__/RangePicker.test.js | 6 +- .../date-picker/__tests__/WeekPicker.test.js | 4 +- .../date-picker/__tests__/other.test.js | 4 +- .../date-picker/__tests__/type.test.tsx | 2 +- .../generatePicker/generateRangePicker.tsx | 20 +- .../generatePicker/generateSinglePicker.tsx | 22 +- .../date-picker/generatePicker/index.tsx | 12 +- .../date-picker/generatePicker/interface.tsx | 2 +- components/date-picker/index.tsx | 2 +- components/date-picker/style/index.tsx | 2 +- components/descriptions/Cell.tsx | 2 +- components/descriptions/Row.tsx | 4 +- .../descriptions/__tests__/index.test.js | 4 +- components/descriptions/index.tsx | 8 +- components/divider/index.tsx | 2 +- components/drawer/__tests__/Drawer.test.js | 4 +- .../drawer/__tests__/MultiDrawer.test.js | 2 +- .../__tests__/dropdown-button.test.js | 4 +- components/dropdown/dropdown-button.tsx | 4 +- components/empty/__tests__/index.test.js | 4 +- components/empty/index.tsx | 2 +- components/form/ErrorList.tsx | 6 +- components/form/Form.tsx | 16 +- components/form/FormItemInput.tsx | 4 +- components/form/FormItemLabel.tsx | 12 +- components/form/FormList.tsx | 6 +- .../form/__tests__/list-noStyle.test.tsx | 4 +- components/form/__tests__/list.test.js | 4 +- components/form/__tests__/ref.test.tsx | 4 +- components/form/hooks/useForm.ts | 6 +- components/form/hooks/useFrameState.ts | 2 +- components/form/hooks/useItemRef.ts | 2 +- components/form/index.tsx | 10 +- components/form/interface.ts | 2 +- .../__tests__/cached-row-context.test.tsx | 2 +- components/grid/__tests__/index.test.js | 4 +- components/grid/__tests__/server.test.js | 3 +- components/grid/index.tsx | 6 +- components/image/PreviewGroup.tsx | 10 +- components/index.tsx | 227 +++++++----------- .../input-number/__tests__/index.test.js | 4 +- .../input-number/__tests__/prefix.test.js | 4 +- components/input/Group.tsx | 2 +- components/input/__tests__/Password.test.js | 10 +- components/input/__tests__/Search.test.js | 26 +- components/input/__tests__/focus.test.tsx | 6 +- components/input/__tests__/index.test.tsx | 17 +- components/input/__tests__/type.test.tsx | 2 +- components/input/index.tsx | 8 +- .../__tests__/dynamic-breakpoint.test.tsx | 2 +- components/layout/__tests__/index.test.js | 6 +- components/list/Item.tsx | 8 +- components/list/__tests__/Item.test.js | 2 +- components/list/__tests__/empty.test.js | 2 +- components/list/__tests__/index.test.js | 2 +- components/list/__tests__/loading.test.js | 2 +- components/list/__tests__/pagination.test.js | 2 +- components/list/index.tsx | 18 +- components/list/style/index.tsx | 4 +- components/locale-provider/LocaleReceiver.tsx | 6 +- .../__tests__/cached-context.test.tsx | 2 +- .../locale-provider/__tests__/config.test.js | 4 +- .../locale-provider/__tests__/index.test.js | 30 +-- components/locale-provider/index.tsx | 10 +- components/locale/ar_EG.tsx | 4 +- components/locale/az_AZ.tsx | 4 +- components/locale/bg_BG.tsx | 4 +- components/locale/bn_BD.tsx | 4 +- components/locale/by_BY.tsx | 4 +- components/locale/ca_ES.tsx | 4 +- components/locale/cs_CZ.tsx | 4 +- components/locale/da_DK.tsx | 4 +- components/locale/de_DE.tsx | 4 +- components/locale/default.tsx | 4 +- components/locale/el_GR.tsx | 4 +- components/locale/en_GB.tsx | 4 +- components/locale/es_ES.tsx | 4 +- components/locale/et_EE.tsx | 4 +- components/locale/fa_IR.tsx | 4 +- components/locale/fi_FI.tsx | 4 +- components/locale/fr_BE.tsx | 4 +- components/locale/fr_CA.tsx | 4 +- components/locale/fr_FR.tsx | 4 +- components/locale/ga_IE.tsx | 4 +- components/locale/gl_ES.tsx | 4 +- components/locale/he_IL.tsx | 4 +- components/locale/hi_IN.tsx | 4 +- components/locale/hr_HR.tsx | 4 +- components/locale/hu_HU.tsx | 4 +- components/locale/hy_AM.tsx | 2 +- components/locale/id_ID.tsx | 4 +- components/locale/is_IS.tsx | 4 +- components/locale/it_IT.tsx | 4 +- components/locale/ja_JP.tsx | 4 +- components/locale/ka_GE.tsx | 4 +- components/locale/kk_KZ.tsx | 4 +- components/locale/km_KH.tsx | 4 +- components/locale/kmr_IQ.tsx | 4 +- components/locale/kn_IN.tsx | 4 +- components/locale/ko_KR.tsx | 4 +- components/locale/ku_IQ.tsx | 4 +- components/locale/lt_LT.tsx | 4 +- components/locale/lv_LV.tsx | 4 +- components/locale/mk_MK.tsx | 4 +- components/locale/ml_IN.tsx | 4 +- components/locale/mn_MN.tsx | 4 +- components/locale/ms_MY.tsx | 4 +- components/locale/nb_NO.tsx | 4 +- components/locale/ne_NP.tsx | 4 +- components/locale/nl_BE.tsx | 4 +- components/locale/nl_NL.tsx | 4 +- components/locale/pl_PL.tsx | 4 +- components/locale/pt_BR.tsx | 4 +- components/locale/pt_PT.tsx | 4 +- components/locale/ro_RO.tsx | 4 +- components/locale/ru_RU.tsx | 4 +- components/locale/sk_SK.tsx | 4 +- components/locale/sl_SI.tsx | 4 +- components/locale/sr_RS.tsx | 4 +- components/locale/sv_SE.tsx | 4 +- components/locale/ta_IN.tsx | 4 +- components/locale/th_TH.tsx | 4 +- components/locale/tk_TK.tsx | 4 +- components/locale/tr_TR.tsx | 4 +- components/locale/uk_UA.tsx | 4 +- components/locale/ur_PK.tsx | 4 +- components/locale/vi_VN.tsx | 4 +- components/locale/zh_CN.tsx | 4 +- components/locale/zh_HK.tsx | 4 +- components/locale/zh_TW.tsx | 4 +- components/mentions/__tests__/index.test.js | 2 +- components/menu/MenuDivider.tsx | 2 +- components/menu/MenuItem.tsx | 14 +- components/menu/SubMenu.tsx | 6 +- .../menu/__tests__/cached-context.test.tsx | 2 +- components/menu/__tests__/index.test.js | 14 +- components/menu/hooks/useItems.tsx | 8 +- components/message/__tests__/config.test.js | 2 +- components/message/__tests__/hooks.test.js | 2 +- components/message/__tests__/index.test.js | 6 +- components/message/hooks/useMessage.tsx | 12 +- components/message/index.tsx | 16 +- components/modal/ConfirmDialog.tsx | 10 +- components/modal/__tests__/Modal.test.tsx | 4 +- components/modal/__tests__/confirm.test.js | 8 +- components/modal/__tests__/hook.test.tsx | 8 +- components/modal/confirm.tsx | 12 +- components/modal/index.tsx | 16 +- components/modal/useModal/HookModal.tsx | 8 +- components/modal/useModal/index.tsx | 6 +- .../notification/__tests__/hooks.test.js | 2 +- .../notification/__tests__/index.test.js | 4 +- .../notification/hooks/useNotification.tsx | 10 +- components/notification/index.tsx | 12 +- .../page-header/__tests__/index.test.js | 6 +- components/page-header/index.tsx | 20 +- components/page-header/style/index.tsx | 2 +- components/pagination/Select.tsx | 3 +- components/pagination/index.tsx | 2 +- components/popconfirm/style/index.tsx | 2 +- components/popover/__tests__/index.test.js | 4 +- components/progress/Circle.tsx | 8 +- components/progress/Line.tsx | 6 +- components/progress/__tests__/index.test.js | 6 +- components/progress/progress.tsx | 14 +- components/radio/__tests__/group.test.js | 4 +- .../radio/__tests__/radio-button.test.js | 4 +- components/radio/__tests__/radio.test.js | 4 +- components/radio/group.tsx | 8 +- components/radio/index.tsx | 12 +- components/radio/interface.tsx | 4 +- components/radio/radioButton.tsx | 4 +- components/rate/style/index.less | 2 +- components/segmented/__tests__/index.test.tsx | 6 +- components/select/index.tsx | 4 +- components/select/utils/iconUtil.tsx | 10 +- components/skeleton/Avatar.tsx | 4 +- components/skeleton/Button.tsx | 6 +- components/skeleton/Element.tsx | 2 +- components/skeleton/Image.tsx | 4 +- components/skeleton/Input.tsx | 6 +- components/skeleton/Paragraph.tsx | 2 +- components/skeleton/Skeleton.tsx | 14 +- components/skeleton/Title.tsx | 2 +- components/skeleton/__tests__/index.test.js | 2 +- components/slider/SliderTooltip.tsx | 4 +- components/slider/__tests__/index.test.js | 8 +- components/slider/style/index.less | 2 +- components/space/Item.tsx | 5 +- components/space/__tests__/gap.test.js | 3 +- components/space/__tests__/index.test.js | 4 +- components/space/index.tsx | 4 +- components/spin/__tests__/delay.test.js | 2 +- components/spin/__tests__/index.test.js | 2 +- components/spin/index.tsx | 6 +- components/statistic/Countdown.tsx | 2 +- components/statistic/Number.tsx | 4 +- components/statistic/Statistic.tsx | 6 +- components/statistic/__tests__/index.test.tsx | 8 +- components/statistic/index.tsx | 2 +- components/statistic/utils.tsx | 2 +- components/steps/index.tsx | 8 +- components/switch/__tests__/index.test.js | 4 +- components/switch/__tests__/wave.test.js | 4 +- components/table/ColumnGroup.tsx | 2 +- components/table/ExpandIcon.tsx | 2 +- components/table/Table.tsx | 68 +++--- .../table/__tests__/Table.expand.test.js | 2 +- .../table/__tests__/Table.order.test.js | 2 +- .../table/__tests__/Table.pagination.test.js | 2 +- .../table/__tests__/Table.sorter.test.js | 2 +- components/table/__tests__/Table.test.js | 2 +- components/table/__tests__/empty.test.js | 2 +- components/table/__tests__/type.test.tsx | 2 +- .../table/hooks/useFilter/FilterSearch.tsx | 4 +- components/table/hooks/useFilter/index.tsx | 14 +- components/table/hooks/useLazyKVMap.ts | 2 +- components/table/hooks/useSelection.tsx | 24 +- components/table/hooks/useSorter.tsx | 28 +-- components/table/hooks/useTitleColumns.tsx | 2 +- components/table/index.tsx | 4 +- components/table/interface.tsx | 10 +- components/table/style/index.tsx | 10 +- components/table/util.ts | 2 +- components/tabs/__tests__/index.test.js | 2 +- components/tabs/index.tsx | 12 +- components/tag/CheckableTag.tsx | 2 +- components/tag/__tests__/index.test.js | 2 +- .../time-picker/__tests__/index.test.js | 4 +- components/timeline/Timeline.tsx | 8 +- components/timeline/TimelineItem.tsx | 2 +- components/tooltip/__tests__/tooltip.test.js | 10 +- components/transfer/ListBody.tsx | 10 +- components/transfer/ListItem.tsx | 8 +- .../transfer/__tests__/customize.test.js | 2 +- .../transfer/__tests__/dropdown.test.tsx | 2 +- components/transfer/__tests__/index.test.js | 12 +- components/transfer/__tests__/list.test.js | 4 +- components/transfer/__tests__/search.test.js | 8 +- components/transfer/index.tsx | 22 +- components/transfer/list.tsx | 18 +- components/transfer/operation.tsx | 2 +- components/transfer/search.tsx | 2 +- components/transfer/style/index.tsx | 6 +- .../tree-select/__tests__/index.test.js | 2 +- components/tree-select/index.tsx | 28 +-- components/tree-select/style/index.tsx | 2 +- components/tree/Tree.tsx | 10 +- components/tree/__tests__/type.test.tsx | 1 - components/tree/index.tsx | 18 +- components/tree/utils/iconUtil.tsx | 10 +- components/typography/Base/Ellipsis.tsx | 2 +- components/typography/Base/index.tsx | 24 +- components/typography/Editable.tsx | 8 +- components/typography/Text.tsx | 2 +- components/typography/Title.tsx | 2 +- components/typography/__tests__/copy.test.tsx | 4 +- .../typography/__tests__/ellipsis.test.js | 5 +- .../__tests__/enter-key-callback.test.tsx | 4 +- components/typography/__tests__/index.test.js | 14 +- components/typography/index.tsx | 6 +- components/typography/style/index.tsx | 2 +- components/upload/UploadList/ListItem.tsx | 12 +- components/upload/__tests__/dragger.test.js | 2 +- components/upload/__tests__/upload.test.js | 14 +- components/upload/index.tsx | 2 +- components/upload/interface.tsx | 4 +- components/upload/utils.tsx | 2 +- 342 files changed, 1081 insertions(+), 1147 deletions(-) diff --git a/components/_util/ActionButton.tsx b/components/_util/ActionButton.tsx index e3bae4f67e..b8ce013a2a 100644 --- a/components/_util/ActionButton.tsx +++ b/components/_util/ActionButton.tsx @@ -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 { diff --git a/components/_util/__tests__/scrollTo.test.js b/components/_util/__tests__/scrollTo.test.js index 01233791db..41314ec6fb 100644 --- a/components/_util/__tests__/scrollTo.test.js +++ b/components/_util/__tests__/scrollTo.test.js @@ -1,5 +1,5 @@ -import scrollTo from '../scrollTo'; import { sleep } from '../../../tests/utils'; +import scrollTo from '../scrollTo'; describe('Test ScrollTo function', () => { let dateNowMock; diff --git a/components/_util/__tests__/transButton.test.js b/components/_util/__tests__/transButton.test.js index e16461008f..fd350214e7 100644 --- a/components/_util/__tests__/transButton.test.js +++ b/components/_util/__tests__/transButton.test.js @@ -1,5 +1,5 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import TransButton from '../transButton'; describe('transButton component', () => { diff --git a/components/_util/__tests__/useSyncState.test.js b/components/_util/__tests__/useSyncState.test.js index a4e04e096c..5c00d52221 100644 --- a/components/_util/__tests__/useSyncState.test.js +++ b/components/_util/__tests__/useSyncState.test.js @@ -1,5 +1,5 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import useSyncState from '../hooks/useSyncState'; describe('Table', () => { diff --git a/components/_util/__tests__/util.test.js b/components/_util/__tests__/util.test.js index ab67d5297a..d9e9544fb6 100644 --- a/components/_util/__tests__/util.test.js +++ b/components/_util/__tests__/util.test.js @@ -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', () => { diff --git a/components/_util/__tests__/wave.test.js b/components/_util/__tests__/wave.test.js index 7981b7258e..44213d925e 100644 --- a/components/_util/__tests__/wave.test.js +++ b/components/_util/__tests__/wave.test.js @@ -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); diff --git a/components/_util/motion.tsx b/components/_util/motion.tsx index 09bde8ad11..f4333ac6ec 100644 --- a/components/_util/motion.tsx +++ b/components/_util/motion.tsx @@ -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'; diff --git a/components/_util/scrollTo.ts b/components/_util/scrollTo.ts index 27aa467376..97138d90a8 100644 --- a/components/_util/scrollTo.ts +++ b/components/_util/scrollTo.ts @@ -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 */ diff --git a/components/_util/transButton.tsx b/components/_util/transButton.tsx index 5caffe5a80..dea1c70a5b 100644 --- a/components/_util/transButton.tsx +++ b/components/_util/transButton.tsx @@ -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 { onClick?: (e?: React.MouseEvent) => void; diff --git a/components/_util/wave.tsx b/components/_util/wave.tsx index 7a5235fc0c..5f7d699850 100644 --- a/components/_util/wave.tsx +++ b/components/_util/wave.tsx @@ -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; diff --git a/components/affix/__tests__/Affix.test.tsx b/components/affix/__tests__/Affix.test.tsx index f12e22ff11..5d3b0473d2 100644 --- a/components/affix/__tests__/Affix.test.tsx +++ b/components/affix/__tests__/Affix.test.tsx @@ -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) => void>> = {}; diff --git a/components/affix/index.tsx b/components/affix/index.tsx index e1adf6b547..8de5817709 100644 --- a/components/affix/index.tsx +++ b/components/affix/index.tsx @@ -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() { diff --git a/components/alert/index.tsx b/components/alert/index.tsx index 4ad113f95e..d46790db29 100644 --- a/components/alert/index.tsx +++ b/components/alert/index.tsx @@ -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` */ diff --git a/components/anchor/Anchor.tsx b/components/anchor/Anchor.tsx index 38bf4d6cec..c9f8d9d65e 100644 --- a/components/anchor/Anchor.tsx +++ b/components/anchor/Anchor.tsx @@ -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; diff --git a/components/anchor/AnchorLink.tsx b/components/anchor/AnchorLink.tsx index 8cacaab996..422ffd9ec3 100644 --- a/components/anchor/AnchorLink.tsx +++ b/components/anchor/AnchorLink.tsx @@ -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 { diff --git a/components/anchor/__tests__/Anchor.test.tsx b/components/anchor/__tests__/Anchor.test.tsx index 996fcf01b5..96014f56fd 100644 --- a/components/anchor/__tests__/Anchor.test.tsx +++ b/components/anchor/__tests__/Anchor.test.tsx @@ -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; diff --git a/components/anchor/__tests__/cached-context.test.tsx b/components/anchor/__tests__/cached-context.test.tsx index 27c3f683df..db9bf8fd70 100644 --- a/components/anchor/__tests__/cached-context.test.tsx +++ b/components/anchor/__tests__/cached-context.test.tsx @@ -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(() => { diff --git a/components/auto-complete/index.tsx b/components/auto-complete/index.tsx index fe080266d9..5ad13f101e 100755 --- a/components/auto-complete/index.tsx +++ b/components/auto-complete/index.tsx @@ -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; diff --git a/components/avatar/__tests__/Avatar.test.js b/components/avatar/__tests__/Avatar.test.js index a755ad1b29..2474140993 100644 --- a/components/avatar/__tests__/Avatar.test.js +++ b/components/avatar/__tests__/Avatar.test.js @@ -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'); diff --git a/components/avatar/group.tsx b/components/avatar/group.tsx index c491825ae6..063d5ec951 100644 --- a/components/avatar/group.tsx +++ b/components/avatar/group.tsx @@ -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'; diff --git a/components/avatar/index.tsx b/components/avatar/index.tsx index 454786d146..45fc804491 100644 --- a/components/avatar/index.tsx +++ b/components/avatar/index.tsx @@ -5,6 +5,7 @@ import Group from './group'; export { AvatarProps } from './avatar'; export { GroupProps } from './group'; +export { Group }; interface CompoundedComponent extends ForwardRefExoticComponent> { @@ -14,5 +15,4 @@ interface CompoundedComponent const Avatar = InternalAvatar as CompoundedComponent; Avatar.Group = Group; -export { Group }; export default Avatar; diff --git a/components/back-top/__tests__/index.test.js b/components/back-top/__tests__/index.test.js index c269afd268..2a0422c279 100644 --- a/components/back-top/__tests__/index.test.js +++ b/components/back-top/__tests__/index.test.js @@ -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); diff --git a/components/back-top/index.tsx b/components/back-top/index.tsx index 5486f4264e..a74442fe3e 100644 --- a/components/back-top/index.tsx +++ b/components/back-top/index.tsx @@ -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; diff --git a/components/back-top/style/responsive.less b/components/back-top/style/responsive.less index 5529704d83..9d5da95b92 100644 --- a/components/back-top/style/responsive.less +++ b/components/back-top/style/responsive.less @@ -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; diff --git a/components/badge/Ribbon.tsx b/components/badge/Ribbon.tsx index 4b4408cfda..301b00dcb2 100644 --- a/components/badge/Ribbon.tsx +++ b/components/badge/Ribbon.tsx @@ -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'; diff --git a/components/badge/ScrollNumber.tsx b/components/badge/ScrollNumber.tsx index 95d28ef3ee..f5cd1f5fb6 100644 --- a/components/badge/ScrollNumber.tsx +++ b/components/badge/ScrollNumber.tsx @@ -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'; diff --git a/components/badge/SingleNumber.tsx b/components/badge/SingleNumber.tsx index 5be2e740a5..f30901d6b4 100644 --- a/components/badge/SingleNumber.tsx +++ b/components/badge/SingleNumber.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; import classNames from 'classnames'; +import * as React from 'react'; export interface UnitNumberProps { prefixCls: string; diff --git a/components/badge/__tests__/index.test.tsx b/components/badge/__tests__/index.test.tsx index d62dffbc3a..0cc406ccd2 100644 --- a/components/badge/__tests__/index.test.tsx +++ b/components/badge/__tests__/index.test.tsx @@ -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); diff --git a/components/badge/__tests__/ribbon.test.tsx b/components/badge/__tests__/ribbon.test.tsx index 7fdaf041d4..9206bf43b8 100644 --- a/components/badge/__tests__/ribbon.test.tsx +++ b/components/badge/__tests__/ribbon.test.tsx @@ -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); diff --git a/components/badge/index.tsx b/components/badge/index.tsx index feb72e5e7c..ad2e95661b 100644 --- a/components/badge/index.tsx +++ b/components/badge/index.tsx @@ -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'; diff --git a/components/breadcrumb/Breadcrumb.tsx b/components/breadcrumb/Breadcrumb.tsx index f142276c05..5e1b5f8128 100755 --- a/components/breadcrumb/Breadcrumb.tsx +++ b/components/breadcrumb/Breadcrumb.tsx @@ -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; diff --git a/components/breadcrumb/BreadcrumbItem.tsx b/components/breadcrumb/BreadcrumbItem.tsx index 65717b1b60..944421581c 100644 --- a/components/breadcrumb/BreadcrumbItem.tsx +++ b/components/breadcrumb/BreadcrumbItem.tsx @@ -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; diff --git a/components/breadcrumb/__tests__/Breadcrumb.test.js b/components/breadcrumb/__tests__/Breadcrumb.test.js index 23b1a12a86..b606dfd8bf 100644 --- a/components/breadcrumb/__tests__/Breadcrumb.test.js +++ b/components/breadcrumb/__tests__/Breadcrumb.test.js @@ -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); diff --git a/components/breadcrumb/__tests__/router.test.js b/components/breadcrumb/__tests__/router.test.js index ca718baa9a..b3fe8430c8 100644 --- a/components/breadcrumb/__tests__/router.test.js +++ b/components/breadcrumb/__tests__/router.test.js @@ -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 = () => ( diff --git a/components/breadcrumb/style/index.tsx b/components/breadcrumb/style/index.tsx index 3d7084daa2..7f6bf64fae 100644 --- a/components/breadcrumb/style/index.tsx +++ b/components/breadcrumb/style/index.tsx @@ -2,5 +2,5 @@ import '../../style/index.less'; import './index.less'; // style dependencies -import '../../menu/style'; import '../../dropdown/style'; +import '../../menu/style'; diff --git a/components/button/LoadingIcon.tsx b/components/button/LoadingIcon.tsx index 0559835717..2f361c293c 100644 --- a/components/button/LoadingIcon.tsx +++ b/components/button/LoadingIcon.tsx @@ -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; diff --git a/components/button/__tests__/delay-timer.test.tsx b/components/button/__tests__/delay-timer.test.tsx index 94aa9f0583..4f4f724f21 100644 --- a/components/button/__tests__/delay-timer.test.tsx +++ b/components/button/__tests__/delay-timer.test.tsx @@ -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 = () => { diff --git a/components/button/__tests__/index.test.tsx b/components/button/__tests__/index.test.tsx index 207eb8f5b3..73a368f9a2 100644 --- a/components/button/__tests__/index.test.tsx +++ b/components/button/__tests__/index.test.tsx @@ -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', () => { diff --git a/components/button/__tests__/wave.test.tsx b/components/button/__tests__/wave.test.tsx index 00c5e60d0b..bcda6baf63 100644 --- a/components/button/__tests__/wave.test.tsx +++ b/components/button/__tests__/wave.test.tsx @@ -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; diff --git a/components/button/button-group.tsx b/components/button/button-group.tsx index fae0fd127f..4344a2bee6 100644 --- a/components/button/button-group.tsx +++ b/components/button/button-group.tsx @@ -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 { diff --git a/components/button/index.tsx b/components/button/index.tsx index 3fd65352f3..2e70b8555a 100644 --- a/components/button/index.tsx +++ b/components/button/index.tsx @@ -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; diff --git a/components/calendar/Header.tsx b/components/calendar/Header.tsx index 8d61ca76e1..3eed99eb18 100644 --- a/components/calendar/Header.tsx +++ b/components/calendar/Header.tsx @@ -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; diff --git a/components/calendar/__tests__/index.test.js b/components/calendar/__tests__/index.test.js index 957031d259..dc60a0290e 100644 --- a/components/calendar/__tests__/index.test.js +++ b/components/calendar/__tests__/index.test.js @@ -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); diff --git a/components/calendar/generateCalendar.tsx b/components/calendar/generateCalendar.tsx index 260f8c3627..70e3a8c5f7 100644 --- a/components/calendar/generateCalendar.tsx +++ b/components/calendar/generateCalendar.tsx @@ -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 = Omit< Props, diff --git a/components/calendar/style/index.tsx b/components/calendar/style/index.tsx index 1ee59b4a6b..73996152d8 100644 --- a/components/calendar/style/index.tsx +++ b/components/calendar/style/index.tsx @@ -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'; diff --git a/components/card/Card.tsx b/components/card/Card.tsx index e2c71f8c36..70f6937d6a 100644 --- a/components/card/Card.tsx +++ b/components/card/Card.tsx @@ -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'; diff --git a/components/card/Grid.tsx b/components/card/Grid.tsx index 79ae674bba..bf9ed567e2 100644 --- a/components/card/Grid.tsx +++ b/components/card/Grid.tsx @@ -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'; diff --git a/components/card/Meta.tsx b/components/card/Meta.tsx index 06ffc5c0a5..1d79c7be6d 100644 --- a/components/card/Meta.tsx +++ b/components/card/Meta.tsx @@ -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'; diff --git a/components/card/__tests__/index.test.tsx b/components/card/__tests__/index.test.tsx index a9cc063b9a..f9608bd3a4 100644 --- a/components/card/__tests__/index.test.tsx +++ b/components/card/__tests__/index.test.tsx @@ -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); diff --git a/components/card/index.tsx b/components/card/index.tsx index 75c561a9f2..ec2a9780cd 100644 --- a/components/card/index.tsx +++ b/components/card/index.tsx @@ -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; diff --git a/components/card/style/index.tsx b/components/card/style/index.tsx index 00066e6905..9c436a2298 100644 --- a/components/card/style/index.tsx +++ b/components/card/style/index.tsx @@ -2,5 +2,5 @@ import '../../style/index.less'; import './index.less'; // style dependencies -import '../../tabs/style'; import '../../skeleton/style'; +import '../../tabs/style'; diff --git a/components/carousel/__tests__/index.test.js b/components/carousel/__tests__/index.test.js index d7dc07147c..010ae4e60c 100644 --- a/components/carousel/__tests__/index.test.js +++ b/components/carousel/__tests__/index.test.js @@ -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); diff --git a/components/carousel/index.tsx b/components/carousel/index.tsx index 93901da878..481b7ad6dd 100644 --- a/components/carousel/index.tsx +++ b/components/carousel/index.tsx @@ -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'; diff --git a/components/cascader/__tests__/index.test.js b/components/cascader/__tests__/index.test.js index f9f52a8789..8914d81417 100644 --- a/components/cascader/__tests__/index.test.js +++ b/components/cascader/__tests__/index.test.js @@ -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; diff --git a/components/checkbox/Group.tsx b/components/checkbox/Group.tsx index fd500ddf66..b0fe82d5cd 100644 --- a/components/checkbox/Group.tsx +++ b/components/checkbox/Group.tsx @@ -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; diff --git a/components/checkbox/__tests__/checkbox.test.js b/components/checkbox/__tests__/checkbox.test.js index 027aeb0321..6814d86505 100644 --- a/components/checkbox/__tests__/checkbox.test.js +++ b/components/checkbox/__tests__/checkbox.test.js @@ -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 }); diff --git a/components/checkbox/__tests__/group.test.js b/components/checkbox/__tests__/group.test.js index ff10263105..6ffa2be3e2 100644 --- a/components/checkbox/__tests__/group.test.js +++ b/components/checkbox/__tests__/group.test.js @@ -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); diff --git a/components/checkbox/index.tsx b/components/checkbox/index.tsx index aab0055a4f..916ccdf0e1 100644 --- a/components/checkbox/index.tsx +++ b/components/checkbox/index.tsx @@ -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 diff --git a/components/collapse/Collapse.tsx b/components/collapse/Collapse.tsx index b71c8cf5c5..9236ef9c54 100644 --- a/components/collapse/Collapse.tsx +++ b/components/collapse/Collapse.tsx @@ -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'; diff --git a/components/collapse/CollapsePanel.tsx b/components/collapse/CollapsePanel.tsx index aefb76423e..631c75fc9a 100644 --- a/components/collapse/CollapsePanel.tsx +++ b/components/collapse/CollapsePanel.tsx @@ -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'; diff --git a/components/collapse/__tests__/index.test.js b/components/collapse/__tests__/index.test.js index 6c84291ac6..f6eda414df 100644 --- a/components/collapse/__tests__/index.test.js +++ b/components/collapse/__tests__/index.test.js @@ -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', () => { diff --git a/components/comment/__tests__/index.test.js b/components/comment/__tests__/index.test.js index e93d8abe67..68caeff77f 100644 --- a/components/comment/__tests__/index.test.js +++ b/components/comment/__tests__/index.test.js @@ -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); diff --git a/components/comment/index.tsx b/components/comment/index.tsx index a1757cf454..8f67379fe8 100644 --- a/components/comment/index.tsx +++ b/components/comment/index.tsx @@ -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 { diff --git a/components/config-provider/__tests__/container.test.js b/components/config-provider/__tests__/container.test.js index d5377d0bc5..698985011c 100644 --- a/components/config-provider/__tests__/container.test.js +++ b/components/config-provider/__tests__/container.test.js @@ -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', () => { diff --git a/components/config-provider/__tests__/form.test.js b/components/config-provider/__tests__/form.test.js index 7aaaeb1768..bd13dfa5af 100644 --- a/components/config-provider/__tests__/form.test.js +++ b/components/config-provider/__tests__/form.test.js @@ -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(() => { diff --git a/components/config-provider/__tests__/icon.test.js b/components/config-provider/__tests__/icon.test.js index f35cf93636..bbbf3cd166 100644 --- a/components/config-provider/__tests__/icon.test.js +++ b/components/config-provider/__tests__/icon.test.js @@ -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', () => { diff --git a/components/config-provider/__tests__/index.test.js b/components/config-provider/__tests__/index.test.js index 6189748304..5a39cae0a9 100644 --- a/components/config-provider/__tests__/index.test.js +++ b/components/config-provider/__tests__/index.test.js @@ -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(() => ( diff --git a/components/config-provider/__tests__/locale.test.js b/components/config-provider/__tests__/locale.test.js index 25a8552088..98edecda57 100644 --- a/components/config-provider/__tests__/locale.test.js +++ b/components/config-provider/__tests__/locale.test.js @@ -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) { diff --git a/components/config-provider/__tests__/memo.test.js b/components/config-provider/__tests__/memo.test.js index 08e84c6483..f9e1450e53 100644 --- a/components/config-provider/__tests__/memo.test.js +++ b/components/config-provider/__tests__/memo.test.js @@ -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'; diff --git a/components/config-provider/__tests__/target.test.js b/components/config-provider/__tests__/target.test.js index 135de253ab..4796c02271 100644 --- a/components/config-provider/__tests__/target.test.js +++ b/components/config-provider/__tests__/target.test.js @@ -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'; diff --git a/components/config-provider/cssVariables.tsx b/components/config-provider/cssVariables.tsx index 237e37f6b2..a2a6a4dfc2 100644 --- a/components/config-provider/cssVariables.tsx +++ b/components/config-provider/cssVariables.tsx @@ -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()}`; diff --git a/components/config-provider/defaultRenderEmpty.tsx b/components/config-provider/defaultRenderEmpty.tsx index b81a8f7124..e9eb98e811 100644 --- a/components/config-provider/defaultRenderEmpty.tsx +++ b/components/config-provider/defaultRenderEmpty.tsx @@ -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 => ( diff --git a/components/date-picker/__tests__/DatePicker.test.js b/components/date-picker/__tests__/DatePicker.test.js index 7da679cdf7..d917117c4e 100644 --- a/components/date-picker/__tests__/DatePicker.test.js +++ b/components/date-picker/__tests__/DatePicker.test.js @@ -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'; diff --git a/components/date-picker/__tests__/QuarterPicker.test.js b/components/date-picker/__tests__/QuarterPicker.test.js index c252fa9592..f607c268dd 100644 --- a/components/date-picker/__tests__/QuarterPicker.test.js +++ b/components/date-picker/__tests__/QuarterPicker.test.js @@ -1,5 +1,5 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import DatePicker from '..'; import { resetWarned } from '../../_util/warning'; diff --git a/components/date-picker/__tests__/RangePicker.test.js b/components/date-picker/__tests__/RangePicker.test.js index a1a3783ffd..9ce55f31fd 100644 --- a/components/date-picker/__tests__/RangePicker.test.js +++ b/components/date-picker/__tests__/RangePicker.test.js @@ -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; diff --git a/components/date-picker/__tests__/WeekPicker.test.js b/components/date-picker/__tests__/WeekPicker.test.js index e9310ecf0a..5cfa6f4908 100644 --- a/components/date-picker/__tests__/WeekPicker.test.js +++ b/components/date-picker/__tests__/WeekPicker.test.js @@ -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; diff --git a/components/date-picker/__tests__/other.test.js b/components/date-picker/__tests__/other.test.js index e79cf9902a..7b45e62191 100644 --- a/components/date-picker/__tests__/other.test.js +++ b/components/date-picker/__tests__/other.test.js @@ -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'; diff --git a/components/date-picker/__tests__/type.test.tsx b/components/date-picker/__tests__/type.test.tsx index 2e3d6b530b..a10fc6b814 100644 --- a/components/date-picker/__tests__/type.test.tsx +++ b/components/date-picker/__tests__/type.test.tsx @@ -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'; diff --git a/components/date-picker/generatePicker/generateRangePicker.tsx b/components/date-picker/generatePicker/generateRangePicker.tsx index 7bd19851d4..3e56dc9d3a 100644 --- a/components/date-picker/generatePicker/generateRangePicker.tsx +++ b/components/date-picker/generatePicker/generateRangePicker.tsx @@ -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( generateConfig: GenerateConfig, diff --git a/components/date-picker/generatePicker/generateSinglePicker.tsx b/components/date-picker/generatePicker/generateSinglePicker.tsx index c9ad89d509..0fdf155105 100644 --- a/components/date-picker/generatePicker/generateSinglePicker.tsx +++ b/components/date-picker/generatePicker/generateSinglePicker.tsx @@ -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(generateConfig: GenerateConfig) { type DatePickerProps = PickerProps & { diff --git a/components/date-picker/generatePicker/index.tsx b/components/date-picker/generatePicker/index.tsx index 3acc78713c..32375b7c2d 100644 --- a/components/date-picker/generatePicker/index.tsx +++ b/components/date-picker/generatePicker/index.tsx @@ -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 }; diff --git a/components/date-picker/generatePicker/interface.tsx b/components/date-picker/generatePicker/interface.tsx index 216833e677..1de677b20a 100644 --- a/components/date-picker/generatePicker/interface.tsx +++ b/components/date-picker/generatePicker/interface.tsx @@ -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 { diff --git a/components/date-picker/index.tsx b/components/date-picker/index.tsx index b04fe0173c..dcb6008aea 100755 --- a/components/date-picker/index.tsx +++ b/components/date-picker/index.tsx @@ -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'; diff --git a/components/date-picker/style/index.tsx b/components/date-picker/style/index.tsx index 18447e360f..6a16486486 100644 --- a/components/date-picker/style/index.tsx +++ b/components/date-picker/style/index.tsx @@ -1,7 +1,7 @@ import './index.less'; // style dependencies -import '../../tag/style'; import '../../button/style'; +import '../../tag/style'; // deps-lint-skip: form diff --git a/components/descriptions/Cell.tsx b/components/descriptions/Cell.tsx index 0fbdb66caa..fe7bd3ca2a 100644 --- a/components/descriptions/Cell.tsx +++ b/components/descriptions/Cell.tsx @@ -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; diff --git a/components/descriptions/Row.tsx b/components/descriptions/Row.tsx index 28d6ec0b41..bb0c8e55aa 100644 --- a/components/descriptions/Row.tsx +++ b/components/descriptions/Row.tsx @@ -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]; diff --git a/components/descriptions/__tests__/index.test.js b/components/descriptions/__tests__/index.test.js index 349fb8918d..784960498c 100644 --- a/components/descriptions/__tests__/index.test.js +++ b/components/descriptions/__tests__/index.test.js @@ -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'; diff --git a/components/descriptions/index.tsx b/components/descriptions/index.tsx index 45d87595bb..ae04c14f66 100644 --- a/components/descriptions/index.tsx +++ b/components/descriptions/index.tsx @@ -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; diff --git a/components/divider/index.tsx b/components/divider/index.tsx index aa52bdd74d..0cea83cb82 100644 --- a/components/divider/index.tsx +++ b/components/divider/index.tsx @@ -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 { diff --git a/components/drawer/__tests__/Drawer.test.js b/components/drawer/__tests__/Drawer.test.js index 8f5a8447e8..9482fcb162 100644 --- a/components/drawer/__tests__/Drawer.test.js +++ b/components/drawer/__tests__/Drawer.test.js @@ -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 }) => (
diff --git a/components/drawer/__tests__/MultiDrawer.test.js b/components/drawer/__tests__/MultiDrawer.test.js index 0dbe3a0ee6..2c8d8982a3 100644 --- a/components/drawer/__tests__/MultiDrawer.test.js +++ b/components/drawer/__tests__/MultiDrawer.test.js @@ -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 }; diff --git a/components/dropdown/__tests__/dropdown-button.test.js b/components/dropdown/__tests__/dropdown-button.test.js index a87b222c6a..0d6485ddbc 100644 --- a/components/dropdown/__tests__/dropdown-button.test.js +++ b/components/dropdown/__tests__/dropdown-button.test.js @@ -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); diff --git a/components/dropdown/dropdown-button.tsx b/components/dropdown/dropdown-button.tsx index afd01c220b..7f685c07b9 100644 --- a/components/dropdown/dropdown-button.tsx +++ b/components/dropdown/dropdown-button.tsx @@ -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'; diff --git a/components/empty/__tests__/index.test.js b/components/empty/__tests__/index.test.js index 0a7d0b673a..1cbd8b6e0b 100644 --- a/components/empty/__tests__/index.test.js +++ b/components/empty/__tests__/index.test.js @@ -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); diff --git a/components/empty/index.tsx b/components/empty/index.tsx index d4e33d0df1..81c2162345 100644 --- a/components/empty/index.tsx +++ b/components/empty/index.tsx @@ -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'; diff --git a/components/form/ErrorList.tsx b/components/form/ErrorList.tsx index 51eb2083c5..4c193afa33 100644 --- a/components/form/ErrorList.tsx +++ b/components/form/ErrorList.tsx @@ -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[] = []; diff --git a/components/form/Form.tsx b/components/form/Form.tsx index f234d2eaaf..426d1c8c23 100644 --- a/components/form/Form.tsx +++ b/components/form/Form.tsx @@ -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'; diff --git a/components/form/FormItemInput.tsx b/components/form/FormItemInput.tsx index 388854d788..be5f9dc3da 100644 --- a/components/form/FormItemInput.tsx +++ b/components/form/FormItemInput.tsx @@ -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; diff --git a/components/form/FormItemLabel.tsx b/components/form/FormItemLabel.tsx index b758476f5b..bfcf1d9d07 100644 --- a/components/form/FormItemLabel.tsx +++ b/components/form/FormItemLabel.tsx @@ -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; diff --git a/components/form/FormList.tsx b/components/form/FormList.tsx index d69436fcc3..31bbe99b84 100644 --- a/components/form/FormList.tsx +++ b/components/form/FormList.tsx @@ -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 { diff --git a/components/form/__tests__/list-noStyle.test.tsx b/components/form/__tests__/list-noStyle.test.tsx index baf956b63b..88bc51eed9 100644 --- a/components/form/__tests__/list-noStyle.test.tsx +++ b/components/form/__tests__/list-noStyle.test.tsx @@ -1,9 +1,9 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import { act } from 'react-dom/test-utils'; import Form from '..'; -import Input from '../../input'; import { sleep } from '../../../tests/utils'; +import Input from '../../input'; import type { FormListOperation } from '../FormList'; describe('Form.List.NoStyle', () => { diff --git a/components/form/__tests__/list.test.js b/components/form/__tests__/list.test.js index f12c42265d..a45d03f6de 100644 --- a/components/form/__tests__/list.test.js +++ b/components/form/__tests__/list.test.js @@ -1,9 +1,9 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import Form from '..'; -import Input from '../../input'; +import { fireEvent, render, sleep } from '../../../tests/utils'; import Button from '../../button'; -import { sleep, render, fireEvent } from '../../../tests/utils'; +import Input from '../../input'; describe('Form.List', () => { async function change(wrapper, index, value) { diff --git a/components/form/__tests__/ref.test.tsx b/components/form/__tests__/ref.test.tsx index 1fee1ba93d..274dacc87d 100644 --- a/components/form/__tests__/ref.test.tsx +++ b/components/form/__tests__/ref.test.tsx @@ -1,10 +1,10 @@ /* eslint-disable react/jsx-key */ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import Form from '..'; -import Input from '../../input'; import Button from '../../button'; +import Input from '../../input'; describe('Form.Ref', () => { const Test = ({ diff --git a/components/form/hooks/useForm.ts b/components/form/hooks/useForm.ts index 62f3278367..46865e1689 100644 --- a/components/form/hooks/useForm.ts +++ b/components/form/hooks/useForm.ts @@ -1,9 +1,9 @@ -import * as React from 'react'; import type { FormInstance as RcFormInstance } from 'rc-field-form'; import { useForm as useRcForm } from 'rc-field-form'; +import * as React from 'react'; import scrollIntoView from 'scroll-into-view-if-needed'; -import type { ScrollOptions, NamePath, InternalNamePath } from '../interface'; -import { toArray, getFieldId } from '../util'; +import type { InternalNamePath, NamePath, ScrollOptions } from '../interface'; +import { getFieldId, toArray } from '../util'; export interface FormInstance extends RcFormInstance { scrollToField: (name: NamePath, options?: ScrollOptions) => void; diff --git a/components/form/hooks/useFrameState.ts b/components/form/hooks/useFrameState.ts index 81918eb573..6aadfd6b07 100644 --- a/components/form/hooks/useFrameState.ts +++ b/components/form/hooks/useFrameState.ts @@ -1,6 +1,6 @@ +import raf from 'rc-util/lib/raf'; import * as React from 'react'; import { useRef } from 'react'; -import raf from 'rc-util/lib/raf'; type Updater = (prev?: ValueType) => ValueType; diff --git a/components/form/hooks/useItemRef.ts b/components/form/hooks/useItemRef.ts index 36918af250..e42890677d 100644 --- a/components/form/hooks/useItemRef.ts +++ b/components/form/hooks/useItemRef.ts @@ -1,5 +1,5 @@ -import * as React from 'react'; import { composeRef } from 'rc-util/lib/ref'; +import * as React from 'react'; import { FormContext } from '../context'; import type { InternalNamePath } from '../interface'; diff --git a/components/form/index.tsx b/components/form/index.tsx index cddf1cbe47..184ec1c4a4 100644 --- a/components/form/index.tsx +++ b/components/form/index.tsx @@ -1,10 +1,10 @@ import { Rule, RuleObject, RuleRender } from 'rc-field-form/lib/interface'; -import InternalForm, { useForm, FormInstance, FormProps, useWatch } from './Form'; -import Item, { FormItemProps } from './FormItem'; -import ErrorList, { ErrorListProps } from './ErrorList'; -import List, { FormListProps, FormListFieldData, FormListOperation } from './FormList'; -import { FormProvider } from './context'; import warning from '../_util/warning'; +import { FormProvider } from './context'; +import ErrorList, { ErrorListProps } from './ErrorList'; +import InternalForm, { FormInstance, FormProps, useForm, useWatch } from './Form'; +import Item, { FormItemProps } from './FormItem'; +import List, { FormListFieldData, FormListOperation, FormListProps } from './FormList'; import useFormInstance from './hooks/useFormInstance'; type InternalFormType = typeof InternalForm; diff --git a/components/form/interface.ts b/components/form/interface.ts index eae8bf49b5..53a4a0a86e 100644 --- a/components/form/interface.ts +++ b/components/form/interface.ts @@ -1,3 +1,3 @@ +export { InternalNamePath, NamePath, Store, StoreValue } from 'rc-field-form/lib/interface'; export { Options as ScrollOptions } from 'scroll-into-view-if-needed'; export type FormLabelAlign = 'left' | 'right'; -export { Store, StoreValue, NamePath, InternalNamePath } from 'rc-field-form/lib/interface'; diff --git a/components/grid/__tests__/cached-row-context.test.tsx b/components/grid/__tests__/cached-row-context.test.tsx index 7b95bbe70a..5edf9ef96d 100644 --- a/components/grid/__tests__/cached-row-context.test.tsx +++ b/components/grid/__tests__/cached-row-context.test.tsx @@ -1,5 +1,5 @@ -import React, { memo, useRef, useState, useContext } from 'react'; import { mount } from 'enzyme'; +import React, { memo, useContext, useRef, useState } from 'react'; import Row from '../row'; import RowContext from '../RowContext'; diff --git a/components/grid/__tests__/index.test.js b/components/grid/__tests__/index.test.js index 45976e71f7..9ce11fef87 100644 --- a/components/grid/__tests__/index.test.js +++ b/components/grid/__tests__/index.test.js @@ -1,11 +1,11 @@ +import { mount, render } from 'enzyme'; import React from 'react'; -import { render, mount } from 'enzyme'; import { act } from 'react-dom/test-utils'; import { Col, Row } from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; -import useBreakpoint from '../hooks/useBreakpoint'; import ResponsiveObserve from '../../_util/responsiveObserve'; +import useBreakpoint from '../hooks/useBreakpoint'; describe('Grid', () => { mountTest(Row); diff --git a/components/grid/__tests__/server.test.js b/components/grid/__tests__/server.test.js index 1c3cd4da10..4d2ec12051 100644 --- a/components/grid/__tests__/server.test.js +++ b/components/grid/__tests__/server.test.js @@ -1,7 +1,6 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; // eslint-disable-next-line no-unused-vars -import canUseDom from 'rc-util/lib/Dom/canUseDom'; import { Col, Row } from '..'; jest.mock('rc-util/lib/Dom/canUseDom', () => () => false); diff --git a/components/grid/index.tsx b/components/grid/index.tsx index 81474e9641..0afe9cb974 100644 --- a/components/grid/index.tsx +++ b/components/grid/index.tsx @@ -1,16 +1,14 @@ -import Row from './row'; import Col from './col'; import useInternalBreakpoint from './hooks/useBreakpoint'; +import Row from './row'; // Do not export params function useBreakpoint() { return useInternalBreakpoint(); } -export { RowProps } from './row'; - export { ColProps, ColSize } from './col'; - +export { RowProps } from './row'; export { Row, Col }; export default { useBreakpoint }; diff --git a/components/image/PreviewGroup.tsx b/components/image/PreviewGroup.tsx index bff03d85c2..7fac31ca3f 100644 --- a/components/image/PreviewGroup.tsx +++ b/components/image/PreviewGroup.tsx @@ -1,13 +1,13 @@ -import * as React from 'react'; -import RcImage from 'rc-image'; +import CloseOutlined from '@ant-design/icons/CloseOutlined'; +import LeftOutlined from '@ant-design/icons/LeftOutlined'; +import RightOutlined from '@ant-design/icons/RightOutlined'; import RotateLeftOutlined from '@ant-design/icons/RotateLeftOutlined'; import RotateRightOutlined from '@ant-design/icons/RotateRightOutlined'; import ZoomInOutlined from '@ant-design/icons/ZoomInOutlined'; import ZoomOutOutlined from '@ant-design/icons/ZoomOutOutlined'; -import CloseOutlined from '@ant-design/icons/CloseOutlined'; -import LeftOutlined from '@ant-design/icons/LeftOutlined'; -import RightOutlined from '@ant-design/icons/RightOutlined'; +import RcImage from 'rc-image'; import type { GroupConsumerProps } from 'rc-image/lib/PreviewGroup'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import { getTransitionName } from '../_util/motion'; diff --git a/components/index.tsx b/components/index.tsx index 4e0ef8d823..2e0f4364b9 100644 --- a/components/index.tsx +++ b/components/index.tsx @@ -16,219 +16,154 @@ if ( } /* @remove-on-es-build-end */ -export type { AffixProps } from './affix'; export { default as Affix } from './affix'; - -export type { AnchorProps, AnchorLinkProps } from './anchor'; -export { default as Anchor } from './anchor'; - -export type { AutoCompleteProps } from './auto-complete'; -export { default as AutoComplete } from './auto-complete'; - -export type { AlertProps } from './alert'; +export type { AffixProps } from './affix'; export { default as Alert } from './alert'; - -export type { AvatarProps } from './avatar'; +export type { AlertProps } from './alert'; +export { default as Anchor } from './anchor'; +export type { AnchorLinkProps, AnchorProps } from './anchor'; +export { default as AutoComplete } from './auto-complete'; +export type { AutoCompleteProps } from './auto-complete'; export { default as Avatar } from './avatar'; - -export type { BackTopProps } from './back-top'; +export type { AvatarProps } from './avatar'; export { default as BackTop } from './back-top'; - -export type { BadgeProps } from './badge'; +export type { BackTopProps } from './back-top'; export { default as Badge } from './badge'; - -export type { BreadcrumbProps, BreadcrumbItemProps } from './breadcrumb'; +export type { BadgeProps } from './badge'; export { default as Breadcrumb } from './breadcrumb'; - -export type { ButtonProps } from './button'; +export type { BreadcrumbItemProps, BreadcrumbProps } from './breadcrumb'; export { default as Button } from './button'; - -export type { CalendarProps } from './calendar'; +export type { ButtonProps } from './button'; export { default as Calendar } from './calendar'; - -export type { CardProps } from './card'; +export type { CalendarProps } from './calendar'; export { default as Card } from './card'; - -export type { CollapseProps, CollapsePanelProps } from './collapse'; -export { default as Collapse } from './collapse'; - -export type { CarouselProps } from './carousel'; +export type { CardProps } from './card'; export { default as Carousel } from './carousel'; - -export type { CascaderProps } from './cascader'; +export type { CarouselProps } from './carousel'; export { default as Cascader } from './cascader'; - -export type { CheckboxProps, CheckboxOptionType } from './checkbox'; +export type { CascaderProps } from './cascader'; export { default as Checkbox } from './checkbox'; - -export type { ColProps } from './col'; +export type { CheckboxOptionType, CheckboxProps } from './checkbox'; export { default as Col } from './col'; - -export type { CommentProps } from './comment'; +export type { ColProps } from './col'; +export { default as Collapse } from './collapse'; +export type { CollapsePanelProps, CollapseProps } from './collapse'; export { default as Comment } from './comment'; - +export type { CommentProps } from './comment'; export { default as ConfigProvider } from './config-provider'; - -export type { DatePickerProps } from './date-picker'; export { default as DatePicker } from './date-picker'; - -export type { DescriptionsProps } from './descriptions'; +export type { DatePickerProps } from './date-picker'; export { default as Descriptions } from './descriptions'; - -export type { DividerProps } from './divider'; +export type { DescriptionsProps } from './descriptions'; export { default as Divider } from './divider'; - +export type { DividerProps } from './divider'; +export { default as Drawer } from './drawer'; +export type { DrawerProps } from './drawer'; +export { default as Dropdown } from './dropdown'; export type { DropdownProps, // typo, but we need to support it for backwards compatibility // https://github.com/ant-design/ant-design/pull/35161 DropdownProps as DropDownProps, } from './dropdown'; -export { default as Dropdown } from './dropdown'; - -export type { DrawerProps } from './drawer'; -export { default as Drawer } from './drawer'; - -export type { EmptyProps } from './empty'; export { default as Empty } from './empty'; - +export type { EmptyProps } from './empty'; +export { default as Form } from './form'; export type { FormInstance, - FormProps, FormItemProps, FormListFieldData, FormListOperation, + FormProps, Rule as FormRule, } from './form'; -export { default as Form } from './form'; - export { default as Grid } from './grid'; - -export type { InputProps, InputRef } from './input'; -export { default as Input } from './input'; - -export type { ImageProps } from './image'; export { default as Image } from './image'; - -export type { InputNumberProps } from './input-number'; +export type { ImageProps } from './image'; +export { default as Input } from './input'; +export type { InputProps, InputRef } from './input'; export { default as InputNumber } from './input-number'; - -export type { LayoutProps, SiderProps } from './layout'; +export type { InputNumberProps } from './input-number'; export { default as Layout } from './layout'; - -export type { ListProps } from './list'; +export type { LayoutProps, SiderProps } from './layout'; export { default as List } from './list'; - -export type { ArgsProps as MessageArgsProps } from './message'; -export { default as message } from './message'; - -export type { MenuProps, MenuTheme, SubMenuProps, MenuItemProps } from './menu'; -export { default as Menu } from './menu'; - -export type { MentionProps } from './mentions'; +export type { ListProps } from './list'; export { default as Mentions } from './mentions'; - -export type { ModalProps, ModalFuncProps } from './modal'; +export type { MentionProps } from './mentions'; +export { default as Menu } from './menu'; +export type { MenuItemProps, MenuProps, MenuTheme, SubMenuProps } from './menu'; +export { default as message } from './message'; +export type { ArgsProps as MessageArgsProps } from './message'; export { default as Modal } from './modal'; - -export type { StatisticProps } from './statistic'; -export { default as Statistic } from './statistic'; - +export type { ModalFuncProps, ModalProps } from './modal'; export { default as notification } from './notification'; - -export type { PageHeaderProps } from './page-header'; export { default as PageHeader } from './page-header'; - -export type { PaginationProps } from './pagination'; +export type { PageHeaderProps } from './page-header'; export { default as Pagination } from './pagination'; - -export type { PopconfirmProps } from './popconfirm'; +export type { PaginationProps } from './pagination'; export { default as Popconfirm } from './popconfirm'; - -export type { PopoverProps } from './popover'; +export type { PopconfirmProps } from './popconfirm'; export { default as Popover } from './popover'; - -export type { ProgressProps } from './progress'; +export type { PopoverProps } from './popover'; export { default as Progress } from './progress'; - -export type { RadioProps, RadioChangeEvent, RadioGroupProps } from './radio'; +export type { ProgressProps } from './progress'; export { default as Radio } from './radio'; - -export type { RateProps } from './rate'; +export type { RadioChangeEvent, RadioGroupProps, RadioProps } from './radio'; export { default as Rate } from './rate'; - -export type { ResultProps } from './result'; +export type { RateProps } from './rate'; export { default as Result } from './result'; - -export type { RowProps } from './row'; +export type { ResultProps } from './result'; export { default as Row } from './row'; - -export type { SelectProps, RefSelectProps } from './select'; -export { default as Select } from './select'; - -export type { SegmentedProps } from './segmented'; +export type { RowProps } from './row'; export { default as Segmented } from './segmented'; - -export type { SkeletonProps } from './skeleton'; +export type { SegmentedProps } from './segmented'; +export { default as Select } from './select'; +export type { RefSelectProps, SelectProps } from './select'; export { default as Skeleton } from './skeleton'; - -export type { SliderSingleProps } from './slider'; +export type { SkeletonProps } from './skeleton'; export { default as Slider } from './slider'; - -export type { SpaceProps } from './space'; +export type { SliderSingleProps } from './slider'; export { default as Space } from './space'; - -export type { SpinProps } from './spin'; +export type { SpaceProps } from './space'; export { default as Spin } from './spin'; - -export type { StepProps, StepsProps } from './steps'; +export type { SpinProps } from './spin'; +export { default as Statistic } from './statistic'; +export type { StatisticProps } from './statistic'; export { default as Steps } from './steps'; - -export type { SwitchProps } from './switch'; +export type { StepProps, StepsProps } from './steps'; export { default as Switch } from './switch'; - +export type { SwitchProps } from './switch'; +export { default as Table } from './table'; export type { - TableProps, - TablePaginationConfig, ColumnGroupType as TableColumnGroupType, - ColumnType as TableColumnType, ColumnProps as TableColumnProps, ColumnsType as TableColumnsType, + ColumnType as TableColumnType, + TablePaginationConfig, + TableProps, } from './table'; -export { default as Table } from './table'; - -export type { TransferProps } from './transfer'; +export { default as Tabs } from './tabs'; +export type { TabPaneProps, TabsProps } from './tabs'; +export { default as Tag } from './tag'; +export type { TagProps, TagType } from './tag'; +export { default as TimePicker } from './time-picker'; +export type { TimePickerProps, TimeRangePickerProps } from './time-picker'; +export { default as Timeline } from './timeline'; +export type { TimelineItemProps, TimelineProps } from './timeline'; +export { default as Tooltip } from './tooltip'; +export type { TooltipProps } from './tooltip'; export { default as Transfer } from './transfer'; - +export type { TransferProps } from './transfer'; +export { default as Tree } from './tree'; export type { - TreeProps, AntTreeNodeProps as TreeNodeProps, DataNode as TreeDataNode, + TreeProps, } from './tree'; -export { default as Tree } from './tree'; - -export type { TreeSelectProps } from './tree-select'; export { default as TreeSelect } from './tree-select'; - -export type { TabsProps, TabPaneProps } from './tabs'; -export { default as Tabs } from './tabs'; - -export type { TagProps, TagType } from './tag'; -export { default as Tag } from './tag'; - -export type { TimePickerProps, TimeRangePickerProps } from './time-picker'; -export { default as TimePicker } from './time-picker'; - -export type { TimelineProps, TimelineItemProps } from './timeline'; -export { default as Timeline } from './timeline'; - -export type { TooltipProps } from './tooltip'; -export { default as Tooltip } from './tooltip'; - -export type { TypographyProps } from './typography'; +export type { TreeSelectProps } from './tree-select'; export { default as Typography } from './typography'; - -export type { UploadProps, UploadFile } from './upload'; +export type { TypographyProps } from './typography'; export { default as Upload } from './upload'; - +export type { UploadFile, UploadProps } from './upload'; export { default as version } from './version'; diff --git a/components/input-number/__tests__/index.test.js b/components/input-number/__tests__/index.test.js index 3646bfdf1e..1cb4be61a2 100644 --- a/components/input-number/__tests__/index.test.js +++ b/components/input-number/__tests__/index.test.js @@ -1,6 +1,6 @@ -import React from 'react'; +import { ArrowDownOutlined, ArrowUpOutlined } from '@ant-design/icons'; import { mount } from 'enzyme'; -import { ArrowUpOutlined, ArrowDownOutlined } from '@ant-design/icons'; +import React from 'react'; import InputNumber from '..'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; diff --git a/components/input-number/__tests__/prefix.test.js b/components/input-number/__tests__/prefix.test.js index a2da7c59c3..96f1b797aa 100644 --- a/components/input-number/__tests__/prefix.test.js +++ b/components/input-number/__tests__/prefix.test.js @@ -1,6 +1,6 @@ -import React from 'react'; -import { mount } from 'enzyme'; import { render } from '@testing-library/react'; +import { mount } from 'enzyme'; +import React from 'react'; import InputNumber from '..'; import focusTest from '../../../tests/shared/focusTest'; diff --git a/components/input/Group.tsx b/components/input/Group.tsx index 2e39ad77ab..1a21fafb1f 100644 --- a/components/input/Group.tsx +++ b/components/input/Group.tsx @@ -1,6 +1,6 @@ +import classNames from 'classnames'; import * as React from 'react'; import { useContext, useMemo } from 'react'; -import classNames from 'classnames'; import { ConfigContext } from '../config-provider'; import { FormItemInputContext } from '../form/context'; diff --git a/components/input/__tests__/Password.test.js b/components/input/__tests__/Password.test.js index e71f4f63b4..cb60b93a58 100644 --- a/components/input/__tests__/Password.test.js +++ b/components/input/__tests__/Password.test.js @@ -4,7 +4,7 @@ import Input from '..'; import focusTest from '../../../tests/shared/focusTest'; 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 Password from '../Password'; describe('Input.Password', () => { @@ -26,12 +26,11 @@ describe('Input.Password', () => { const { asFragment, container } = render(); expect(container.querySelector('.ant-input-affix-wrapper-lg')).toBeTruthy(); expect(asFragment().firstChild).toMatchSnapshot(); - }); it('should change type when click', () => { const { asFragment, container } = render(); - fireEvent.change(container.querySelector('input'), { target: { value: '111' } }) + fireEvent.change(container.querySelector('input'), { target: { value: '111' } }); expect(asFragment().firstChild).toMatchSnapshot(); fireEvent.click(container.querySelector('.ant-input-password-icon')); @@ -46,7 +45,6 @@ describe('Input.Password', () => { expect(container.querySelectorAll('.anticon-eye').length).toBe(0); rerender(); expect(container.querySelectorAll('.anticon-eye-invisible').length).toBe(1); - }); it('should not toggle visibility when disabled prop is true', () => { @@ -85,10 +83,10 @@ describe('Input.Password', () => { fireEvent.change(container.querySelector('input'), { target: { value: 'value' } }); await sleep(); expect(container.querySelector('input').getAttribute('value')).toBeFalsy(); - fireEvent.blur(container.querySelector('input')) + fireEvent.blur(container.querySelector('input')); await sleep(); expect(container.querySelector('input').getAttribute('value')).toBeFalsy(); - fireEvent.focus(container.querySelector('input')) + fireEvent.focus(container.querySelector('input')); await sleep(); expect(container.querySelector('input').getAttribute('value')).toBeFalsy(); }); diff --git a/components/input/__tests__/Search.test.js b/components/input/__tests__/Search.test.js index 3559d04a2d..bb35325cfa 100644 --- a/components/input/__tests__/Search.test.js +++ b/components/input/__tests__/Search.test.js @@ -1,10 +1,10 @@ -import React from 'react'; import { fireEvent, render } from '@testing-library/react'; -import Search from '../Search'; -import Button from '../../button'; +import React from 'react'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; +import Button from '../../button'; +import Search from '../Search'; describe('Input.Search', () => { focusTest(Search, { refFocus: true }); @@ -151,7 +151,7 @@ describe('Input.Search', () => { it('should trigger onSearch when press enter', () => { const onSearch = jest.fn(); const { container } = render(); - fireEvent.keyDown(container.querySelector('input'), { key: 'Enter', keyCode: 13 }) + fireEvent.keyDown(container.querySelector('input'), { key: 'Enter', keyCode: 13 }); expect(onSearch).toHaveBeenCalledTimes(1); expect(onSearch).toHaveBeenCalledWith( 'search text', @@ -173,7 +173,7 @@ describe('Input.Search', () => { expect(onSearch).not.toHaveBeenCalled(); fireEvent.compositionEnd(container.querySelector('input')); - fireEvent.keyDown(container.querySelector('input'), { key: 'Enter', keyCode: 13 });; + fireEvent.keyDown(container.querySelector('input'), { key: 'Enter', keyCode: 13 }); expect(onSearch).toHaveBeenCalledTimes(1); expect(onSearch).toHaveBeenCalledWith( 'search text', @@ -190,7 +190,9 @@ describe('Input.Search', () => { it('should support addonAfter', () => { const addonAfter = Addon After; const { asFragment } = render(); - const {asFragment: asFragmentWithEnterButton } = render(); + const { asFragment: asFragmentWithEnterButton } = render( + , + ); expect(asFragment().firstChild).toMatchSnapshot(); expect(asFragmentWithEnterButton().firstChild).toMatchSnapshot(); }); @@ -209,14 +211,14 @@ describe('Input.Search', () => { it('should support loading', () => { const { asFragment } = render(); - const {asFragment: asFragmentWithEnterButton } = render(); + const { asFragment: asFragmentWithEnterButton } = render(); expect(asFragment().firstChild).toMatchSnapshot(); expect(asFragmentWithEnterButton().firstChild).toMatchSnapshot(); }); it('should support addonAfter and suffix for loading', () => { const { asFragment } = render(); - const {asFragment: asFragmentWithEnterButton } = render( + const { asFragment: asFragmentWithEnterButton } = render( , ); expect(asFragment().firstChild).toMatchSnapshot(); @@ -255,7 +257,11 @@ describe('Input.Search', () => { // https://github.com/ant-design/ant-design/issues/27258 it('Search with allowClear should have one className only', () => { const { container } = render(); - expect(container.querySelector('.ant-input-group-wrapper').classList.contains('className')).toBe(true); - expect(container.querySelector('.ant-input-affix-wrapper').classList.contains('className')).toBe(false); + expect( + container.querySelector('.ant-input-group-wrapper').classList.contains('className'), + ).toBe(true); + expect( + container.querySelector('.ant-input-affix-wrapper').classList.contains('className'), + ).toBe(false); }); }); diff --git a/components/input/__tests__/focus.test.tsx b/components/input/__tests__/focus.test.tsx index d9a1316eba..112bcdb718 100644 --- a/components/input/__tests__/focus.test.tsx +++ b/components/input/__tests__/focus.test.tsx @@ -1,8 +1,8 @@ -import React from 'react'; import { spyElementPrototypes } from 'rc-util/lib/test/domHook'; -import type { InputRef } from '../Input'; +import React from 'react'; import Input from '..'; -import { render, fireEvent } from '../../../tests/utils'; +import { fireEvent, render } from '../../../tests/utils'; +import type { InputRef } from '../Input'; const { TextArea } = Input; diff --git a/components/input/__tests__/index.test.tsx b/components/input/__tests__/index.test.tsx index 8dbfbfcdb6..c43759b7b7 100644 --- a/components/input/__tests__/index.test.tsx +++ b/components/input/__tests__/index.test.tsx @@ -1,12 +1,12 @@ import React, { useState } from 'react'; import { createPortal } from 'react-dom'; -import { render, fireEvent } from '../../../tests/utils'; +import { fireEvent, render } from '../../../tests/utils'; // eslint-disable-next-line import/no-unresolved -import Form from '../../form'; import type { InputProps, InputRef } from '..'; import Input from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; +import Form from '../../form'; describe('Input', () => { const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); @@ -343,7 +343,9 @@ describe('Input allowClear', () => { }); it('should focus input after clear', () => { - const { container, unmount } = render(, { container: document.body }); + const { container, unmount } = render(, { + container: document.body, + }); fireEvent.click(container.querySelector('.ant-input-clear-icon')!); expect(document.activeElement).toBe(container.querySelector('input')); unmount(); @@ -366,9 +368,12 @@ describe('Input allowClear', () => { // https://github.com/ant-design/ant-design/issues/31200 it('should not lost focus when clear input', () => { const onBlur = jest.fn(); - const { container, unmount } = render(, { - container: document.body, - }); + const { container, unmount } = render( + , + { + container: document.body, + }, + ); container.querySelector('input')?.focus(); fireEvent.mouseDown(container.querySelector('.ant-input-clear-icon')!); fireEvent.click(container.querySelector('.ant-input-clear-icon')!); diff --git a/components/input/__tests__/type.test.tsx b/components/input/__tests__/type.test.tsx index 0f8dd916d2..8f509b0a25 100644 --- a/components/input/__tests__/type.test.tsx +++ b/components/input/__tests__/type.test.tsx @@ -1,7 +1,7 @@ import React from 'react'; import Input from '..'; -import type { InputProps } from '../Input'; import { render } from '../../../tests/utils'; +import type { InputProps } from '../Input'; describe('Input types', () => { it('should support data-attributes', () => { diff --git a/components/input/index.tsx b/components/input/index.tsx index afaf773543..0516be61ab 100644 --- a/components/input/index.tsx +++ b/components/input/index.tsx @@ -1,16 +1,16 @@ import type * as React from 'react'; +import Group from './Group'; import type { InputProps, InputRef } from './Input'; import InternalInput from './Input'; -import Group from './Group'; +import Password from './Password'; import Search from './Search'; import TextArea from './TextArea'; -import Password from './Password'; -export { InputProps, InputRef } from './Input'; export { GroupProps } from './Group'; +export { InputProps, InputRef } from './Input'; +export { PasswordProps } from './Password'; export { SearchProps } from './Search'; export { TextAreaProps } from './TextArea'; -export { PasswordProps } from './Password'; interface CompoundedComponent extends React.ForwardRefExoticComponent> { diff --git a/components/layout/__tests__/dynamic-breakpoint.test.tsx b/components/layout/__tests__/dynamic-breakpoint.test.tsx index b5cab4834e..295723c146 100644 --- a/components/layout/__tests__/dynamic-breakpoint.test.tsx +++ b/components/layout/__tests__/dynamic-breakpoint.test.tsx @@ -1,5 +1,5 @@ -import React, { useState } from 'react'; import { mount } from 'enzyme'; +import React, { useState } from 'react'; import Sider from '../Sider'; const Content = () => { diff --git a/components/layout/__tests__/index.test.js b/components/layout/__tests__/index.test.js index ffa4ddacad..92a6236493 100644 --- a/components/layout/__tests__/index.test.js +++ b/components/layout/__tests__/index.test.js @@ -1,10 +1,10 @@ -import React, { useState } from 'react'; import { mount, render } from 'enzyme'; +import React, { useState } from 'react'; import Layout from '..'; -import Icon from '../../icon'; -import Menu from '../../menu'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; +import Icon from '../../icon'; +import Menu from '../../menu'; const { Sider, Content, Footer, Header } = Layout; diff --git a/components/list/Item.tsx b/components/list/Item.tsx index 6e5b9ea2c9..0240a29316 100644 --- a/components/list/Item.tsx +++ b/components/list/Item.tsx @@ -1,4 +1,4 @@ -import React, { Children, forwardRef, useContext } from 'react'; +import classNames from 'classnames'; import type { CSSProperties, FC, @@ -8,11 +8,11 @@ import type { ReactElement, ReactNode, } from 'react'; -import classNames from 'classnames'; -import { ListContext } from './index'; -import { Col } from '../grid'; +import React, { Children, forwardRef, useContext } from 'react'; import { ConfigContext } from '../config-provider'; +import { Col } from '../grid'; import { cloneElement } from '../_util/reactNode'; +import { ListContext } from './index'; export interface ListItemProps extends HTMLAttributes { className?: string; diff --git a/components/list/__tests__/Item.test.js b/components/list/__tests__/Item.test.js index 78de8887bf..d8bbdf2dc0 100644 --- a/components/list/__tests__/Item.test.js +++ b/components/list/__tests__/Item.test.js @@ -1,7 +1,7 @@ import React from 'react'; import List from '..'; -import ConfigProvider from '../../config-provider'; import { render } from '../../../tests/utils'; +import ConfigProvider from '../../config-provider'; describe('List Item Layout', () => { const data = [ diff --git a/components/list/__tests__/empty.test.js b/components/list/__tests__/empty.test.js index 00d770c312..333d4e6183 100644 --- a/components/list/__tests__/empty.test.js +++ b/components/list/__tests__/empty.test.js @@ -1,6 +1,6 @@ import React from 'react'; -import { render } from '../../../tests/utils'; import List from '..'; +import { render } from '../../../tests/utils'; describe('List', () => { it('renders empty list', () => { diff --git a/components/list/__tests__/index.test.js b/components/list/__tests__/index.test.js index 60c3fd3c20..e1ee6944f1 100644 --- a/components/list/__tests__/index.test.js +++ b/components/list/__tests__/index.test.js @@ -1,8 +1,8 @@ import React from 'react'; -import { render } from '../../../tests/utils'; import List from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; +import { render } from '../../../tests/utils'; describe('List', () => { mountTest(List); diff --git a/components/list/__tests__/loading.test.js b/components/list/__tests__/loading.test.js index 5702441753..a95c0761ca 100644 --- a/components/list/__tests__/loading.test.js +++ b/components/list/__tests__/loading.test.js @@ -1,5 +1,5 @@ -import React from 'react'; import { LoadingOutlined } from '@ant-design/icons'; +import React from 'react'; import { render } from '../../../tests/utils'; import List from '..'; diff --git a/components/list/__tests__/pagination.test.js b/components/list/__tests__/pagination.test.js index bfc08e401b..98a59b53f8 100644 --- a/components/list/__tests__/pagination.test.js +++ b/components/list/__tests__/pagination.test.js @@ -1,6 +1,6 @@ import React from 'react'; -import { fireEvent, render } from '../../../tests/utils'; import List from '..'; +import { fireEvent, render } from '../../../tests/utils'; import { noop } from '../../_util/warning'; describe('List.pagination', () => { diff --git a/components/list/index.tsx b/components/list/index.tsx index 56b082243b..32d12e0761 100644 --- a/components/list/index.tsx +++ b/components/list/index.tsx @@ -1,19 +1,19 @@ -import * as React from 'react'; import classNames from 'classnames'; -import type { SpinProps } from '../spin'; -import Spin from '../spin'; -import useBreakpoint from '../grid/hooks/useBreakpoint'; -import type { Breakpoint } from '../_util/responsiveObserve'; -import { responsiveArray } from '../_util/responsiveObserve'; +import * as React from 'react'; import type { RenderEmptyHandler } from '../config-provider'; import { ConfigContext } from '../config-provider'; +import defaultRenderEmpty from '../config-provider/defaultRenderEmpty'; +import { Row } from '../grid'; +import useBreakpoint from '../grid/hooks/useBreakpoint'; import type { PaginationConfig } from '../pagination'; import Pagination from '../pagination'; -import { Row } from '../grid'; +import type { SpinProps } from '../spin'; +import Spin from '../spin'; +import type { Breakpoint } from '../_util/responsiveObserve'; +import { responsiveArray } from '../_util/responsiveObserve'; import Item from './Item'; -import defaultRenderEmpty from '../config-provider/defaultRenderEmpty'; -export { ListItemProps, ListItemMetaProps } from './Item'; +export { ListItemMetaProps, ListItemProps } from './Item'; export type ColumnCount = number; diff --git a/components/list/style/index.tsx b/components/list/style/index.tsx index 294babf36f..9a859060f7 100644 --- a/components/list/style/index.tsx +++ b/components/list/style/index.tsx @@ -3,6 +3,6 @@ import './index.less'; // style dependencies import '../../empty/style'; -import '../../spin/style'; -import '../../pagination/style'; import '../../grid/style'; +import '../../pagination/style'; +import '../../spin/style'; diff --git a/components/locale-provider/LocaleReceiver.tsx b/components/locale-provider/LocaleReceiver.tsx index ce83e1fc5f..237a30d3df 100644 --- a/components/locale-provider/LocaleReceiver.tsx +++ b/components/locale-provider/LocaleReceiver.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; -import defaultLocaleData from './default'; -import LocaleContext from './context'; -import type { LocaleContextProps } from './context'; import type { Locale } from '.'; +import type { LocaleContextProps } from './context'; +import LocaleContext from './context'; +import defaultLocaleData from './default'; export type LocaleComponentName = Exclude; diff --git a/components/locale-provider/__tests__/cached-context.test.tsx b/components/locale-provider/__tests__/cached-context.test.tsx index fb51a5e75b..359bccfec4 100644 --- a/components/locale-provider/__tests__/cached-context.test.tsx +++ b/components/locale-provider/__tests__/cached-context.test.tsx @@ -1,5 +1,5 @@ -import React, { memo, useState, useRef, useContext } from 'react'; import { mount } from 'enzyme'; +import React, { memo, useContext, useRef, useState } from 'react'; import LocaleProvider, { ANT_MARK } from '..'; import LocaleContext from '../context'; diff --git a/components/locale-provider/__tests__/config.test.js b/components/locale-provider/__tests__/config.test.js index 50723fb3e0..49c5d95f56 100644 --- a/components/locale-provider/__tests__/config.test.js +++ b/components/locale-provider/__tests__/config.test.js @@ -1,9 +1,9 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import { act } from 'react-dom/test-utils'; -import ConfigProvider from '../../config-provider'; import { Modal } from '../..'; import { sleep } from '../../../tests/utils'; +import ConfigProvider from '../../config-provider'; import zhCN from '../zh_CN'; class Demo extends React.Component { diff --git a/components/locale-provider/__tests__/index.test.js b/components/locale-provider/__tests__/index.test.js index b87470b2ab..77ba7b57e9 100644 --- a/components/locale-provider/__tests__/index.test.js +++ b/components/locale-provider/__tests__/index.test.js @@ -1,21 +1,21 @@ /* eslint-disable react/no-multi-comp */ -import React from 'react'; import { mount } from 'enzyme'; -import moment from 'moment'; import MockDate from 'mockdate'; -import mountTest from '../../../tests/shared/mountTest'; +import moment from 'moment'; +import React from 'react'; +import LocaleProvider from '..'; import { - Pagination, - DatePicker, - TimePicker, Calendar, - Popconfirm, - Table, + DatePicker, Modal, + Pagination, + Popconfirm, Select, + Table, + TimePicker, Transfer, } from '../..'; -import LocaleProvider from '..'; +import mountTest from '../../../tests/shared/mountTest'; import arEG from '../ar_EG'; import azAZ from '../az_AZ'; import bgBG from '../bg_BG'; @@ -23,8 +23,8 @@ import bnBD from '../bn_BD'; import byBY from '../by_BY'; import caES from '../ca_ES'; import csCZ from '../cs_CZ'; -import deDE from '../de_DE'; import daDK from '../da_DK'; +import deDE from '../de_DE'; import elGR from '../el_GR'; import enGB from '../en_GB'; import enUS from '../en_US'; @@ -48,13 +48,13 @@ import itIT from '../it_IT'; import jaJP from '../ja_JP'; import kaGE from '../ka_GE'; import kkKZ from '../kk_KZ'; +import kmrIQ from '../kmr_IQ'; +import kmKH from '../km_KH'; import knIN from '../kn_IN'; import koKR from '../ko_KR'; -import kmKH from '../km_KH'; -import kmrIQ from '../kmr_IQ'; import kuIQ from '../ku_IQ'; -import lvLV from '../lv_LV'; import ltLT from '../lt_LT'; +import lvLV from '../lv_LV'; import mkMK from '../mk_MK'; import mlIN from '../ml_IN'; import mnMN from '../mn_MN'; @@ -74,14 +74,14 @@ import srRS from '../sr_RS'; import svSE from '../sv_SE'; import taIN from '../ta_IN'; import thTH from '../th_TH'; -import trTR from '../tr_TR'; import tkTK from '../tk_TK'; +import trTR from '../tr_TR'; import ukUA from '../uk_UA'; +import urPK from '../ur_PK'; import viVN from '../vi_VN'; import zhCN from '../zh_CN'; import zhHK from '../zh_HK'; import zhTW from '../zh_TW'; -import urPK from '../ur_PK'; const locales = [ azAZ, diff --git a/components/locale-provider/index.tsx b/components/locale-provider/index.tsx index b35aba3819..e7bee72826 100644 --- a/components/locale-provider/index.tsx +++ b/components/locale-provider/index.tsx @@ -1,17 +1,17 @@ -import * as React from 'react'; import memoizeOne from 'memoize-one'; import type { ValidateMessages } from 'rc-field-form/lib/interface'; +import * as React from 'react'; import warning from '../_util/warning'; +import type { PickerLocale as DatePickerLocale } from '../date-picker/generatePicker'; +import type { TransferLocale as TransferLocaleForEmpty } from '../empty'; import type { ModalLocale } from '../modal/locale'; import { changeConfirmLocale } from '../modal/locale'; -import type { TransferLocale as TransferLocaleForEmpty } from '../empty'; import type { PaginationLocale } from '../pagination/Pagination'; -import type { TableLocale } from '../table/interface'; import type { PopconfirmLocale } from '../popconfirm'; -import type { UploadLocale } from '../upload/interface'; +import type { TableLocale } from '../table/interface'; import type { TransferLocale } from '../transfer'; -import type { PickerLocale as DatePickerLocale } from '../date-picker/generatePicker'; +import type { UploadLocale } from '../upload/interface'; import LocaleContext from './context'; export const ANT_MARK = 'internalMark'; diff --git a/components/locale/ar_EG.tsx b/components/locale/ar_EG.tsx index 39bd98505a..60e26b4944 100644 --- a/components/locale/ar_EG.tsx +++ b/components/locale/ar_EG.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/ar_EG'; -import DatePicker from '../date-picker/locale/ar_EG'; -import TimePicker from '../time-picker/locale/ar_EG'; import Calendar from '../calendar/locale/ar_EG'; +import DatePicker from '../date-picker/locale/ar_EG'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/ar_EG'; const typeTemplate = 'ليس ${label} من نوع ${type} صالحًا'; diff --git a/components/locale/az_AZ.tsx b/components/locale/az_AZ.tsx index ba685b164a..6539c5810e 100644 --- a/components/locale/az_AZ.tsx +++ b/components/locale/az_AZ.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/az_AZ'; -import DatePicker from '../date-picker/locale/az_AZ'; -import TimePicker from '../time-picker/locale/az_AZ'; import Calendar from '../calendar/locale/az_AZ'; +import DatePicker from '../date-picker/locale/az_AZ'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/az_AZ'; const localeValues: Locale = { locale: 'az', diff --git a/components/locale/bg_BG.tsx b/components/locale/bg_BG.tsx index a2dc0441dd..f466fc1e79 100644 --- a/components/locale/bg_BG.tsx +++ b/components/locale/bg_BG.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/bg_BG'; -import DatePicker from '../date-picker/locale/bg_BG'; -import TimePicker from '../time-picker/locale/bg_BG'; import Calendar from '../calendar/locale/bg_BG'; +import DatePicker from '../date-picker/locale/bg_BG'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/bg_BG'; const localeValues: Locale = { locale: 'bg', diff --git a/components/locale/bn_BD.tsx b/components/locale/bn_BD.tsx index 3114965687..1cf7bcc9d2 100644 --- a/components/locale/bn_BD.tsx +++ b/components/locale/bn_BD.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/bn_BD'; -import DatePicker from '../date-picker/locale/bn_BD'; -import TimePicker from '../time-picker/locale/bn_BD'; import Calendar from '../calendar/locale/bn_BD'; +import DatePicker from '../date-picker/locale/bn_BD'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/bn_BD'; const typeTemplate = '${label} টি সঠিক ${type} নয়।'; diff --git a/components/locale/by_BY.tsx b/components/locale/by_BY.tsx index 7fcc69ebb6..354176b343 100644 --- a/components/locale/by_BY.tsx +++ b/components/locale/by_BY.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/by_BY'; -import DatePicker from '../date-picker/locale/by_BY'; -import TimePicker from '../time-picker/locale/by_BY'; import Calendar from '../calendar/locale/by_BY'; +import DatePicker from '../date-picker/locale/by_BY'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/by_BY'; const typeTemplate: string = "${label} не з'яўляецца тыпам ${type}"; diff --git a/components/locale/ca_ES.tsx b/components/locale/ca_ES.tsx index 2bde01e06f..ba042632b8 100644 --- a/components/locale/ca_ES.tsx +++ b/components/locale/ca_ES.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/ca_ES'; -import DatePicker from '../date-picker/locale/ca_ES'; -import TimePicker from '../time-picker/locale/ca_ES'; import Calendar from '../calendar/locale/ca_ES'; +import DatePicker from '../date-picker/locale/ca_ES'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/ca_ES'; const typeTemplate = '${label} no és un ${type} vàlid'; diff --git a/components/locale/cs_CZ.tsx b/components/locale/cs_CZ.tsx index e3bb51e9cb..0d28579493 100644 --- a/components/locale/cs_CZ.tsx +++ b/components/locale/cs_CZ.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/cs_CZ'; -import DatePicker from '../date-picker/locale/cs_CZ'; -import TimePicker from '../time-picker/locale/cs_CZ'; import Calendar from '../calendar/locale/cs_CZ'; +import DatePicker from '../date-picker/locale/cs_CZ'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/cs_CZ'; const localeValues: Locale = { locale: 'cs', diff --git a/components/locale/da_DK.tsx b/components/locale/da_DK.tsx index a582e3b8b6..03414142c4 100644 --- a/components/locale/da_DK.tsx +++ b/components/locale/da_DK.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/da_DK'; -import DatePicker from '../date-picker/locale/da_DK'; -import TimePicker from '../time-picker/locale/da_DK'; import Calendar from '../calendar/locale/da_DK'; +import DatePicker from '../date-picker/locale/da_DK'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/da_DK'; const localeValues: Locale = { locale: 'da', diff --git a/components/locale/de_DE.tsx b/components/locale/de_DE.tsx index d63d306e41..ce93cd0759 100644 --- a/components/locale/de_DE.tsx +++ b/components/locale/de_DE.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/de_DE'; -import DatePicker from '../date-picker/locale/de_DE'; -import TimePicker from '../time-picker/locale/de_DE'; import Calendar from '../calendar/locale/de_DE'; +import DatePicker from '../date-picker/locale/de_DE'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/de_DE'; const typeTemplate = '${label} ist nicht gültig. ${type} erwartet'; diff --git a/components/locale/default.tsx b/components/locale/default.tsx index 6cb1f56970..6b91199db5 100644 --- a/components/locale/default.tsx +++ b/components/locale/default.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/en_US'; -import DatePicker from '../date-picker/locale/en_US'; -import TimePicker from '../time-picker/locale/en_US'; import Calendar from '../calendar/locale/en_US'; +import DatePicker from '../date-picker/locale/en_US'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/en_US'; const typeTemplate = '${label} is not a valid ${type}'; diff --git a/components/locale/el_GR.tsx b/components/locale/el_GR.tsx index 8ea1e44aff..644f7c6491 100644 --- a/components/locale/el_GR.tsx +++ b/components/locale/el_GR.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/el_GR'; -import DatePicker from '../date-picker/locale/el_GR'; -import TimePicker from '../time-picker/locale/el_GR'; import Calendar from '../calendar/locale/el_GR'; +import DatePicker from '../date-picker/locale/el_GR'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/el_GR'; const localeValues: Locale = { locale: 'el', diff --git a/components/locale/en_GB.tsx b/components/locale/en_GB.tsx index a845d0916f..d07eeba66c 100644 --- a/components/locale/en_GB.tsx +++ b/components/locale/en_GB.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/en_GB'; -import DatePicker from '../date-picker/locale/en_GB'; -import TimePicker from '../time-picker/locale/en_GB'; import Calendar from '../calendar/locale/en_GB'; +import DatePicker from '../date-picker/locale/en_GB'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/en_GB'; const typeTemplate = '${label} is not a valid ${type}'; diff --git a/components/locale/es_ES.tsx b/components/locale/es_ES.tsx index 307065e110..4151756f7e 100644 --- a/components/locale/es_ES.tsx +++ b/components/locale/es_ES.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/es_ES'; -import DatePicker from '../date-picker/locale/es_ES'; -import TimePicker from '../time-picker/locale/es_ES'; import Calendar from '../calendar/locale/es_ES'; +import DatePicker from '../date-picker/locale/es_ES'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/es_ES'; const typeTemplate = '${label} no es un ${type} válido'; diff --git a/components/locale/et_EE.tsx b/components/locale/et_EE.tsx index 25c920fd2e..d42683631f 100644 --- a/components/locale/et_EE.tsx +++ b/components/locale/et_EE.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/et_EE'; -import DatePicker from '../date-picker/locale/et_EE'; -import TimePicker from '../time-picker/locale/et_EE'; import Calendar from '../calendar/locale/et_EE'; +import DatePicker from '../date-picker/locale/et_EE'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/et_EE'; const typeTemplate = '${label} ei ole kehtiv ${type}'; diff --git a/components/locale/fa_IR.tsx b/components/locale/fa_IR.tsx index 97ab6f99a3..681105b50b 100644 --- a/components/locale/fa_IR.tsx +++ b/components/locale/fa_IR.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/fa_IR'; -import DatePicker from '../date-picker/locale/fa_IR'; -import TimePicker from '../time-picker/locale/fa_IR'; import Calendar from '../calendar/locale/fa_IR'; +import DatePicker from '../date-picker/locale/fa_IR'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/fa_IR'; const typeTemplate = '${label} از نوع ${type} معتبر نیست'; diff --git a/components/locale/fi_FI.tsx b/components/locale/fi_FI.tsx index fb0ece8128..df9207831d 100644 --- a/components/locale/fi_FI.tsx +++ b/components/locale/fi_FI.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/fi_FI'; -import DatePicker from '../date-picker/locale/fi_FI'; -import TimePicker from '../time-picker/locale/fi_FI'; import Calendar from '../calendar/locale/fi_FI'; +import DatePicker from '../date-picker/locale/fi_FI'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/fi_FI'; const localeValues: Locale = { locale: 'fi', diff --git a/components/locale/fr_BE.tsx b/components/locale/fr_BE.tsx index b8fa6bffd4..9f08b39474 100644 --- a/components/locale/fr_BE.tsx +++ b/components/locale/fr_BE.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/fr_BE'; -import DatePicker from '../date-picker/locale/fr_BE'; -import TimePicker from '../time-picker/locale/fr_BE'; import Calendar from '../calendar/locale/fr_BE'; +import DatePicker from '../date-picker/locale/fr_BE'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/fr_BE'; const localeValues: Locale = { locale: 'fr', diff --git a/components/locale/fr_CA.tsx b/components/locale/fr_CA.tsx index 3d06674212..1038252f84 100644 --- a/components/locale/fr_CA.tsx +++ b/components/locale/fr_CA.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/fr_CA'; -import DatePicker from '../date-picker/locale/fr_CA'; -import TimePicker from '../time-picker/locale/fr_CA'; import Calendar from '../calendar/locale/fr_CA'; +import DatePicker from '../date-picker/locale/fr_CA'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/fr_CA'; const localeValues: Locale = { locale: 'fr', diff --git a/components/locale/fr_FR.tsx b/components/locale/fr_FR.tsx index 08ad31332c..18dfccb163 100644 --- a/components/locale/fr_FR.tsx +++ b/components/locale/fr_FR.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/fr_FR'; -import DatePicker from '../date-picker/locale/fr_FR'; -import TimePicker from '../time-picker/locale/fr_FR'; import Calendar from '../calendar/locale/fr_FR'; +import DatePicker from '../date-picker/locale/fr_FR'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/fr_FR'; const typeTemplate = "La valeur du champ ${label} n'est pas valide pour le type ${type}"; diff --git a/components/locale/ga_IE.tsx b/components/locale/ga_IE.tsx index e4f5342051..9aad32cdcc 100644 --- a/components/locale/ga_IE.tsx +++ b/components/locale/ga_IE.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/ga_IE'; -import DatePicker from '../date-picker/locale/ga_IE'; -import TimePicker from '../time-picker/locale/ga_IE'; import Calendar from '../calendar/locale/ga_IE'; +import DatePicker from '../date-picker/locale/ga_IE'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/ga_IE'; const typeTemplate = '${label} is not a valid ${type}'; diff --git a/components/locale/gl_ES.tsx b/components/locale/gl_ES.tsx index 343309679b..b6b59a0899 100644 --- a/components/locale/gl_ES.tsx +++ b/components/locale/gl_ES.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/gl_ES'; -import DatePicker from '../date-picker/locale/gl_ES'; -import TimePicker from '../time-picker/locale/gl_ES'; import Calendar from '../calendar/locale/gl_ES'; +import DatePicker from '../date-picker/locale/gl_ES'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/gl_ES'; const typeTemplate = '${label} non é un ${type} válido'; diff --git a/components/locale/he_IL.tsx b/components/locale/he_IL.tsx index 740e198f12..b9c809f627 100644 --- a/components/locale/he_IL.tsx +++ b/components/locale/he_IL.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/he_IL'; -import DatePicker from '../date-picker/locale/he_IL'; -import TimePicker from '../time-picker/locale/he_IL'; import Calendar from '../calendar/locale/he_IL'; +import DatePicker from '../date-picker/locale/he_IL'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/he_IL'; const typeTemplate = '${label} הוא לא ${type} תקין'; diff --git a/components/locale/hi_IN.tsx b/components/locale/hi_IN.tsx index 5dd6e71980..738e674966 100644 --- a/components/locale/hi_IN.tsx +++ b/components/locale/hi_IN.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/hi_IN'; -import DatePicker from '../date-picker/locale/hi_IN'; -import TimePicker from '../time-picker/locale/hi_IN'; import Calendar from '../calendar/locale/hi_IN'; +import DatePicker from '../date-picker/locale/hi_IN'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/hi_IN'; const typeTemplate = '${label} मान्य ${type} नहीं है'; diff --git a/components/locale/hr_HR.tsx b/components/locale/hr_HR.tsx index ecc5d58964..db188f4d6c 100644 --- a/components/locale/hr_HR.tsx +++ b/components/locale/hr_HR.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/hr_HR'; -import DatePicker from '../date-picker/locale/hr_HR'; -import TimePicker from '../time-picker/locale/hr_HR'; import Calendar from '../calendar/locale/hr_HR'; +import DatePicker from '../date-picker/locale/hr_HR'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/hr_HR'; const typeTemplate = '${label} nije valjan ${type}'; diff --git a/components/locale/hu_HU.tsx b/components/locale/hu_HU.tsx index fc0c9df7ec..cbdc228b10 100644 --- a/components/locale/hu_HU.tsx +++ b/components/locale/hu_HU.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/hu_HU'; -import DatePicker from '../date-picker/locale/hu_HU'; -import TimePicker from '../time-picker/locale/hu_HU'; import Calendar from '../calendar/locale/hu_HU'; +import DatePicker from '../date-picker/locale/hu_HU'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/hu_HU'; const localeValues: Locale = { locale: 'hu', diff --git a/components/locale/hy_AM.tsx b/components/locale/hy_AM.tsx index a324b3c986..7480c851cb 100644 --- a/components/locale/hy_AM.tsx +++ b/components/locale/hy_AM.tsx @@ -1,5 +1,5 @@ -import type { Locale } from '../locale-provider'; import type { PickerLocale } from '../date-picker/generatePicker'; +import type { Locale } from '../locale-provider'; const datePickerLocale: PickerLocale = { lang: { diff --git a/components/locale/id_ID.tsx b/components/locale/id_ID.tsx index d9b6f9fea3..dee3e95905 100644 --- a/components/locale/id_ID.tsx +++ b/components/locale/id_ID.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/id_ID'; -import DatePicker from '../date-picker/locale/id_ID'; -import TimePicker from '../time-picker/locale/id_ID'; import Calendar from '../calendar/locale/id_ID'; +import DatePicker from '../date-picker/locale/id_ID'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/id_ID'; const localeValues: Locale = { locale: 'id', diff --git a/components/locale/is_IS.tsx b/components/locale/is_IS.tsx index bc113766c6..ce2905fc95 100644 --- a/components/locale/is_IS.tsx +++ b/components/locale/is_IS.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/is_IS'; -import DatePicker from '../date-picker/locale/is_IS'; -import TimePicker from '../time-picker/locale/is_IS'; import Calendar from '../calendar/locale/is_IS'; +import DatePicker from '../date-picker/locale/is_IS'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/is_IS'; const localeValues: Locale = { locale: 'is', diff --git a/components/locale/it_IT.tsx b/components/locale/it_IT.tsx index bc91998d7d..a93b4cf47b 100644 --- a/components/locale/it_IT.tsx +++ b/components/locale/it_IT.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/it_IT'; -import DatePicker from '../date-picker/locale/it_IT'; -import TimePicker from '../time-picker/locale/it_IT'; import Calendar from '../calendar/locale/it_IT'; +import DatePicker from '../date-picker/locale/it_IT'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/it_IT'; const localeValues: Locale = { locale: 'it', diff --git a/components/locale/ja_JP.tsx b/components/locale/ja_JP.tsx index 93ced0e16e..5e41daac51 100644 --- a/components/locale/ja_JP.tsx +++ b/components/locale/ja_JP.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/ja_JP'; -import DatePicker from '../date-picker/locale/ja_JP'; -import TimePicker from '../time-picker/locale/ja_JP'; import Calendar from '../calendar/locale/ja_JP'; +import DatePicker from '../date-picker/locale/ja_JP'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/ja_JP'; const typeTemplate = '${label}は有効な${type}ではありません'; diff --git a/components/locale/ka_GE.tsx b/components/locale/ka_GE.tsx index 4e9cbd3502..c7330a61fc 100644 --- a/components/locale/ka_GE.tsx +++ b/components/locale/ka_GE.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/ka_GE'; -import DatePicker from '../date-picker/locale/ka_GE'; -import TimePicker from '../time-picker/locale/ka_GE'; import Calendar from '../calendar/locale/ka_GE'; +import DatePicker from '../date-picker/locale/ka_GE'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/ka_GE'; const typeTemplate = '${label} არ არის სწორი ${type}'; diff --git a/components/locale/kk_KZ.tsx b/components/locale/kk_KZ.tsx index f3d1bfc4a4..6665122acb 100644 --- a/components/locale/kk_KZ.tsx +++ b/components/locale/kk_KZ.tsx @@ -1,10 +1,10 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/kk_KZ'; -import DatePicker from '../date-picker/locale/kk_KZ'; -import TimePicker from '../time-picker/locale/kk_KZ'; import Calendar from '../calendar/locale/kk_KZ'; +import DatePicker from '../date-picker/locale/kk_KZ'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/kk_KZ'; const typeTemplate: string = '${label} ${type} типі емес'; diff --git a/components/locale/km_KH.tsx b/components/locale/km_KH.tsx index ed59938d44..33b04c8e84 100644 --- a/components/locale/km_KH.tsx +++ b/components/locale/km_KH.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/km_KH'; -import DatePicker from '../date-picker/locale/km_KH'; -import TimePicker from '../time-picker/locale/km_KH'; import Calendar from '../calendar/locale/km_KH'; +import DatePicker from '../date-picker/locale/km_KH'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/km_KH'; const typeTemplate = '${label} is not a valid ${type}'; diff --git a/components/locale/kmr_IQ.tsx b/components/locale/kmr_IQ.tsx index e9533ba15a..8cd6d54bd3 100644 --- a/components/locale/kmr_IQ.tsx +++ b/components/locale/kmr_IQ.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/kmr_IQ'; -import DatePicker from '../date-picker/locale/kmr_IQ'; -import TimePicker from '../time-picker/locale/kmr_IQ'; import Calendar from '../calendar/locale/kmr_IQ'; +import DatePicker from '../date-picker/locale/kmr_IQ'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/kmr_IQ'; const localeValues: Locale = { locale: 'ku', diff --git a/components/locale/kn_IN.tsx b/components/locale/kn_IN.tsx index 075b5fc947..155b352b32 100644 --- a/components/locale/kn_IN.tsx +++ b/components/locale/kn_IN.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/kn_IN'; -import DatePicker from '../date-picker/locale/kn_IN'; -import TimePicker from '../time-picker/locale/kn_IN'; import Calendar from '../calendar/locale/kn_IN'; +import DatePicker from '../date-picker/locale/kn_IN'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/kn_IN'; const localeValues: Locale = { locale: 'kn', diff --git a/components/locale/ko_KR.tsx b/components/locale/ko_KR.tsx index d352b8a9b9..647b432074 100644 --- a/components/locale/ko_KR.tsx +++ b/components/locale/ko_KR.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/ko_KR'; -import DatePicker from '../date-picker/locale/ko_KR'; -import TimePicker from '../time-picker/locale/ko_KR'; import Calendar from '../calendar/locale/ko_KR'; +import DatePicker from '../date-picker/locale/ko_KR'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/ko_KR'; const typeTemplate = '${label} 유효하지 않은 ${type}'; diff --git a/components/locale/ku_IQ.tsx b/components/locale/ku_IQ.tsx index c566dce866..d2384601f5 100755 --- a/components/locale/ku_IQ.tsx +++ b/components/locale/ku_IQ.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/kmr_IQ'; -import DatePicker from '../date-picker/locale/kmr_IQ'; -import TimePicker from '../time-picker/locale/kmr_IQ'; import Calendar from '../calendar/locale/kmr_IQ'; +import DatePicker from '../date-picker/locale/kmr_IQ'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/kmr_IQ'; // please use antd/lib/locale/kmr_IQ instead // keep this file for compatibility diff --git a/components/locale/lt_LT.tsx b/components/locale/lt_LT.tsx index 33abfd197b..f3c3ecd4f3 100644 --- a/components/locale/lt_LT.tsx +++ b/components/locale/lt_LT.tsx @@ -1,10 +1,10 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/lt_LT'; -import DatePicker from '../date-picker/locale/lt_LT'; -import TimePicker from '../time-picker/locale/lt_LT'; import Calendar from '../calendar/locale/lt_LT'; +import DatePicker from '../date-picker/locale/lt_LT'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/lt_LT'; const typeTemplate: string = '${label} neatitinka tipo ${type}'; diff --git a/components/locale/lv_LV.tsx b/components/locale/lv_LV.tsx index 2ee413bd1b..a7e711638f 100644 --- a/components/locale/lv_LV.tsx +++ b/components/locale/lv_LV.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/lv_LV'; -import DatePicker from '../date-picker/locale/lv_LV'; -import TimePicker from '../time-picker/locale/lv_LV'; import Calendar from '../calendar/locale/lv_LV'; +import DatePicker from '../date-picker/locale/lv_LV'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/lv_LV'; const localeValues: Locale = { locale: 'lv', diff --git a/components/locale/mk_MK.tsx b/components/locale/mk_MK.tsx index 766f1a9cf2..d0a387cdc9 100644 --- a/components/locale/mk_MK.tsx +++ b/components/locale/mk_MK.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/mk_MK'; -import DatePicker from '../date-picker/locale/mk_MK'; -import TimePicker from '../time-picker/locale/mk_MK'; import Calendar from '../calendar/locale/mk_MK'; +import DatePicker from '../date-picker/locale/mk_MK'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/mk_MK'; const localeValues: Locale = { locale: 'mk', diff --git a/components/locale/ml_IN.tsx b/components/locale/ml_IN.tsx index e57f0799ad..e4d12ffec0 100644 --- a/components/locale/ml_IN.tsx +++ b/components/locale/ml_IN.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/ml_IN'; -import DatePicker from '../date-picker/locale/ml_IN'; -import TimePicker from '../time-picker/locale/ml_IN'; import Calendar from '../calendar/locale/ml_IN'; +import DatePicker from '../date-picker/locale/ml_IN'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/ml_IN'; const typeTemplate = '${label} അസാധുവായ ${type} ആണ്'; diff --git a/components/locale/mn_MN.tsx b/components/locale/mn_MN.tsx index 3c03b54b64..d3d6b7f58b 100644 --- a/components/locale/mn_MN.tsx +++ b/components/locale/mn_MN.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/mn_MN'; -import DatePicker from '../date-picker/locale/mn_MN'; -import TimePicker from '../time-picker/locale/mn_MN'; import Calendar from '../calendar/locale/mn_MN'; +import DatePicker from '../date-picker/locale/mn_MN'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/mn_MN'; const localeValues: Locale = { locale: 'mn-mn', diff --git a/components/locale/ms_MY.tsx b/components/locale/ms_MY.tsx index 4b479e5dad..736083e283 100644 --- a/components/locale/ms_MY.tsx +++ b/components/locale/ms_MY.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/ms_MY'; -import DatePicker from '../date-picker/locale/ms_MY'; -import TimePicker from '../time-picker/locale/ms_MY'; import Calendar from '../calendar/locale/ms_MY'; +import DatePicker from '../date-picker/locale/ms_MY'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/ms_MY'; const localeValues: Locale = { locale: 'ms-my', diff --git a/components/locale/nb_NO.tsx b/components/locale/nb_NO.tsx index c1d0cccf66..5f2374f08f 100644 --- a/components/locale/nb_NO.tsx +++ b/components/locale/nb_NO.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/nb_NO'; -import DatePicker from '../date-picker/locale/nb_NO'; -import TimePicker from '../time-picker/locale/nb_NO'; import Calendar from '../calendar/locale/nb_NO'; +import DatePicker from '../date-picker/locale/nb_NO'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/nb_NO'; const typeTemplate = '${label} er ikke et gyldig ${type}'; diff --git a/components/locale/ne_NP.tsx b/components/locale/ne_NP.tsx index f86c805516..c066720652 100644 --- a/components/locale/ne_NP.tsx +++ b/components/locale/ne_NP.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/en_US'; -import DatePicker from '../date-picker/locale/en_US'; -import TimePicker from '../time-picker/locale/en_US'; import Calendar from '../calendar/locale/en_US'; +import DatePicker from '../date-picker/locale/en_US'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/en_US'; const localeValues: Locale = { locale: 'ne-np', diff --git a/components/locale/nl_BE.tsx b/components/locale/nl_BE.tsx index f9eeddf910..4bfe994ac4 100644 --- a/components/locale/nl_BE.tsx +++ b/components/locale/nl_BE.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/nl_BE'; -import DatePicker from '../date-picker/locale/nl_BE'; -import TimePicker from '../time-picker/locale/nl_BE'; import Calendar from '../calendar/locale/nl_BE'; +import DatePicker from '../date-picker/locale/nl_BE'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/nl_BE'; const typeTemplate = '${label} is geen geldige ${type}'; diff --git a/components/locale/nl_NL.tsx b/components/locale/nl_NL.tsx index ec505329a4..be4efa8502 100644 --- a/components/locale/nl_NL.tsx +++ b/components/locale/nl_NL.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/nl_NL'; -import DatePicker from '../date-picker/locale/nl_NL'; -import TimePicker from '../time-picker/locale/nl_NL'; import Calendar from '../calendar/locale/nl_NL'; +import DatePicker from '../date-picker/locale/nl_NL'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/nl_NL'; const typeTemplate = '${label} is geen geldige ${type}'; diff --git a/components/locale/pl_PL.tsx b/components/locale/pl_PL.tsx index 1d76ea34c1..533c6c2427 100644 --- a/components/locale/pl_PL.tsx +++ b/components/locale/pl_PL.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/pl_PL'; -import DatePicker from '../date-picker/locale/pl_PL'; -import TimePicker from '../time-picker/locale/pl_PL'; import Calendar from '../calendar/locale/pl_PL'; +import DatePicker from '../date-picker/locale/pl_PL'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/pl_PL'; const typeTemplate = '${label} nie posiada poprawnej wartości dla typu ${type}'; diff --git a/components/locale/pt_BR.tsx b/components/locale/pt_BR.tsx index 0054a8b07a..b45492ae49 100644 --- a/components/locale/pt_BR.tsx +++ b/components/locale/pt_BR.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/pt_BR'; -import DatePicker from '../date-picker/locale/pt_BR'; -import TimePicker from '../time-picker/locale/pt_BR'; import Calendar from '../calendar/locale/pt_BR'; +import DatePicker from '../date-picker/locale/pt_BR'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/pt_BR'; const typeTemplate = '${label} não é um ${type} válido'; diff --git a/components/locale/pt_PT.tsx b/components/locale/pt_PT.tsx index 6efdad794b..a0a55374f4 100644 --- a/components/locale/pt_PT.tsx +++ b/components/locale/pt_PT.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/pt_PT'; -import DatePicker from '../date-picker/locale/pt_PT'; -import TimePicker from '../time-picker/locale/pt_PT'; import Calendar from '../calendar/locale/pt_PT'; +import DatePicker from '../date-picker/locale/pt_PT'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/pt_PT'; const localeValues: Locale = { locale: 'pt', diff --git a/components/locale/ro_RO.tsx b/components/locale/ro_RO.tsx index 728b84b0ce..dcaea95a88 100644 --- a/components/locale/ro_RO.tsx +++ b/components/locale/ro_RO.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/ro_RO'; -import DatePicker from '../date-picker/locale/ro_RO'; -import TimePicker from '../time-picker/locale/ro_RO'; import Calendar from '../calendar/locale/ro_RO'; +import DatePicker from '../date-picker/locale/ro_RO'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/ro_RO'; const typeTemplate = '${label} nu conține tipul corect (${type})'; diff --git a/components/locale/ru_RU.tsx b/components/locale/ru_RU.tsx index 495b7e2d4c..30b8caf8ba 100644 --- a/components/locale/ru_RU.tsx +++ b/components/locale/ru_RU.tsx @@ -1,10 +1,10 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/ru_RU'; -import DatePicker from '../date-picker/locale/ru_RU'; -import TimePicker from '../time-picker/locale/ru_RU'; import Calendar from '../calendar/locale/ru_RU'; +import DatePicker from '../date-picker/locale/ru_RU'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/ru_RU'; const typeTemplate: string = '${label} не является типом ${type}'; diff --git a/components/locale/sk_SK.tsx b/components/locale/sk_SK.tsx index 0e26e09379..59c02defa3 100644 --- a/components/locale/sk_SK.tsx +++ b/components/locale/sk_SK.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/sk_SK'; -import DatePicker from '../date-picker/locale/sk_SK'; -import TimePicker from '../time-picker/locale/sk_SK'; import Calendar from '../calendar/locale/sk_SK'; +import DatePicker from '../date-picker/locale/sk_SK'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/sk_SK'; const typeTemplate = '${label} nie je platný ${type}'; diff --git a/components/locale/sl_SI.tsx b/components/locale/sl_SI.tsx index d848e4bb14..74ca51971a 100644 --- a/components/locale/sl_SI.tsx +++ b/components/locale/sl_SI.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/sl_SI'; -import DatePicker from '../date-picker/locale/sl_SI'; -import TimePicker from '../time-picker/locale/sl_SI'; import Calendar from '../calendar/locale/sl_SI'; +import DatePicker from '../date-picker/locale/sl_SI'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/sl_SI'; const localeValues: Locale = { locale: 'sl', diff --git a/components/locale/sr_RS.tsx b/components/locale/sr_RS.tsx index 42ad986510..b2c8ab8aeb 100644 --- a/components/locale/sr_RS.tsx +++ b/components/locale/sr_RS.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/sr_RS'; -import DatePicker from '../date-picker/locale/sr_RS'; -import TimePicker from '../time-picker/locale/sr_RS'; import Calendar from '../calendar/locale/sr_RS'; +import DatePicker from '../date-picker/locale/sr_RS'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/sr_RS'; const typeTemplate = '${label} nije važeći ${type}'; diff --git a/components/locale/sv_SE.tsx b/components/locale/sv_SE.tsx index 6a5b0cdccc..af34f836da 100644 --- a/components/locale/sv_SE.tsx +++ b/components/locale/sv_SE.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/sv_SE'; -import DatePicker from '../date-picker/locale/sv_SE'; -import TimePicker from '../time-picker/locale/sv_SE'; import Calendar from '../calendar/locale/sv_SE'; +import DatePicker from '../date-picker/locale/sv_SE'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/sv_SE'; const typeTemplate = '${label} är inte en giltig ${type}'; diff --git a/components/locale/ta_IN.tsx b/components/locale/ta_IN.tsx index fa7976ace6..d3be76755a 100644 --- a/components/locale/ta_IN.tsx +++ b/components/locale/ta_IN.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/ta_IN'; -import DatePicker from '../date-picker/locale/ta_IN'; -import TimePicker from '../time-picker/locale/ta_IN'; import Calendar from '../calendar/locale/ta_IN'; +import DatePicker from '../date-picker/locale/ta_IN'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/ta_IN'; const localeValues: Locale = { locale: 'ta', diff --git a/components/locale/th_TH.tsx b/components/locale/th_TH.tsx index 1baeebd79f..ff4623098f 100644 --- a/components/locale/th_TH.tsx +++ b/components/locale/th_TH.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/th_TH'; -import DatePicker from '../date-picker/locale/th_TH'; -import TimePicker from '../time-picker/locale/th_TH'; import Calendar from '../calendar/locale/th_TH'; +import DatePicker from '../date-picker/locale/th_TH'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/th_TH'; const typeTemplate = '${label} ไม่ใช่ ${type} ที่ถูกต้อง'; diff --git a/components/locale/tk_TK.tsx b/components/locale/tk_TK.tsx index 41fcad90fa..c1b2b1dae6 100644 --- a/components/locale/tk_TK.tsx +++ b/components/locale/tk_TK.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/tk_TK'; -import DatePicker from '../date-picker/locale/tk_TK'; -import TimePicker from '../time-picker/locale/tk_TK'; import Calendar from '../calendar/locale/tk_TK'; +import DatePicker from '../date-picker/locale/tk_TK'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/tk_TK'; const typeTemplate: string = '${label} ${type} görnüşinde däl'; diff --git a/components/locale/tr_TR.tsx b/components/locale/tr_TR.tsx index a5115c80e3..71dfd923f5 100644 --- a/components/locale/tr_TR.tsx +++ b/components/locale/tr_TR.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/tr_TR'; -import DatePicker from '../date-picker/locale/tr_TR'; -import TimePicker from '../time-picker/locale/tr_TR'; import Calendar from '../calendar/locale/tr_TR'; +import DatePicker from '../date-picker/locale/tr_TR'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/tr_TR'; const typeTemplate = '${label} geçerli bir ${type} değil'; diff --git a/components/locale/uk_UA.tsx b/components/locale/uk_UA.tsx index 52ae8fba53..bbbed5ba45 100644 --- a/components/locale/uk_UA.tsx +++ b/components/locale/uk_UA.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/uk_UA'; -import DatePicker from '../date-picker/locale/uk_UA'; -import TimePicker from '../time-picker/locale/uk_UA'; import Calendar from '../calendar/locale/uk_UA'; +import DatePicker from '../date-picker/locale/uk_UA'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/uk_UA'; const typeTemplate = '${label} не є типом ${type}'; diff --git a/components/locale/ur_PK.tsx b/components/locale/ur_PK.tsx index 457c1b6a96..ff5a07bb18 100644 --- a/components/locale/ur_PK.tsx +++ b/components/locale/ur_PK.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/ur_PK'; -import DatePicker from '../date-picker/locale/ur_PK'; -import TimePicker from '../time-picker/locale/ur_PK'; import Calendar from '../calendar/locale/ur_PK'; +import DatePicker from '../date-picker/locale/ur_PK'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/ur_PK'; const typeTemplate = '${label} درست نہیں ہے ${type}'; diff --git a/components/locale/vi_VN.tsx b/components/locale/vi_VN.tsx index d6ab3f8e51..0af968dd01 100644 --- a/components/locale/vi_VN.tsx +++ b/components/locale/vi_VN.tsx @@ -1,8 +1,8 @@ import Pagination from 'rc-pagination/lib/locale/vi_VN'; -import DatePicker from '../date-picker/locale/vi_VN'; -import TimePicker from '../time-picker/locale/vi_VN'; import Calendar from '../calendar/locale/vi_VN'; +import DatePicker from '../date-picker/locale/vi_VN'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/vi_VN'; const localeValues: Locale = { locale: 'vi', diff --git a/components/locale/zh_CN.tsx b/components/locale/zh_CN.tsx index 176b819c5d..66d38cecad 100644 --- a/components/locale/zh_CN.tsx +++ b/components/locale/zh_CN.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/zh_CN'; -import DatePicker from '../date-picker/locale/zh_CN'; -import TimePicker from '../time-picker/locale/zh_CN'; import Calendar from '../calendar/locale/zh_CN'; +import DatePicker from '../date-picker/locale/zh_CN'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/zh_CN'; const typeTemplate = '${label}不是一个有效的${type}'; diff --git a/components/locale/zh_HK.tsx b/components/locale/zh_HK.tsx index f55d718bf8..f8dce3dbd2 100644 --- a/components/locale/zh_HK.tsx +++ b/components/locale/zh_HK.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/zh_TW'; -import DatePicker from '../date-picker/locale/zh_TW'; -import TimePicker from '../time-picker/locale/zh_TW'; import Calendar from '../calendar/locale/zh_TW'; +import DatePicker from '../date-picker/locale/zh_TW'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/zh_TW'; const typeTemplate = '${label}不是一個有效的${type}'; diff --git a/components/locale/zh_TW.tsx b/components/locale/zh_TW.tsx index dec573bcd8..6b3445d8e3 100644 --- a/components/locale/zh_TW.tsx +++ b/components/locale/zh_TW.tsx @@ -1,9 +1,9 @@ /* eslint-disable no-template-curly-in-string */ import Pagination from 'rc-pagination/lib/locale/zh_TW'; -import DatePicker from '../date-picker/locale/zh_TW'; -import TimePicker from '../time-picker/locale/zh_TW'; import Calendar from '../calendar/locale/zh_TW'; +import DatePicker from '../date-picker/locale/zh_TW'; import type { Locale } from '../locale-provider'; +import TimePicker from '../time-picker/locale/zh_TW'; const typeTemplate = '${label}不是一個有效的${type}'; diff --git a/components/mentions/__tests__/index.test.js b/components/mentions/__tests__/index.test.js index 46c04a1f7a..6484f5b014 100644 --- a/components/mentions/__tests__/index.test.js +++ b/components/mentions/__tests__/index.test.js @@ -1,5 +1,5 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import Mentions from '..'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; diff --git a/components/menu/MenuDivider.tsx b/components/menu/MenuDivider.tsx index c94b3868fb..ae93440a87 100644 --- a/components/menu/MenuDivider.tsx +++ b/components/menu/MenuDivider.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; import classNames from 'classnames'; import { Divider } from 'rc-menu'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; export interface MenuDividerProps extends React.HTMLAttributes { diff --git a/components/menu/MenuItem.tsx b/components/menu/MenuItem.tsx index 74ebc14be9..3808501391 100644 --- a/components/menu/MenuItem.tsx +++ b/components/menu/MenuItem.tsx @@ -1,15 +1,15 @@ -import * as React from 'react'; +import classNames from 'classnames'; import type { MenuItemProps as RcMenuItemProps } from 'rc-menu'; import { Item } from 'rc-menu'; import toArray from 'rc-util/lib/Children/toArray'; -import classNames from 'classnames'; -import type { MenuContextProps } from './MenuContext'; -import MenuContext from './MenuContext'; -import type { TooltipProps } from '../tooltip'; -import Tooltip from '../tooltip'; +import * as React from 'react'; import type { SiderContextProps } from '../layout/Sider'; import { SiderContext } from '../layout/Sider'; -import { isValidElement, cloneElement } from '../_util/reactNode'; +import type { TooltipProps } from '../tooltip'; +import Tooltip from '../tooltip'; +import { cloneElement, isValidElement } from '../_util/reactNode'; +import type { MenuContextProps } from './MenuContext'; +import MenuContext from './MenuContext'; export interface MenuItemProps extends Omit { icon?: React.ReactNode; diff --git a/components/menu/SubMenu.tsx b/components/menu/SubMenu.tsx index e1b450a926..861b80e874 100644 --- a/components/menu/SubMenu.tsx +++ b/components/menu/SubMenu.tsx @@ -1,10 +1,10 @@ -import * as React from 'react'; -import { SubMenu as RcSubMenu, useFullPath } from 'rc-menu'; import classNames from 'classnames'; +import { SubMenu as RcSubMenu, useFullPath } from 'rc-menu'; import omit from 'rc-util/lib/omit'; +import * as React from 'react'; +import { cloneElement, isValidElement } from '../_util/reactNode'; import type { MenuTheme } from './MenuContext'; import MenuContext from './MenuContext'; -import { isValidElement, cloneElement } from '../_util/reactNode'; interface TitleEventEntity { key: string; diff --git a/components/menu/__tests__/cached-context.test.tsx b/components/menu/__tests__/cached-context.test.tsx index 1d3a3aff7f..0c88013044 100644 --- a/components/menu/__tests__/cached-context.test.tsx +++ b/components/menu/__tests__/cached-context.test.tsx @@ -1,5 +1,5 @@ -import React, { memo, useState, useRef, useContext } from 'react'; import { mount } from 'enzyme'; +import React, { memo, useContext, useRef, useState } from 'react'; import Menu from '../index'; import MenuContext from '../MenuContext'; diff --git a/components/menu/__tests__/index.test.js b/components/menu/__tests__/index.test.js index 6a3a0d53d5..09f2c6e5b5 100644 --- a/components/menu/__tests__/index.test.js +++ b/components/menu/__tests__/index.test.js @@ -1,19 +1,19 @@ -import React, { useState } from 'react'; -import { mount } from 'enzyme'; import { - MailOutlined, - InboxOutlined, AppstoreOutlined, + InboxOutlined, + MailOutlined, PieChartOutlined, UserOutlined, } from '@ant-design/icons'; +import { mount } from 'enzyme'; +import React, { useState } from 'react'; import { act } from 'react-dom/test-utils'; import Menu from '..'; -import Layout from '../../layout'; -import Tooltip from '../../tooltip'; 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 Layout from '../../layout'; +import Tooltip from '../../tooltip'; import collapseMotion from '../../_util/motion'; import { noop } from '../../_util/warning'; diff --git a/components/menu/hooks/useItems.tsx b/components/menu/hooks/useItems.tsx index e558dd8243..17c2695811 100644 --- a/components/menu/hooks/useItems.tsx +++ b/components/menu/hooks/useItems.tsx @@ -1,14 +1,14 @@ -import * as React from 'react'; import { ItemGroup } from 'rc-menu'; import type { - MenuItemType as RcMenuItemType, MenuDividerType as RcMenuDividerType, - SubMenuType as RcSubMenuType, MenuItemGroupType as RcMenuItemGroupType, + MenuItemType as RcMenuItemType, + SubMenuType as RcSubMenuType, } from 'rc-menu/lib/interface'; -import SubMenu from '../SubMenu'; +import * as React from 'react'; import MenuDivider from '../MenuDivider'; import MenuItem from '../MenuItem'; +import SubMenu from '../SubMenu'; interface MenuItemType extends RcMenuItemType { danger?: boolean; diff --git a/components/message/__tests__/config.test.js b/components/message/__tests__/config.test.js index 2e7815f534..68760d00e5 100644 --- a/components/message/__tests__/config.test.js +++ b/components/message/__tests__/config.test.js @@ -1,6 +1,6 @@ import { act } from 'react-dom/test-utils'; -import { sleep } from '../../../tests/utils'; import message, { getInstance } from '..'; +import { sleep } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; describe('message.config', () => { diff --git a/components/message/__tests__/hooks.test.js b/components/message/__tests__/hooks.test.js index 8fd11a6862..2ff604cf82 100644 --- a/components/message/__tests__/hooks.test.js +++ b/components/message/__tests__/hooks.test.js @@ -1,6 +1,6 @@ /* eslint-disable jsx-a11y/control-has-associated-label */ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import { act } from 'react-dom/test-utils'; import message, { getInstance } from '..'; import ConfigProvider from '../../config-provider'; diff --git a/components/message/__tests__/index.test.js b/components/message/__tests__/index.test.js index 2efc4840cf..a60349b9c4 100644 --- a/components/message/__tests__/index.test.js +++ b/components/message/__tests__/index.test.js @@ -1,7 +1,7 @@ -import React from 'react'; -import { mount } from 'enzyme'; -import { act } from 'react-dom/test-utils'; import { SmileOutlined } from '@ant-design/icons'; +import { mount } from 'enzyme'; +import React from 'react'; +import { act } from 'react-dom/test-utils'; import message, { getInstance } from '..'; globalThis.IS_REACT_ACT_ENVIRONMENT = true; diff --git a/components/message/hooks/useMessage.tsx b/components/message/hooks/useMessage.tsx index 305e570045..639920b276 100644 --- a/components/message/hooks/useMessage.tsx +++ b/components/message/hooks/useMessage.tsx @@ -1,14 +1,14 @@ -import * as React from 'react'; -import useRCNotification from 'rc-notification/lib/useNotification'; import type { - NotificationInstance as RCNotificationInstance, - NoticeContent as RCNoticeContent, HolderReadyCallback as RCHolderReadyCallback, + NoticeContent as RCNoticeContent, + NotificationInstance as RCNotificationInstance, } from 'rc-notification/lib/Notification'; +import useRCNotification from 'rc-notification/lib/useNotification'; +import * as React from 'react'; +import type { ArgsProps, MessageInstance, ThenableArgument } from '..'; +import { attachTypeApi, getKeyThenIncreaseKey, typeList } from '..'; import type { ConfigConsumerProps } from '../../config-provider'; import { ConfigConsumer } from '../../config-provider'; -import type { MessageInstance, ArgsProps, ThenableArgument } from '..'; -import { attachTypeApi, getKeyThenIncreaseKey, typeList } from '..'; export default function createUseMessage( getRcNotificationInstance: ( diff --git a/components/message/index.tsx b/components/message/index.tsx index 73cbfbacb9..f6e20d9c1b 100755 --- a/components/message/index.tsx +++ b/components/message/index.tsx @@ -1,17 +1,17 @@ -import * as React from 'react'; +import CheckCircleFilled from '@ant-design/icons/CheckCircleFilled'; +import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; +import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled'; +import InfoCircleFilled from '@ant-design/icons/InfoCircleFilled'; +import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import classNames from 'classnames'; import RCNotification from 'rc-notification'; import type { - NotificationInstance as RCNotificationInstance, NoticeContent, + NotificationInstance as RCNotificationInstance, } from 'rc-notification/lib/Notification'; -import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; -import ExclamationCircleFilled from '@ant-design/icons/ExclamationCircleFilled'; -import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; -import CheckCircleFilled from '@ant-design/icons/CheckCircleFilled'; -import InfoCircleFilled from '@ant-design/icons/InfoCircleFilled'; -import createUseMessage from './hooks/useMessage'; +import * as React from 'react'; import ConfigProvider, { globalConfig } from '../config-provider'; +import createUseMessage from './hooks/useMessage'; let messageInstance: RCNotificationInstance | null; let defaultDuration = 3; diff --git a/components/modal/ConfirmDialog.tsx b/components/modal/ConfirmDialog.tsx index f27b6b8a83..2af9d95b4e 100644 --- a/components/modal/ConfirmDialog.tsx +++ b/components/modal/ConfirmDialog.tsx @@ -1,11 +1,11 @@ -import * as React from 'react'; import classNames from 'classnames'; +import * as React from 'react'; +import ConfigProvider from '../config-provider'; +import ActionButton from '../_util/ActionButton'; +import { getTransitionName } from '../_util/motion'; +import warning from '../_util/warning'; import type { ModalFuncProps } from './Modal'; import Dialog from './Modal'; -import ActionButton from '../_util/ActionButton'; -import warning from '../_util/warning'; -import ConfigProvider from '../config-provider'; -import { getTransitionName } from '../_util/motion'; interface ConfirmDialogProps extends ModalFuncProps { afterClose?: () => void; diff --git a/components/modal/__tests__/Modal.test.tsx b/components/modal/__tests__/Modal.test.tsx index 1324f5fac4..177a5f131c 100644 --- a/components/modal/__tests__/Modal.test.tsx +++ b/components/modal/__tests__/Modal.test.tsx @@ -1,9 +1,9 @@ import React from 'react'; -import Modal from '..'; import type { ModalProps } from '..'; +import Modal from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; -import { render, fireEvent } from '../../../tests/utils'; +import { fireEvent, render } from '../../../tests/utils'; jest.mock('rc-util/lib/Portal'); diff --git a/components/modal/__tests__/confirm.test.js b/components/modal/__tests__/confirm.test.js index 3581c80a1f..32f48ffb79 100644 --- a/components/modal/__tests__/confirm.test.js +++ b/components/modal/__tests__/confirm.test.js @@ -1,14 +1,14 @@ -import * as React from 'react'; -import TestUtils, { act } from 'react-dom/test-utils'; -import CSSMotion from 'rc-motion'; import { SmileOutlined } from '@ant-design/icons'; +import CSSMotion from 'rc-motion'; import { genCSSMotion } from 'rc-motion/lib/CSSMotion'; import KeyCode from 'rc-util/lib/KeyCode'; import { resetWarned } from 'rc-util/lib/warning'; +import * as React from 'react'; +import TestUtils, { act } from 'react-dom/test-utils'; import Modal from '..'; -import destroyFns from '../destroyFns'; import { sleep } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; +import destroyFns from '../destroyFns'; globalThis.IS_REACT_ACT_ENVIRONMENT = true; diff --git a/components/modal/__tests__/hook.test.tsx b/components/modal/__tests__/hook.test.tsx index d2c89bb27f..8282af809c 100644 --- a/components/modal/__tests__/hook.test.tsx +++ b/components/modal/__tests__/hook.test.tsx @@ -1,12 +1,12 @@ -import React from 'react'; import CSSMotion from 'rc-motion'; -import { act } from 'react-dom/test-utils'; import { genCSSMotion } from 'rc-motion/lib/CSSMotion'; +import React from 'react'; +import { act } from 'react-dom/test-utils'; import Modal from '..'; +import { fireEvent, render } from '../../../tests/utils'; import Button from '../../button'; -import Input from '../../input'; import ConfigProvider from '../../config-provider'; -import { render, fireEvent } from '../../../tests/utils'; +import Input from '../../input'; import type { ModalFunc } from '../confirm'; jest.mock('rc-util/lib/Portal'); diff --git a/components/modal/confirm.tsx b/components/modal/confirm.tsx index 5b9075eede..4301154dbc 100644 --- a/components/modal/confirm.tsx +++ b/components/modal/confirm.tsx @@ -1,15 +1,15 @@ -import * as React from 'react'; -import { render as reactRender, unmount as reactUnmount } from 'rc-util/lib/React/render'; -import InfoCircleOutlined from '@ant-design/icons/InfoCircleOutlined'; import CheckCircleOutlined from '@ant-design/icons/CheckCircleOutlined'; import CloseCircleOutlined from '@ant-design/icons/CloseCircleOutlined'; import ExclamationCircleOutlined from '@ant-design/icons/ExclamationCircleOutlined'; -import { getConfirmLocale } from './locale'; -import type { ModalFuncProps } from './Modal'; -import ConfirmDialog from './ConfirmDialog'; +import InfoCircleOutlined from '@ant-design/icons/InfoCircleOutlined'; +import { render as reactRender, unmount as reactUnmount } from 'rc-util/lib/React/render'; +import * as React from 'react'; import { globalConfig } from '../config-provider'; import warning from '../_util/warning'; +import ConfirmDialog from './ConfirmDialog'; import destroyFns from './destroyFns'; +import { getConfirmLocale } from './locale'; +import type { ModalFuncProps } from './Modal'; let defaultRootPrefixCls = ''; diff --git a/components/modal/index.tsx b/components/modal/index.tsx index 4338d44f6d..fc29d680eb 100644 --- a/components/modal/index.tsx +++ b/components/modal/index.tsx @@ -1,18 +1,18 @@ -import type { ModalFuncProps } from './Modal'; -import OriginModal from './Modal'; import type { ModalStaticFunctions } from './confirm'; import confirm, { - withWarn, + modalGlobalConfig, + withConfirm, + withError, withInfo, withSuccess, - withError, - withConfirm, - modalGlobalConfig, + withWarn, } from './confirm'; -import useModal from './useModal'; import destroyFns from './destroyFns'; +import type { ModalFuncProps } from './Modal'; +import OriginModal from './Modal'; +import useModal from './useModal'; -export { ModalProps, ModalFuncProps } from './Modal'; +export { ModalFuncProps, ModalProps } from './Modal'; function modalWarn(props: ModalFuncProps) { return confirm(withWarn(props)); diff --git a/components/modal/useModal/HookModal.tsx b/components/modal/useModal/HookModal.tsx index 08e7399acb..6c19c3dcce 100644 --- a/components/modal/useModal/HookModal.tsx +++ b/components/modal/useModal/HookModal.tsx @@ -1,9 +1,9 @@ import * as React from 'react'; -import type { ModalFuncProps } from '../Modal'; -import ConfirmDialog from '../ConfirmDialog'; -import defaultLocale from '../../locale/default'; -import LocaleReceiver from '../../locale-provider/LocaleReceiver'; import { ConfigContext } from '../../config-provider'; +import LocaleReceiver from '../../locale-provider/LocaleReceiver'; +import defaultLocale from '../../locale/default'; +import ConfirmDialog from '../ConfirmDialog'; +import type { ModalFuncProps } from '../Modal'; export interface HookModalProps { afterClose: () => void; diff --git a/components/modal/useModal/index.tsx b/components/modal/useModal/index.tsx index 5aa1739943..d51b7a19dc 100644 --- a/components/modal/useModal/index.tsx +++ b/components/modal/useModal/index.tsx @@ -1,10 +1,10 @@ import * as React from 'react'; -import type { ModalFuncProps } from '../Modal'; import usePatchElement from '../../_util/hooks/usePatchElement'; +import type { ModalStaticFunctions } from '../confirm'; +import { withConfirm, withError, withInfo, withSuccess, withWarn } from '../confirm'; +import type { ModalFuncProps } from '../Modal'; import type { HookModalRef } from './HookModal'; import HookModal from './HookModal'; -import type { ModalStaticFunctions } from '../confirm'; -import { withConfirm, withInfo, withSuccess, withError, withWarn } from '../confirm'; let uuid = 0; diff --git a/components/notification/__tests__/hooks.test.js b/components/notification/__tests__/hooks.test.js index e2261ab47d..0587cdba91 100644 --- a/components/notification/__tests__/hooks.test.js +++ b/components/notification/__tests__/hooks.test.js @@ -1,6 +1,6 @@ /* eslint-disable jsx-a11y/control-has-associated-label */ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import notification from '..'; import ConfigProvider from '../../config-provider'; diff --git a/components/notification/__tests__/index.test.js b/components/notification/__tests__/index.test.js index 6f7446e6ca..b674ddfbff 100644 --- a/components/notification/__tests__/index.test.js +++ b/components/notification/__tests__/index.test.js @@ -1,9 +1,9 @@ +import { UserOutlined } from '@ant-design/icons'; import React from 'react'; import { act } from 'react-dom/test-utils'; -import { UserOutlined } from '@ant-design/icons'; import notification, { getInstance } from '..'; -import ConfigProvider from '../../config-provider'; import { sleep } from '../../../tests/utils'; +import ConfigProvider from '../../config-provider'; globalThis.IS_REACT_ACT_ENVIRONMENT = true; diff --git a/components/notification/hooks/useNotification.tsx b/components/notification/hooks/useNotification.tsx index 405bba4cdb..bcef4d72e0 100644 --- a/components/notification/hooks/useNotification.tsx +++ b/components/notification/hooks/useNotification.tsx @@ -1,13 +1,13 @@ -import * as React from 'react'; -import useRCNotification from 'rc-notification/lib/useNotification'; import type { - NotificationInstance as RCNotificationInstance, - NoticeContent as RCNoticeContent, HolderReadyCallback as RCHolderReadyCallback, + NoticeContent as RCNoticeContent, + NotificationInstance as RCNotificationInstance, } from 'rc-notification/lib/Notification'; +import useRCNotification from 'rc-notification/lib/useNotification'; +import * as React from 'react'; +import type { ArgsProps, NotificationInstance } from '..'; import type { ConfigConsumerProps } from '../../config-provider'; import { ConfigConsumer } from '../../config-provider'; -import type { NotificationInstance, ArgsProps } from '..'; export default function createUseNotification( getNotificationInstance: ( diff --git a/components/notification/index.tsx b/components/notification/index.tsx index 951a74a45c..0784dcd8a6 100755 --- a/components/notification/index.tsx +++ b/components/notification/index.tsx @@ -1,14 +1,14 @@ -import * as React from 'react'; -import Notification from 'rc-notification'; -import type { NotificationInstance as RCNotificationInstance } from 'rc-notification/lib/Notification'; -import CloseOutlined from '@ant-design/icons/CloseOutlined'; -import classNames from 'classnames'; import CheckCircleOutlined from '@ant-design/icons/CheckCircleOutlined'; import CloseCircleOutlined from '@ant-design/icons/CloseCircleOutlined'; +import CloseOutlined from '@ant-design/icons/CloseOutlined'; import ExclamationCircleOutlined from '@ant-design/icons/ExclamationCircleOutlined'; import InfoCircleOutlined from '@ant-design/icons/InfoCircleOutlined'; -import createUseNotification from './hooks/useNotification'; +import classNames from 'classnames'; +import Notification from 'rc-notification'; +import type { NotificationInstance as RCNotificationInstance } from 'rc-notification/lib/Notification'; +import * as React from 'react'; import ConfigProvider, { globalConfig } from '../config-provider'; +import createUseNotification from './hooks/useNotification'; export type NotificationPlacement = | 'top' diff --git a/components/page-header/__tests__/index.test.js b/components/page-header/__tests__/index.test.js index 2bd63e3295..b74162ea0b 100644 --- a/components/page-header/__tests__/index.test.js +++ b/components/page-header/__tests__/index.test.js @@ -1,10 +1,10 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import PageHeader from '..'; -import Breadcrumb from '../../breadcrumb'; -import ConfigProvider from '../../config-provider'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; +import Breadcrumb from '../../breadcrumb'; +import ConfigProvider from '../../config-provider'; describe('PageHeader', () => { mountTest(PageHeader); diff --git a/components/page-header/index.tsx b/components/page-header/index.tsx index 2287c267d1..03911f245f 100644 --- a/components/page-header/index.tsx +++ b/components/page-header/index.tsx @@ -1,19 +1,19 @@ -import * as React from 'react'; -import classNames from 'classnames'; -import useState from 'rc-util/lib/hooks/useState'; import ArrowLeftOutlined from '@ant-design/icons/ArrowLeftOutlined'; import ArrowRightOutlined from '@ant-design/icons/ArrowRightOutlined'; +import classNames from 'classnames'; import ResizeObserver from 'rc-resize-observer'; -import type { ConfigConsumerProps, DirectionType } from '../config-provider'; -import { ConfigConsumer } from '../config-provider'; -import type { TagType } from '../tag'; -import type { BreadcrumbProps } from '../breadcrumb'; -import Breadcrumb from '../breadcrumb'; +import useState from 'rc-util/lib/hooks/useState'; +import * as React from 'react'; import type { AvatarProps } from '../avatar'; import Avatar from '../avatar'; -import Space from '../space'; -import TransButton from '../_util/transButton'; +import type { BreadcrumbProps } from '../breadcrumb'; +import Breadcrumb from '../breadcrumb'; +import type { ConfigConsumerProps, DirectionType } from '../config-provider'; +import { ConfigConsumer } from '../config-provider'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; +import Space from '../space'; +import type { TagType } from '../tag'; +import TransButton from '../_util/transButton'; export interface PageHeaderProps { backIcon?: React.ReactNode; diff --git a/components/page-header/style/index.tsx b/components/page-header/style/index.tsx index cd4e5ba32d..5146a5fd56 100644 --- a/components/page-header/style/index.tsx +++ b/components/page-header/style/index.tsx @@ -1,6 +1,6 @@ import './index.less'; // style dependencies -import '../../breadcrumb/style'; import '../../avatar/style'; +import '../../breadcrumb/style'; import '../../space/style'; diff --git a/components/pagination/Select.tsx b/components/pagination/Select.tsx index 05e7fe0643..60ee55425c 100644 --- a/components/pagination/Select.tsx +++ b/components/pagination/Select.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import Select from '../select'; import type { SelectProps } from '../select'; +import Select from '../select'; interface MiniOrMiddleSelectInterface extends React.FC { Option: typeof Select.Option; @@ -13,4 +13,3 @@ MiniSelect.Option = Select.Option; MiddleSelect.Option = Select.Option; export { MiniSelect, MiddleSelect }; - diff --git a/components/pagination/index.tsx b/components/pagination/index.tsx index 73955965bc..df19439930 100644 --- a/components/pagination/index.tsx +++ b/components/pagination/index.tsx @@ -1,4 +1,4 @@ import Pagination from './Pagination'; -export { PaginationProps, PaginationConfig } from './Pagination'; +export { PaginationConfig, PaginationProps } from './Pagination'; export default Pagination; diff --git a/components/popconfirm/style/index.tsx b/components/popconfirm/style/index.tsx index f0c7bbe6da..29abacd085 100644 --- a/components/popconfirm/style/index.tsx +++ b/components/popconfirm/style/index.tsx @@ -2,7 +2,7 @@ import '../../style/index.less'; // style dependencies // deps-lint-skip: tooltip, popover -import '../../popover/style'; import '../../button/style'; +import '../../popover/style'; import './index.less'; diff --git a/components/popover/__tests__/index.test.js b/components/popover/__tests__/index.test.js index 062e23489f..a982f5307e 100644 --- a/components/popover/__tests__/index.test.js +++ b/components/popover/__tests__/index.test.js @@ -1,8 +1,8 @@ -import React from 'react'; import { mount } from 'enzyme'; -import { render } from '../../../tests/utils'; +import React from 'react'; import Popover from '..'; import mountTest from '../../../tests/shared/mountTest'; +import { render } from '../../../tests/utils'; import ConfigProvider from '../../config-provider'; describe('Popover', () => { diff --git a/components/progress/Circle.tsx b/components/progress/Circle.tsx index c7003b769d..d4c34d0bbf 100644 --- a/components/progress/Circle.tsx +++ b/components/progress/Circle.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; -import { Circle as RCCircle } from 'rc-progress'; import { presetPrimaryColors } from '@ant-design/colors'; import classNames from 'classnames'; -import { validProgress, getSuccessPercent } from './utils'; -import type { ProgressProps, ProgressGradient } from './progress'; +import { Circle as RCCircle } from 'rc-progress'; +import * as React from 'react'; +import type { ProgressGradient, ProgressProps } from './progress'; +import { getSuccessPercent, validProgress } from './utils'; interface CircleProps extends ProgressProps { prefixCls: string; diff --git a/components/progress/Line.tsx b/components/progress/Line.tsx index 246b9e62a4..ea6517a1f4 100644 --- a/components/progress/Line.tsx +++ b/components/progress/Line.tsx @@ -1,8 +1,8 @@ -import * as React from 'react'; import { presetPrimaryColors } from '@ant-design/colors'; -import type { ProgressGradient, ProgressProps, StringGradients } from './progress'; -import { validProgress, getSuccessPercent } from './utils'; +import * as React from 'react'; import type { DirectionType } from '../config-provider'; +import type { ProgressGradient, ProgressProps, StringGradients } from './progress'; +import { getSuccessPercent, validProgress } from './utils'; interface LineProps extends ProgressProps { prefixCls: string; diff --git a/components/progress/__tests__/index.test.js b/components/progress/__tests__/index.test.js index 606a1661bf..c06248c1dd 100644 --- a/components/progress/__tests__/index.test.js +++ b/components/progress/__tests__/index.test.js @@ -1,10 +1,10 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import Progress from '..'; -import { handleGradient, sortGradient } from '../Line'; -import ProgressSteps from '../Steps'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; +import { handleGradient, sortGradient } from '../Line'; +import ProgressSteps from '../Steps'; describe('Progress', () => { mountTest(Progress); diff --git a/components/progress/progress.tsx b/components/progress/progress.tsx index 09b4d97a52..e0bb06a3e9 100644 --- a/components/progress/progress.tsx +++ b/components/progress/progress.tsx @@ -1,17 +1,17 @@ -import * as React from 'react'; +import CheckCircleFilled from '@ant-design/icons/CheckCircleFilled'; +import CheckOutlined from '@ant-design/icons/CheckOutlined'; +import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; +import CloseOutlined from '@ant-design/icons/CloseOutlined'; import classNames from 'classnames'; import omit from 'rc-util/lib/omit'; -import CloseOutlined from '@ant-design/icons/CloseOutlined'; -import CheckOutlined from '@ant-design/icons/CheckOutlined'; -import CheckCircleFilled from '@ant-design/icons/CheckCircleFilled'; -import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import { tuple } from '../_util/type'; import warning from '../_util/warning'; -import Line from './Line'; import Circle from './Circle'; +import Line from './Line'; import Steps from './Steps'; -import { validProgress, getSuccessPercent } from './utils'; +import { getSuccessPercent, validProgress } from './utils'; const ProgressTypes = tuple('line', 'circle', 'dashboard'); export type ProgressType = typeof ProgressTypes[number]; diff --git a/components/radio/__tests__/group.test.js b/components/radio/__tests__/group.test.js index cf62cccc24..475071c83a 100644 --- a/components/radio/__tests__/group.test.js +++ b/components/radio/__tests__/group.test.js @@ -1,6 +1,6 @@ -import React from 'react'; -import { mount, render } from 'enzyme'; import { render as testLibRender } from '@testing-library/react'; +import { mount, render } from 'enzyme'; +import React from 'react'; import Radio from '..'; describe('Radio Group', () => { diff --git a/components/radio/__tests__/radio-button.test.js b/components/radio/__tests__/radio-button.test.js index 7c90419365..dbb71bc28e 100644 --- a/components/radio/__tests__/radio-button.test.js +++ b/components/radio/__tests__/radio-button.test.js @@ -1,6 +1,6 @@ -import React from 'react'; -import { mount, render } from 'enzyme'; import { render as testLibRender } from '@testing-library/react'; +import { mount, render } from 'enzyme'; +import React from 'react'; import Radio, { Button } from '..'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; diff --git a/components/radio/__tests__/radio.test.js b/components/radio/__tests__/radio.test.js index 1bb0b385a8..f9b63bd289 100644 --- a/components/radio/__tests__/radio.test.js +++ b/components/radio/__tests__/radio.test.js @@ -1,6 +1,6 @@ -import React from 'react'; import { mount, render } from 'enzyme'; -import Radio, { Group, Button } from '..'; +import React from 'react'; +import Radio, { Button, Group } from '..'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; diff --git a/components/radio/group.tsx b/components/radio/group.tsx index 76dead66dc..bb8307bbd1 100644 --- a/components/radio/group.tsx +++ b/components/radio/group.tsx @@ -1,12 +1,12 @@ -import * as React from 'react'; import classNames from 'classnames'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; -import Radio from './radio'; -import type { RadioGroupProps, RadioChangeEvent, RadioGroupButtonStyle } from './interface'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import SizeContext from '../config-provider/SizeContext'; -import { RadioGroupContextProvider } from './context'; import getDataOrAriaProps from '../_util/getDataOrAriaProps'; +import { RadioGroupContextProvider } from './context'; +import type { RadioChangeEvent, RadioGroupButtonStyle, RadioGroupProps } from './interface'; +import Radio from './radio'; const RadioGroup = React.forwardRef((props, ref) => { const { getPrefixCls, direction } = React.useContext(ConfigContext); diff --git a/components/radio/index.tsx b/components/radio/index.tsx index 6833c0393a..502e478269 100644 --- a/components/radio/index.tsx +++ b/components/radio/index.tsx @@ -1,18 +1,19 @@ import type * as React from 'react'; -import InternalRadio from './radio'; import Group from './group'; -import Button from './radioButton'; import type { RadioProps } from './interface'; +import InternalRadio from './radio'; +import Button from './radioButton'; export { + RadioChangeEvent, + RadioChangeEventTarget, RadioGroupButtonStyle, + RadioGroupContextProps, RadioGroupOptionType, RadioGroupProps, - RadioGroupContextProps, RadioProps, - RadioChangeEventTarget, - RadioChangeEvent, } from './interface'; +export { Button, Group }; interface CompoundedComponent extends React.ForwardRefExoticComponent> { Group: typeof Group; @@ -22,5 +23,4 @@ interface CompoundedComponent const Radio = InternalRadio as CompoundedComponent; Radio.Button = Button; Radio.Group = Group; -export { Button, Group }; export default Radio; diff --git a/components/radio/interface.tsx b/components/radio/interface.tsx index 89143e148f..5c896277f3 100644 --- a/components/radio/interface.tsx +++ b/components/radio/interface.tsx @@ -1,8 +1,8 @@ import type * as React from 'react'; -import type { AbstractCheckboxGroupProps } from '../checkbox/Group'; import type { AbstractCheckboxProps } from '../checkbox/Checkbox'; -import type { SizeType } from '../config-provider/SizeContext'; +import type { AbstractCheckboxGroupProps } from '../checkbox/Group'; import type { DisabledType } from '../config-provider/DisabledContext'; +import type { SizeType } from '../config-provider/SizeContext'; export type RadioGroupButtonStyle = 'outline' | 'solid'; export type RadioGroupOptionType = 'default' | 'button'; diff --git a/components/radio/radioButton.tsx b/components/radio/radioButton.tsx index 2d4f587eff..1cdf3b6a94 100644 --- a/components/radio/radioButton.tsx +++ b/components/radio/radioButton.tsx @@ -1,9 +1,9 @@ import * as React from 'react'; -import Radio from './radio'; -import type { RadioChangeEvent } from './interface'; import type { AbstractCheckboxProps } from '../checkbox/Checkbox'; import { ConfigContext } from '../config-provider'; import { RadioOptionTypeContextProvider } from './context'; +import type { RadioChangeEvent } from './interface'; +import Radio from './radio'; export type RadioButtonProps = AbstractCheckboxProps; diff --git a/components/rate/style/index.less b/components/rate/style/index.less index c6d26df0e0..56a274b1bf 100644 --- a/components/rate/style/index.less +++ b/components/rate/style/index.less @@ -17,7 +17,7 @@ &-disabled &-star { cursor: default; - + > div:hover { transform: scale(1); } diff --git a/components/segmented/__tests__/index.test.tsx b/components/segmented/__tests__/index.test.tsx index 16f2688ab0..45e53227e9 100644 --- a/components/segmented/__tests__/index.test.tsx +++ b/components/segmented/__tests__/index.test.tsx @@ -1,12 +1,12 @@ -import React from 'react'; import { AppstoreOutlined, BarsOutlined } from '@ant-design/icons'; +import React from 'react'; 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 Segmented from '../index'; import type { SegmentedValue } from '../index'; +import Segmented from '../index'; // Make CSSMotion working without transition jest.mock('rc-motion/lib/util/motion', () => ({ diff --git a/components/select/index.tsx b/components/select/index.tsx index 1cefc8802c..85cf6c4acf 100755 --- a/components/select/index.tsx +++ b/components/select/index.tsx @@ -9,15 +9,15 @@ import omit from 'rc-util/lib/omit'; import * as React from 'react'; import { useContext } from 'react'; import { ConfigContext } from '../config-provider'; +import defaultRenderEmpty from '../config-provider/defaultRenderEmpty'; +import DisabledContext from '../config-provider/DisabledContext'; import type { SizeType } from '../config-provider/SizeContext'; import SizeContext from '../config-provider/SizeContext'; -import DisabledContext from '../config-provider/DisabledContext'; import { FormItemInputContext } from '../form/context'; import type { SelectCommonPlacement } from '../_util/motion'; import { getTransitionDirection, getTransitionName } from '../_util/motion'; import type { InputStatus } from '../_util/statusUtils'; import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils'; -import defaultRenderEmpty from '../config-provider/defaultRenderEmpty'; import getIcons from './utils/iconUtil'; type RawValue = string | number; diff --git a/components/select/utils/iconUtil.tsx b/components/select/utils/iconUtil.tsx index 8dd071dad8..9107463aff 100644 --- a/components/select/utils/iconUtil.tsx +++ b/components/select/utils/iconUtil.tsx @@ -1,11 +1,11 @@ -import * as React from 'react'; -import type { ReactNode } from 'react'; +import CheckOutlined from '@ant-design/icons/CheckOutlined'; +import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; +import CloseOutlined from '@ant-design/icons/CloseOutlined'; import DownOutlined from '@ant-design/icons/DownOutlined'; import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; -import CheckOutlined from '@ant-design/icons/CheckOutlined'; -import CloseOutlined from '@ant-design/icons/CloseOutlined'; -import CloseCircleFilled from '@ant-design/icons/CloseCircleFilled'; import SearchOutlined from '@ant-design/icons/SearchOutlined'; +import type { ReactNode } from 'react'; +import * as React from 'react'; type RenderNode = React.ReactNode | ((props: any) => React.ReactNode); diff --git a/components/skeleton/Avatar.tsx b/components/skeleton/Avatar.tsx index 0bc89d4667..b507a48ac3 100644 --- a/components/skeleton/Avatar.tsx +++ b/components/skeleton/Avatar.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; -import omit from 'rc-util/lib/omit'; import classNames from 'classnames'; +import omit from 'rc-util/lib/omit'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import type { SkeletonElementProps } from './Element'; import Element from './Element'; diff --git a/components/skeleton/Button.tsx b/components/skeleton/Button.tsx index 596a2ce69f..9b23b398a4 100644 --- a/components/skeleton/Button.tsx +++ b/components/skeleton/Button.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; -import omit from 'rc-util/lib/omit'; import classNames from 'classnames'; +import omit from 'rc-util/lib/omit'; +import * as React from 'react'; +import { ConfigContext } from '../config-provider'; import type { SkeletonElementProps } from './Element'; import Element from './Element'; -import { ConfigContext } from '../config-provider'; export interface SkeletonButtonProps extends Omit { size?: 'large' | 'small' | 'default'; diff --git a/components/skeleton/Element.tsx b/components/skeleton/Element.tsx index ad943f8068..ec0a71266f 100644 --- a/components/skeleton/Element.tsx +++ b/components/skeleton/Element.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; import classNames from 'classnames'; +import * as React from 'react'; export interface SkeletonElementProps { prefixCls?: string; diff --git a/components/skeleton/Image.tsx b/components/skeleton/Image.tsx index 421c5a330e..5941146715 100644 --- a/components/skeleton/Image.tsx +++ b/components/skeleton/Image.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; import classNames from 'classnames'; -import type { SkeletonElementProps } from './Element'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; +import type { SkeletonElementProps } from './Element'; export interface SkeletonImageProps extends Omit {} diff --git a/components/skeleton/Input.tsx b/components/skeleton/Input.tsx index a6e2ea3616..4a5d435ccd 100644 --- a/components/skeleton/Input.tsx +++ b/components/skeleton/Input.tsx @@ -1,9 +1,9 @@ -import * as React from 'react'; -import omit from 'rc-util/lib/omit'; import classNames from 'classnames'; +import omit from 'rc-util/lib/omit'; +import * as React from 'react'; +import { ConfigContext } from '../config-provider'; import type { SkeletonElementProps } from './Element'; import Element from './Element'; -import { ConfigContext } from '../config-provider'; export interface SkeletonInputProps extends Omit { size?: 'large' | 'small' | 'default'; diff --git a/components/skeleton/Paragraph.tsx b/components/skeleton/Paragraph.tsx index dee8ff757f..4d13cd0b3b 100644 --- a/components/skeleton/Paragraph.tsx +++ b/components/skeleton/Paragraph.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; import classNames from 'classnames'; +import * as React from 'react'; type widthUnit = number | string; diff --git a/components/skeleton/Skeleton.tsx b/components/skeleton/Skeleton.tsx index 4dfdd2ad92..8e23d6d72d 100644 --- a/components/skeleton/Skeleton.tsx +++ b/components/skeleton/Skeleton.tsx @@ -1,16 +1,16 @@ -import * as React from 'react'; import classNames from 'classnames'; -import type { SkeletonTitleProps } from './Title'; -import Title from './Title'; -import type { SkeletonParagraphProps } from './Paragraph'; -import Paragraph from './Paragraph'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; -import Element from './Element'; import type { AvatarProps } from './Avatar'; import SkeletonAvatar from './Avatar'; import SkeletonButton from './Button'; -import SkeletonInput from './Input'; +import Element from './Element'; import SkeletonImage from './Image'; +import SkeletonInput from './Input'; +import type { SkeletonParagraphProps } from './Paragraph'; +import Paragraph from './Paragraph'; +import type { SkeletonTitleProps } from './Title'; +import Title from './Title'; /* This only for skeleton internal. */ interface SkeletonAvatarProps extends Omit {} diff --git a/components/skeleton/Title.tsx b/components/skeleton/Title.tsx index 6e7e52a847..151a1c2e25 100644 --- a/components/skeleton/Title.tsx +++ b/components/skeleton/Title.tsx @@ -1,6 +1,6 @@ /* eslint-disable jsx-a11y/heading-has-content */ -import * as React from 'react'; import classNames from 'classnames'; +import * as React from 'react'; export interface SkeletonTitleProps { prefixCls?: string; diff --git a/components/skeleton/__tests__/index.test.js b/components/skeleton/__tests__/index.test.js index 3288ff0049..c00b640f16 100644 --- a/components/skeleton/__tests__/index.test.js +++ b/components/skeleton/__tests__/index.test.js @@ -1,5 +1,5 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import Skeleton from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; diff --git a/components/slider/SliderTooltip.tsx b/components/slider/SliderTooltip.tsx index d379d67d12..2207d98334 100644 --- a/components/slider/SliderTooltip.tsx +++ b/components/slider/SliderTooltip.tsx @@ -1,7 +1,7 @@ +import raf from 'rc-util/lib/raf'; +import { composeRef } from 'rc-util/lib/ref'; import * as React from 'react'; import { useRef } from 'react'; -import { composeRef } from 'rc-util/lib/ref'; -import raf from 'rc-util/lib/raf'; import type { TooltipProps } from '../tooltip'; import Tooltip from '../tooltip'; diff --git a/components/slider/__tests__/index.test.js b/components/slider/__tests__/index.test.js index 22c722c4d2..eab61458da 100644 --- a/components/slider/__tests__/index.test.js +++ b/components/slider/__tests__/index.test.js @@ -1,12 +1,12 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import Slider from '..'; -import ConfigProvider from '../../config-provider'; +import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; -import focusTest from '../../../tests/shared/focusTest'; -import SliderTooltip from '../SliderTooltip'; import { sleep } from '../../../tests/utils'; +import ConfigProvider from '../../config-provider'; +import SliderTooltip from '../SliderTooltip'; describe('Slider', () => { mountTest(Slider); diff --git a/components/slider/style/index.less b/components/slider/style/index.less index 66d63b1552..586f62fb67 100644 --- a/components/slider/style/index.less +++ b/components/slider/style/index.less @@ -73,7 +73,7 @@ right: -6px; bottom: -6px; left: -6px; - content: ""; + content: ''; } } diff --git a/components/space/Item.tsx b/components/space/Item.tsx index a74aeeec45..7c9c28dd79 100644 --- a/components/space/Item.tsx +++ b/components/space/Item.tsx @@ -20,9 +20,8 @@ export default function Item({ split, wrap, }: ItemProps) { - const { horizontalSize, verticalSize, latestIndex, supportFlexGap } = React.useContext( - SpaceContext, - ); + const { horizontalSize, verticalSize, latestIndex, supportFlexGap } = + React.useContext(SpaceContext); let style: React.CSSProperties = {}; diff --git a/components/space/__tests__/gap.test.js b/components/space/__tests__/gap.test.js index f41dca6099..2d43195b6c 100644 --- a/components/space/__tests__/gap.test.js +++ b/components/space/__tests__/gap.test.js @@ -1,8 +1,7 @@ import React from 'react'; -import { render } from '../../../tests/utils'; import Space from '..'; +import { render } from '../../../tests/utils'; // eslint-disable-next-line no-unused-vars -import * as styleChecker from '../../_util/styleChecker'; jest.mock('../../_util/styleChecker', () => ({ canUseDocElement: () => true, diff --git a/components/space/__tests__/index.test.js b/components/space/__tests__/index.test.js index 0af061cd00..13a4405f58 100644 --- a/components/space/__tests__/index.test.js +++ b/components/space/__tests__/index.test.js @@ -1,9 +1,9 @@ import React, { useState } from 'react'; -import { render, fireEvent } from '../../../tests/utils'; import Space from '..'; -import ConfigProvider from '../../config-provider'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; +import { fireEvent, render } from '../../../tests/utils'; +import ConfigProvider from '../../config-provider'; describe('Space', () => { mountTest(Space); diff --git a/components/space/index.tsx b/components/space/index.tsx index 134859ded8..249a5ba4e4 100644 --- a/components/space/index.tsx +++ b/components/space/index.tsx @@ -1,10 +1,10 @@ -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 type { SizeType } from '../config-provider/SizeContext'; -import Item from './Item'; import useFlexGapSupport from '../_util/hooks/useFlexGapSupport'; +import Item from './Item'; export const SpaceContext = React.createContext({ latestIndex: 0, diff --git a/components/spin/__tests__/delay.test.js b/components/spin/__tests__/delay.test.js index 9ecc0708a9..cf362080de 100644 --- a/components/spin/__tests__/delay.test.js +++ b/components/spin/__tests__/delay.test.js @@ -1,5 +1,5 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; // eslint-disable-next-line import/no-named-as-default import { render } from '@testing-library/react'; import debounce from 'lodash/debounce'; diff --git a/components/spin/__tests__/index.test.js b/components/spin/__tests__/index.test.js index 27d5250baf..1fa0aaf7f9 100644 --- a/components/spin/__tests__/index.test.js +++ b/components/spin/__tests__/index.test.js @@ -1,5 +1,5 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; // eslint-disable-next-line import/no-named-as-default import { render } from '@testing-library/react'; import Spin from '..'; diff --git a/components/spin/index.tsx b/components/spin/index.tsx index 0c52785525..676f710a82 100644 --- a/components/spin/index.tsx +++ b/components/spin/index.tsx @@ -1,11 +1,11 @@ -import * as React from 'react'; import classNames from 'classnames'; -import omit from 'rc-util/lib/omit'; import debounce from 'lodash/debounce'; +import omit from 'rc-util/lib/omit'; +import * as React from 'react'; import type { ConfigConsumerProps } from '../config-provider'; import { ConfigConsumer, ConfigContext } from '../config-provider'; +import { cloneElement, isValidElement } from '../_util/reactNode'; import { tuple } from '../_util/type'; -import { isValidElement, cloneElement } from '../_util/reactNode'; const SpinSizes = tuple('small', 'default', 'large'); export type SpinSize = typeof SpinSizes[number]; diff --git a/components/statistic/Countdown.tsx b/components/statistic/Countdown.tsx index 48f6abf84a..2bad01824b 100644 --- a/components/statistic/Countdown.tsx +++ b/components/statistic/Countdown.tsx @@ -1,9 +1,9 @@ import * as React from 'react'; +import { cloneElement } from '../_util/reactNode'; import type { StatisticProps } from './Statistic'; import Statistic from './Statistic'; import type { countdownValueType, FormatConfig } from './utils'; import { formatCountdown } from './utils'; -import { cloneElement } from '../_util/reactNode'; const REFRESH_INTERVAL = 1000 / 30; diff --git a/components/statistic/Number.tsx b/components/statistic/Number.tsx index 0e9fc2222f..756247c2d8 100644 --- a/components/statistic/Number.tsx +++ b/components/statistic/Number.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; import padEnd from 'lodash/padEnd'; -import type { valueType, FormatConfig } from './utils'; +import * as React from 'react'; +import type { FormatConfig, valueType } from './utils'; interface NumberProps extends FormatConfig { value: valueType; diff --git a/components/statistic/Statistic.tsx b/components/statistic/Statistic.tsx index 05843128f9..5682c6692e 100644 --- a/components/statistic/Statistic.tsx +++ b/components/statistic/Statistic.tsx @@ -1,12 +1,12 @@ -import * as React from 'react'; import classNames from 'classnames'; +import * as React from 'react'; import type { ConfigConsumerProps } from '../config-provider'; import { withConfigConsumer } from '../config-provider/context'; import Skeleton from '../skeleton'; -import StatisticNumber from './Number'; import type Countdown from './Countdown'; -import type { valueType, FormatConfig } from './utils'; +import StatisticNumber from './Number'; +import type { FormatConfig, valueType } from './utils'; interface StatisticComponent { Countdown: typeof Countdown; diff --git a/components/statistic/__tests__/index.test.tsx b/components/statistic/__tests__/index.test.tsx index 17f0567e96..6781f62ede 100644 --- a/components/statistic/__tests__/index.test.tsx +++ b/components/statistic/__tests__/index.test.tsx @@ -1,12 +1,12 @@ -import React from 'react'; import MockDate from 'mockdate'; import moment from 'moment'; +import React from 'react'; import Statistic from '..'; -import type Countdown from '../Countdown'; -import { formatTimeStr } from '../utils'; -import { sleep, render, fireEvent } from '../../../tests/utils'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; +import { fireEvent, render, sleep } from '../../../tests/utils'; +import type Countdown from '../Countdown'; +import { formatTimeStr } from '../utils'; describe('Statistic', () => { mountTest(Statistic); diff --git a/components/statistic/index.tsx b/components/statistic/index.tsx index fb053825c3..819e9b63df 100644 --- a/components/statistic/index.tsx +++ b/components/statistic/index.tsx @@ -1,5 +1,5 @@ -import Statistic, { StatisticProps } from './Statistic'; import Countdown from './Countdown'; +import Statistic, { StatisticProps } from './Statistic'; Statistic.Countdown = Countdown; diff --git a/components/statistic/utils.tsx b/components/statistic/utils.tsx index 24e3e841d7..600abbe27f 100644 --- a/components/statistic/utils.tsx +++ b/components/statistic/utils.tsx @@ -1,5 +1,5 @@ -import type * as React from 'react'; import padStart from 'lodash/padStart'; +import type * as React from 'react'; export type valueType = number | string; export type countdownValueType = valueType | string; diff --git a/components/steps/index.tsx b/components/steps/index.tsx index 60302f947d..2fd8a163bc 100644 --- a/components/steps/index.tsx +++ b/components/steps/index.tsx @@ -1,12 +1,12 @@ -import * as React from 'react'; -import RcSteps from 'rc-steps'; -import type { ProgressDotRender } from 'rc-steps/lib/Steps'; import CheckOutlined from '@ant-design/icons/CheckOutlined'; import CloseOutlined from '@ant-design/icons/CloseOutlined'; import classNames from 'classnames'; +import RcSteps from 'rc-steps'; +import type { ProgressDotRender } from 'rc-steps/lib/Steps'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; -import Progress from '../progress'; import useBreakpoint from '../grid/hooks/useBreakpoint'; +import Progress from '../progress'; export interface StepsProps { type?: 'default' | 'navigation'; diff --git a/components/switch/__tests__/index.test.js b/components/switch/__tests__/index.test.js index 0fa29427c4..8f0ee630fa 100644 --- a/components/switch/__tests__/index.test.js +++ b/components/switch/__tests__/index.test.js @@ -1,11 +1,11 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import Switch 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 { sleep } from '../../../tests/utils'; +import { resetWarned } from '../../_util/warning'; describe('Switch', () => { focusTest(Switch, { refFocus: true }); diff --git a/components/switch/__tests__/wave.test.js b/components/switch/__tests__/wave.test.js index b6b283020e..e1a1fc6557 100644 --- a/components/switch/__tests__/wave.test.js +++ b/components/switch/__tests__/wave.test.js @@ -1,8 +1,8 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import Switch from '..'; -import Wave from '../../_util/wave'; import { sleep } from '../../../tests/utils'; +import Wave from '../../_util/wave'; describe('click wave effect', () => { async function click(wrapper) { diff --git a/components/table/ColumnGroup.tsx b/components/table/ColumnGroup.tsx index 3cccc113d4..c8a730c29c 100644 --- a/components/table/ColumnGroup.tsx +++ b/components/table/ColumnGroup.tsx @@ -1,6 +1,6 @@ import type * as React from 'react'; -import type { ColumnType } from './interface'; import type { ColumnProps } from './Column'; +import type { ColumnType } from './interface'; export interface ColumnGroupProps extends Omit, 'children'> { children: diff --git a/components/table/ExpandIcon.tsx b/components/table/ExpandIcon.tsx index 9b6e0bcfab..8e0a15e99d 100644 --- a/components/table/ExpandIcon.tsx +++ b/components/table/ExpandIcon.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; import classNames from 'classnames'; +import * as React from 'react'; import type { TableLocale } from './interface'; interface DefaultExpandIconProps { diff --git a/components/table/Table.tsx b/components/table/Table.tsx index 25d1983e18..212536d5b2 100644 --- a/components/table/Table.tsx +++ b/components/table/Table.tsx @@ -1,33 +1,30 @@ -import * as React from 'react'; import classNames from 'classnames'; -import omit from 'rc-util/lib/omit'; import RcTable, { Summary } from 'rc-table'; +import { convertChildrenToColumns } from 'rc-table/lib/hooks/useColumns'; import type { TableProps as RcTableProps } from 'rc-table/lib/Table'; import { INTERNAL_HOOKS } from 'rc-table/lib/Table'; -import { convertChildrenToColumns } from 'rc-table/lib/hooks/useColumns'; +import omit from 'rc-util/lib/omit'; +import * as React from 'react'; +import { ConfigContext } from '../config-provider/context'; +import defaultRenderEmpty from '../config-provider/defaultRenderEmpty'; +import type { SizeType } from '../config-provider/SizeContext'; +import SizeContext from '../config-provider/SizeContext'; +import useBreakpoint from '../grid/hooks/useBreakpoint'; +import defaultLocale from '../locale/en_US'; +import Pagination from '../pagination'; import type { SpinProps } from '../spin'; import Spin from '../spin'; -import Pagination from '../pagination'; import type { TooltipProps } from '../tooltip'; -import { ConfigContext } from '../config-provider/context'; -import usePagination, { DEFAULT_PAGE_SIZE, getPaginationParam } from './hooks/usePagination'; -import useLazyKVMap from './hooks/useLazyKVMap'; import type { Breakpoint } from '../_util/responsiveObserve'; -import type { - TableRowSelection, - GetRowKey, - ColumnType, - TableCurrentDataSource, - SorterResult, - GetPopupContainer, - ExpandableConfig, - ExpandType, - SortOrder, - TableLocale, - TableAction, - FilterValue, -} from './interface'; -import { ColumnsType, TablePaginationConfig } from './interface'; +import scrollTo from '../_util/scrollTo'; +import warning from '../_util/warning'; +import Column from './Column'; +import ColumnGroup from './ColumnGroup'; +import renderExpandIcon from './ExpandIcon'; +import type { FilterState } from './hooks/useFilter'; +import useFilter, { getFilterData } from './hooks/useFilter'; +import useLazyKVMap from './hooks/useLazyKVMap'; +import usePagination, { DEFAULT_PAGE_SIZE, getPaginationParam } from './hooks/usePagination'; import useSelection, { SELECTION_ALL, SELECTION_COLUMN, @@ -36,19 +33,22 @@ import useSelection, { } from './hooks/useSelection'; import type { SortState } from './hooks/useSorter'; import useSorter, { getSortData } from './hooks/useSorter'; -import type { FilterState } from './hooks/useFilter'; -import useFilter, { getFilterData } from './hooks/useFilter'; import useTitleColumns from './hooks/useTitleColumns'; -import renderExpandIcon from './ExpandIcon'; -import scrollTo from '../_util/scrollTo'; -import defaultLocale from '../locale/en_US'; -import type { SizeType } from '../config-provider/SizeContext'; -import SizeContext from '../config-provider/SizeContext'; -import Column from './Column'; -import ColumnGroup from './ColumnGroup'; -import warning from '../_util/warning'; -import useBreakpoint from '../grid/hooks/useBreakpoint'; -import defaultRenderEmpty from '../config-provider/defaultRenderEmpty'; +import type { + ColumnType, + ExpandableConfig, + ExpandType, + FilterValue, + GetPopupContainer, + GetRowKey, + SorterResult, + SortOrder, + TableAction, + TableCurrentDataSource, + TableLocale, + TableRowSelection, +} from './interface'; +import { ColumnsType, TablePaginationConfig } from './interface'; export { ColumnsType, TablePaginationConfig }; diff --git a/components/table/__tests__/Table.expand.test.js b/components/table/__tests__/Table.expand.test.js index 652679082a..57cf4a74dc 100644 --- a/components/table/__tests__/Table.expand.test.js +++ b/components/table/__tests__/Table.expand.test.js @@ -1,7 +1,7 @@ /* eslint-disable react/no-multi-comp */ import React from 'react'; -import { render, fireEvent } from '../../../tests/utils'; import Table from '..'; +import { fireEvent, render } from '../../../tests/utils'; const columns = [ { diff --git a/components/table/__tests__/Table.order.test.js b/components/table/__tests__/Table.order.test.js index 485475b018..db3ed54aa6 100644 --- a/components/table/__tests__/Table.order.test.js +++ b/components/table/__tests__/Table.order.test.js @@ -1,6 +1,6 @@ import React from 'react'; -import { render } from '../../../tests/utils'; import Table from '..'; +import { render } from '../../../tests/utils'; import { resetWarned } from '../../_util/warning'; describe('Table.order', () => { diff --git a/components/table/__tests__/Table.pagination.test.js b/components/table/__tests__/Table.pagination.test.js index 53aa0fbc04..4cc23167ff 100644 --- a/components/table/__tests__/Table.pagination.test.js +++ b/components/table/__tests__/Table.pagination.test.js @@ -3,8 +3,8 @@ jest.mock('../../_util/scrollTo'); import React from 'react'; import { act } from 'react-dom/test-utils'; -import { render, fireEvent } from '../../../tests/utils'; import Table from '..'; +import { fireEvent, render } from '../../../tests/utils'; import scrollTo from '../../_util/scrollTo'; import { resetWarned } from '../../_util/warning'; diff --git a/components/table/__tests__/Table.sorter.test.js b/components/table/__tests__/Table.sorter.test.js index ed1623ec3f..0e46d842cb 100644 --- a/components/table/__tests__/Table.sorter.test.js +++ b/components/table/__tests__/Table.sorter.test.js @@ -1,7 +1,7 @@ /* eslint-disable react/no-multi-comp */ import React from 'react'; -import { render, fireEvent, act } from '../../../tests/utils'; import Table from '..'; +import { act, fireEvent, render } from '../../../tests/utils'; describe('Table.sorter', () => { const sorterFn = (a, b) => a.name[0].charCodeAt() - b.name[0].charCodeAt(); diff --git a/components/table/__tests__/Table.test.js b/components/table/__tests__/Table.test.js index c01015869e..92c29762af 100644 --- a/components/table/__tests__/Table.test.js +++ b/components/table/__tests__/Table.test.js @@ -2,7 +2,7 @@ import React from 'react'; import Table from '..'; 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'; const { Column, ColumnGroup } = Table; diff --git a/components/table/__tests__/empty.test.js b/components/table/__tests__/empty.test.js index 25873e9ff9..0222824b70 100644 --- a/components/table/__tests__/empty.test.js +++ b/components/table/__tests__/empty.test.js @@ -1,6 +1,6 @@ import React from 'react'; -import { render } from '../../../tests/utils'; import Table from '..'; +import { render } from '../../../tests/utils'; const columns = [ { title: 'Column 1', dataIndex: 'address', key: '1' }, diff --git a/components/table/__tests__/type.test.tsx b/components/table/__tests__/type.test.tsx index a8d86b4cd7..a064b0f69f 100644 --- a/components/table/__tests__/type.test.tsx +++ b/components/table/__tests__/type.test.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import Table from '../Table'; import type { ColumnProps } from '..'; +import Table from '../Table'; const { Column, ColumnGroup } = Table; diff --git a/components/table/hooks/useFilter/FilterSearch.tsx b/components/table/hooks/useFilter/FilterSearch.tsx index 6d008319f0..596f509bf9 100644 --- a/components/table/hooks/useFilter/FilterSearch.tsx +++ b/components/table/hooks/useFilter/FilterSearch.tsx @@ -1,7 +1,7 @@ -import * as React from 'react'; import SearchOutlined from '@ant-design/icons/SearchOutlined'; +import * as React from 'react'; import Input from '../../../input'; -import type { TableLocale, FilterSearchType } from '../../interface'; +import type { FilterSearchType, TableLocale } from '../../interface'; interface FilterSearchProps { value: string; diff --git a/components/table/hooks/useFilter/index.tsx b/components/table/hooks/useFilter/index.tsx index c33cf02e30..05a91187a4 100644 --- a/components/table/hooks/useFilter/index.tsx +++ b/components/table/hooks/useFilter/index.tsx @@ -1,18 +1,18 @@ import * as React from 'react'; import warning from '../../../_util/warning'; import type { - TransformColumns, + ColumnFilterItem, ColumnsType, - ColumnType, ColumnTitleProps, + ColumnType, + FilterKey, + FilterValue, + GetPopupContainer, Key, TableLocale, - FilterValue, - FilterKey, - GetPopupContainer, - ColumnFilterItem, + TransformColumns, } from '../../interface'; -import { getColumnPos, renderColumnTitle, getColumnKey } from '../../util'; +import { getColumnKey, getColumnPos, renderColumnTitle } from '../../util'; import FilterDropdown from './FilterDropdown'; export interface FilterState { diff --git a/components/table/hooks/useLazyKVMap.ts b/components/table/hooks/useLazyKVMap.ts index 7f904e4842..dd2c362635 100644 --- a/components/table/hooks/useLazyKVMap.ts +++ b/components/table/hooks/useLazyKVMap.ts @@ -1,5 +1,5 @@ import * as React from 'react'; -import type { Key, GetRowKey } from '../interface'; +import type { GetRowKey, Key } from '../interface'; interface MapCache { data?: readonly RecordType[]; diff --git a/components/table/hooks/useSelection.tsx b/components/table/hooks/useSelection.tsx index 308d80885a..bbba5baff7 100644 --- a/components/table/hooks/useSelection.tsx +++ b/components/table/hooks/useSelection.tsx @@ -1,13 +1,13 @@ -import * as React from 'react'; -import { useState, useCallback, useMemo } from 'react'; import DownOutlined from '@ant-design/icons/DownOutlined'; -import { convertDataToEntities } from 'rc-tree/lib/utils/treeUtil'; -import { conductCheck } from 'rc-tree/lib/utils/conductUtil'; -import { arrAdd, arrDel } from 'rc-tree/lib/util'; -import type { DataNode, GetCheckDisabled } from 'rc-tree/lib/interface'; import { INTERNAL_COL_DEFINE } from 'rc-table'; import type { FixedType } from 'rc-table/lib/interface'; +import type { DataNode, GetCheckDisabled } from 'rc-tree/lib/interface'; +import { arrAdd, arrDel } from 'rc-tree/lib/util'; +import { conductCheck } from 'rc-tree/lib/utils/conductUtil'; +import { convertDataToEntities } from 'rc-tree/lib/utils/treeUtil'; import useMergedState from 'rc-util/lib/hooks/useMergedState'; +import * as React from 'react'; +import { useCallback, useMemo, useState } from 'react'; import type { CheckboxProps } from '../../checkbox'; import Checkbox from '../../checkbox'; import Dropdown from '../../dropdown'; @@ -15,17 +15,17 @@ import Menu from '../../menu'; import Radio from '../../radio'; import warning from '../../_util/warning'; import type { - TableRowSelection, - Key, ColumnsType, ColumnType, - GetRowKey, - TableLocale, - SelectionItem, - TransformColumns, ExpandType, GetPopupContainer, + GetRowKey, + Key, RowSelectMethod, + SelectionItem, + TableLocale, + TableRowSelection, + TransformColumns, } from '../interface'; // TODO: warning if use ajax!!! diff --git a/components/table/hooks/useSorter.tsx b/components/table/hooks/useSorter.tsx index 1317e8db6a..2c08a33ab6 100644 --- a/components/table/hooks/useSorter.tsx +++ b/components/table/hooks/useSorter.tsx @@ -1,22 +1,22 @@ -import * as React from 'react'; -import classNames from 'classnames'; import CaretDownOutlined from '@ant-design/icons/CaretDownOutlined'; import CaretUpOutlined from '@ant-design/icons/CaretUpOutlined'; +import classNames from 'classnames'; import KeyCode from 'rc-util/lib/KeyCode'; -import type { - TransformColumns, - ColumnsType, - Key, - ColumnType, - SortOrder, - CompareFn, - ColumnTitleProps, - SorterResult, - ColumnGroupType, - TableLocale, -} from '../interface'; +import * as React from 'react'; import type { TooltipProps } from '../../tooltip'; import Tooltip from '../../tooltip'; +import type { + ColumnGroupType, + ColumnsType, + ColumnTitleProps, + ColumnType, + CompareFn, + Key, + SorterResult, + SortOrder, + TableLocale, + TransformColumns, +} from '../interface'; import { getColumnKey, getColumnPos, renderColumnTitle } from '../util'; const ASCEND = 'ascend'; diff --git a/components/table/hooks/useTitleColumns.tsx b/components/table/hooks/useTitleColumns.tsx index 8b1c70fd80..9264932a0e 100644 --- a/components/table/hooks/useTitleColumns.tsx +++ b/components/table/hooks/useTitleColumns.tsx @@ -1,5 +1,5 @@ import * as React from 'react'; -import type { TransformColumns, ColumnTitleProps, ColumnsType } from '../interface'; +import type { ColumnsType, ColumnTitleProps, TransformColumns } from '../interface'; import { renderColumnTitle } from '../util'; function fillTitle( diff --git a/components/table/index.tsx b/components/table/index.tsx index 51d5546008..e4ba4081b2 100644 --- a/components/table/index.tsx +++ b/components/table/index.tsx @@ -1,7 +1,7 @@ -import Table, { TableProps, TablePaginationConfig } from './Table'; +import Table, { TablePaginationConfig, TableProps } from './Table'; export { ColumnProps } from './Column'; -export { ColumnsType, ColumnType, ColumnGroupType } from './interface'; +export { ColumnGroupType, ColumnsType, ColumnType } from './interface'; export { TableProps, TablePaginationConfig }; export default Table; diff --git a/components/table/interface.tsx b/components/table/interface.tsx index 775a851637..9cb226d643 100644 --- a/components/table/interface.tsx +++ b/components/table/interface.tsx @@ -1,16 +1,16 @@ -import type * as React from 'react'; import type { ColumnType as RcColumnType, - RenderedCell as RcRenderedCell, FixedType, + RenderedCell as RcRenderedCell, } from 'rc-table/lib/interface'; -import { GetRowKey, ExpandableConfig } from 'rc-table/lib/interface'; -import type { TooltipProps } from '../tooltip'; +import { ExpandableConfig, GetRowKey } from 'rc-table/lib/interface'; +import type * as React from 'react'; import type { CheckboxProps } from '../checkbox'; import type { PaginationProps } from '../pagination'; +import type { TooltipProps } from '../tooltip'; import type { Breakpoint } from '../_util/responsiveObserve'; -import type { INTERNAL_SELECTION_ITEM } from './hooks/useSelection'; import { tuple } from '../_util/type'; +import type { INTERNAL_SELECTION_ITEM } from './hooks/useSelection'; // import { TableAction } from './Table'; export { GetRowKey, ExpandableConfig }; diff --git a/components/table/style/index.tsx b/components/table/style/index.tsx index 50815c77ab..7e00312003 100644 --- a/components/table/style/index.tsx +++ b/components/table/style/index.tsx @@ -5,12 +5,12 @@ import './index.less'; // deps-lint-skip: menu // deps-lint-skip: grid import '../../button/style'; -import '../../empty/style'; -import '../../radio/style'; import '../../checkbox/style'; import '../../dropdown/style'; -import '../../spin/style'; -import '../../pagination/style'; -import '../../tooltip/style'; +import '../../empty/style'; import '../../input/style'; +import '../../pagination/style'; +import '../../radio/style'; +import '../../spin/style'; +import '../../tooltip/style'; import '../../tree/style'; diff --git a/components/table/util.ts b/components/table/util.ts index f45d0d880e..4a355c1ef7 100644 --- a/components/table/util.ts +++ b/components/table/util.ts @@ -1,5 +1,5 @@ /* eslint-disable import/prefer-default-export */ -import type { ColumnType, ColumnTitle, ColumnTitleProps, Key } from './interface'; +import type { ColumnTitle, ColumnTitleProps, ColumnType, Key } from './interface'; export function getColumnKey(column: ColumnType, defaultKey: string): Key { if ('key' in column && column.key !== undefined && column.key !== null) { diff --git a/components/tabs/__tests__/index.test.js b/components/tabs/__tests__/index.test.js index 5853702c98..1e35bf0018 100644 --- a/components/tabs/__tests__/index.test.js +++ b/components/tabs/__tests__/index.test.js @@ -1,8 +1,8 @@ import React from 'react'; -import { render, fireEvent } from '../../../tests/utils'; import Tabs from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; +import { fireEvent, render } from '../../../tests/utils'; const { TabPane } = Tabs; diff --git a/components/tabs/index.tsx b/components/tabs/index.tsx index e0772b736d..f4fceaa01a 100755 --- a/components/tabs/index.tsx +++ b/components/tabs/index.tsx @@ -1,16 +1,16 @@ -import * as React from 'react'; +import CloseOutlined from '@ant-design/icons/CloseOutlined'; +import EllipsisOutlined from '@ant-design/icons/EllipsisOutlined'; +import PlusOutlined from '@ant-design/icons/PlusOutlined'; +import classNames from 'classnames'; import type { TabsProps as RcTabsProps } from 'rc-tabs'; import RcTabs, { TabPane, TabPaneProps } from 'rc-tabs'; import type { EditableConfig } from 'rc-tabs/lib/interface'; -import classNames from 'classnames'; -import EllipsisOutlined from '@ant-design/icons/EllipsisOutlined'; -import PlusOutlined from '@ant-design/icons/PlusOutlined'; -import CloseOutlined from '@ant-design/icons/CloseOutlined'; +import * as React from 'react'; -import warning from '../_util/warning'; import { ConfigContext } from '../config-provider'; import type { SizeType } from '../config-provider/SizeContext'; import SizeContext from '../config-provider/SizeContext'; +import warning from '../_util/warning'; export type TabsType = 'line' | 'card' | 'editable-card'; export type TabsPosition = 'top' | 'right' | 'bottom' | 'left'; diff --git a/components/tag/CheckableTag.tsx b/components/tag/CheckableTag.tsx index c8e2917a02..9f2806d4e7 100644 --- a/components/tag/CheckableTag.tsx +++ b/components/tag/CheckableTag.tsx @@ -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 CheckableTagProps { diff --git a/components/tag/__tests__/index.test.js b/components/tag/__tests__/index.test.js index 353aed4607..244b7660b3 100644 --- a/components/tag/__tests__/index.test.js +++ b/components/tag/__tests__/index.test.js @@ -1,5 +1,5 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import Tag from '..'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; diff --git a/components/time-picker/__tests__/index.test.js b/components/time-picker/__tests__/index.test.js index a7855281d2..d6ac11a0c8 100644 --- a/components/time-picker/__tests__/index.test.js +++ b/components/time-picker/__tests__/index.test.js @@ -1,11 +1,11 @@ -import React from 'react'; import { mount } from 'enzyme'; import moment from 'moment'; +import React from 'react'; import TimePicker from '..'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; -import { resetWarned } from '../../_util/warning'; import rtlTest from '../../../tests/shared/rtlTest'; +import { resetWarned } from '../../_util/warning'; describe('TimePicker', () => { const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); diff --git a/components/timeline/Timeline.tsx b/components/timeline/Timeline.tsx index 3efd4bd11a..ca8f55a674 100644 --- a/components/timeline/Timeline.tsx +++ b/components/timeline/Timeline.tsx @@ -1,11 +1,11 @@ -import * as React from 'react'; -import classNames from 'classnames'; import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; +import classNames from 'classnames'; +import * as React from 'react'; -import type { TimelineItemProps } from './TimelineItem'; -import TimelineItem from './TimelineItem'; import { ConfigContext } from '../config-provider'; import { cloneElement } from '../_util/reactNode'; +import type { TimelineItemProps } from './TimelineItem'; +import TimelineItem from './TimelineItem'; export interface TimelineProps { prefixCls?: string; diff --git a/components/timeline/TimelineItem.tsx b/components/timeline/TimelineItem.tsx index 8c082054f7..c560b27da6 100644 --- a/components/timeline/TimelineItem.tsx +++ b/components/timeline/TimelineItem.tsx @@ -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 TimelineItemProps { diff --git a/components/tooltip/__tests__/tooltip.test.js b/components/tooltip/__tests__/tooltip.test.js index 67d6a4c08e..9df5714fc4 100644 --- a/components/tooltip/__tests__/tooltip.test.js +++ b/components/tooltip/__tests__/tooltip.test.js @@ -1,14 +1,14 @@ -import React from 'react'; import { spyElementPrototype } from 'rc-util/lib/test/domHook'; +import React from 'react'; import Tooltip from '..'; +import mountTest from '../../../tests/shared/mountTest'; +import rtlTest from '../../../tests/shared/rtlTest'; +import { fireEvent, render, sleep, waitFor } from '../../../tests/utils'; import Button from '../../button'; -import Switch from '../../switch'; import DatePicker from '../../date-picker'; import Input from '../../input'; import Group from '../../input/Group'; -import { sleep, render, fireEvent, waitFor } from '../../../tests/utils'; -import mountTest from '../../../tests/shared/mountTest'; -import rtlTest from '../../../tests/shared/rtlTest'; +import Switch from '../../switch'; describe('Tooltip', () => { mountTest(Tooltip); diff --git a/components/transfer/ListBody.tsx b/components/transfer/ListBody.tsx index bfa1b630d4..d111f30f2b 100644 --- a/components/transfer/ListBody.tsx +++ b/components/transfer/ListBody.tsx @@ -1,12 +1,12 @@ -import * as React from 'react'; import classNames from 'classnames'; +import * as React from 'react'; +import type { KeyWiseTransferItem } from '.'; +import Pagination from '../pagination'; import type { ElementOf } from '../_util/type'; import { tuple } from '../_util/type'; -import Pagination from '../pagination'; -import type { TransferListProps, RenderedItem } from './list'; -import ListItem from './ListItem'; import type { PaginationType } from './interface'; -import type { KeyWiseTransferItem } from '.'; +import type { RenderedItem, TransferListProps } from './list'; +import ListItem from './ListItem'; export const OmitProps = tuple('handleFilter', 'handleClear', 'checkedKeys'); export type OmitProp = ElementOf; diff --git a/components/transfer/ListItem.tsx b/components/transfer/ListItem.tsx index 4c63c47773..92f004c19b 100644 --- a/components/transfer/ListItem.tsx +++ b/components/transfer/ListItem.tsx @@ -1,11 +1,11 @@ -import * as React from 'react'; -import classNames from 'classnames'; import DeleteOutlined from '@ant-design/icons/DeleteOutlined'; +import classNames from 'classnames'; +import * as React from 'react'; import type { KeyWiseTransferItem, TransferLocale } from '.'; -import defaultLocale from '../locale/default'; import Checkbox from '../checkbox'; -import TransButton from '../_util/transButton'; import LocaleReceiver from '../locale-provider/LocaleReceiver'; +import defaultLocale from '../locale/default'; +import TransButton from '../_util/transButton'; type ListItemProps = { renderedText?: string | number; diff --git a/components/transfer/__tests__/customize.test.js b/components/transfer/__tests__/customize.test.js index 3e363b4978..d274cfbfc3 100644 --- a/components/transfer/__tests__/customize.test.js +++ b/components/transfer/__tests__/customize.test.js @@ -1,5 +1,5 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import { render } from '../../../tests/utils'; import Transfer from '../index'; diff --git a/components/transfer/__tests__/dropdown.test.tsx b/components/transfer/__tests__/dropdown.test.tsx index 77ed0c47b4..03ce333976 100644 --- a/components/transfer/__tests__/dropdown.test.tsx +++ b/components/transfer/__tests__/dropdown.test.tsx @@ -1,8 +1,8 @@ /* eslint no-use-before-define: "off" */ import React from 'react'; import { act } from 'react-dom/test-utils'; -import { render, fireEvent } from '../../../tests/utils'; import Transfer from '..'; +import { fireEvent, render } from '../../../tests/utils'; const listProps = { dataSource: [ diff --git a/components/transfer/__tests__/index.test.js b/components/transfer/__tests__/index.test.js index 80e847aba9..8061f49af5 100644 --- a/components/transfer/__tests__/index.test.js +++ b/components/transfer/__tests__/index.test.js @@ -1,14 +1,14 @@ /* eslint @typescript-eslint/no-use-before-define: "off" */ -import React, { useState } from 'react'; -import { mount } from 'enzyme'; import { fireEvent, render } from '@testing-library/react'; +import { mount } from 'enzyme'; +import React, { useState } from 'react'; import Transfer from '..'; -import TransferList from '../list'; -import TransferSearch from '../search'; -import TransferItem from '../ListItem'; -import Checkbox from '../../checkbox'; import mountTest from '../../../tests/shared/mountTest'; import rtlTest from '../../../tests/shared/rtlTest'; +import Checkbox from '../../checkbox'; +import TransferList from '../list'; +import TransferItem from '../ListItem'; +import TransferSearch from '../search'; const consoleErrorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); diff --git a/components/transfer/__tests__/list.test.js b/components/transfer/__tests__/list.test.js index a3433d2ea5..b19cffe0f9 100644 --- a/components/transfer/__tests__/list.test.js +++ b/components/transfer/__tests__/list.test.js @@ -1,7 +1,7 @@ -import React from 'react'; import { mount } from 'enzyme'; -import List from '../list'; +import React from 'react'; import Checkbox from '../../checkbox'; +import List from '../list'; const listCommonProps = { prefixCls: 'ant-transfer-list', diff --git a/components/transfer/__tests__/search.test.js b/components/transfer/__tests__/search.test.js index 128502cd8e..8afc25640d 100644 --- a/components/transfer/__tests__/search.test.js +++ b/components/transfer/__tests__/search.test.js @@ -1,9 +1,9 @@ -import React from 'react'; -import { mount } from 'enzyme'; import { render as testLibRender } from '@testing-library/react'; -import { render, fireEvent } from '../../../tests/utils'; -import Search from '../search'; +import { mount } from 'enzyme'; +import React from 'react'; +import { fireEvent, render } from '../../../tests/utils'; import Transfer from '../index'; +import Search from '../search'; describe('Transfer.Search', () => { const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); diff --git a/components/transfer/index.tsx b/components/transfer/index.tsx index b52662666c..ace90f0296 100644 --- a/components/transfer/index.tsx +++ b/components/transfer/index.tsx @@ -1,20 +1,20 @@ -import * as React from 'react'; import classNames from 'classnames'; -import type { TransferListProps } from './list'; -import List from './list'; -import Operation from './operation'; -import Search from './search'; -import LocaleReceiver from '../locale-provider/LocaleReceiver'; -import defaultLocale from '../locale/default'; +import * as React from 'react'; import type { ConfigConsumerProps, RenderEmptyHandler } from '../config-provider'; import { ConfigConsumer } from '../config-provider'; -import type { TransferListBodyProps } from './ListBody'; -import type { PaginationType } from './interface'; -import warning from '../_util/warning'; +import defaultRenderEmpty from '../config-provider/defaultRenderEmpty'; import { FormItemInputContext } from '../form/context'; +import LocaleReceiver from '../locale-provider/LocaleReceiver'; +import defaultLocale from '../locale/default'; import type { InputStatus } from '../_util/statusUtils'; import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils'; -import defaultRenderEmpty from '../config-provider/defaultRenderEmpty'; +import warning from '../_util/warning'; +import type { PaginationType } from './interface'; +import type { TransferListProps } from './list'; +import List from './list'; +import type { TransferListBodyProps } from './ListBody'; +import Operation from './operation'; +import Search from './search'; export { TransferListProps } from './list'; export { TransferOperationProps } from './operation'; diff --git a/components/transfer/list.tsx b/components/transfer/list.tsx index 7e7902c6d8..00f9b5c685 100644 --- a/components/transfer/list.tsx +++ b/components/transfer/list.tsx @@ -1,23 +1,23 @@ -import * as React from 'react'; -import omit from 'rc-util/lib/omit'; -import classNames from 'classnames'; import DownOutlined from '@ant-design/icons/DownOutlined'; +import classNames from 'classnames'; +import omit from 'rc-util/lib/omit'; +import * as React from 'react'; import Checkbox from '../checkbox'; -import Menu from '../menu'; import Dropdown from '../dropdown'; +import Menu from '../menu'; +import { isValidElement } from '../_util/reactNode'; import type { - TransferDirection, + KeyWiseTransferItem, RenderResult, RenderResultObject, SelectAllLabel, + TransferDirection, TransferLocale, - KeyWiseTransferItem, } from './index'; -import Search from './search'; +import type { PaginationType } from './interface'; import type { TransferListBodyProps } from './ListBody'; import DefaultListBody, { OmitProps } from './ListBody'; -import type { PaginationType } from './interface'; -import { isValidElement } from '../_util/reactNode'; +import Search from './search'; const defaultRender = () => null; diff --git a/components/transfer/operation.tsx b/components/transfer/operation.tsx index 75b30cd6b4..4eef0f40c6 100644 --- a/components/transfer/operation.tsx +++ b/components/transfer/operation.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; import LeftOutlined from '@ant-design/icons/LeftOutlined'; import RightOutlined from '@ant-design/icons/RightOutlined'; +import * as React from 'react'; import Button from '../button'; import type { DirectionType } from '../config-provider'; diff --git a/components/transfer/search.tsx b/components/transfer/search.tsx index 60d16ab174..91eb27940d 100644 --- a/components/transfer/search.tsx +++ b/components/transfer/search.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; import SearchOutlined from '@ant-design/icons/SearchOutlined'; +import * as React from 'react'; import Input from '../input'; diff --git a/components/transfer/style/index.tsx b/components/transfer/style/index.tsx index 4bf2723fe7..2b52178db5 100644 --- a/components/transfer/style/index.tsx +++ b/components/transfer/style/index.tsx @@ -2,12 +2,12 @@ import '../../style/index.less'; import './index.less'; // style dependencies -import '../../empty/style'; -import '../../checkbox/style'; import '../../button/style'; +import '../../checkbox/style'; +import '../../dropdown/style'; +import '../../empty/style'; import '../../input/style'; import '../../menu/style'; -import '../../dropdown/style'; import '../../pagination/style'; // deps-lint-skip: form diff --git a/components/tree-select/__tests__/index.test.js b/components/tree-select/__tests__/index.test.js index 7006ef3465..de3417fe05 100644 --- a/components/tree-select/__tests__/index.test.js +++ b/components/tree-select/__tests__/index.test.js @@ -1,5 +1,5 @@ -import React from 'react'; import { mount } from 'enzyme'; +import React from 'react'; import TreeSelect, { TreeNode } from '..'; import focusTest from '../../../tests/shared/focusTest'; import mountTest from '../../../tests/shared/mountTest'; diff --git a/components/tree-select/index.tsx b/components/tree-select/index.tsx index 587714700f..6e88638c91 100644 --- a/components/tree-select/index.tsx +++ b/components/tree-select/index.tsx @@ -1,26 +1,26 @@ -import * as React from 'react'; -import type { TreeSelectProps as RcTreeSelectProps } from 'rc-tree-select'; -import RcTreeSelect, { TreeNode, SHOW_ALL, SHOW_PARENT, SHOW_CHILD } from 'rc-tree-select'; import classNames from 'classnames'; -import omit from 'rc-util/lib/omit'; -import type { BaseOptionType, DefaultOptionType } from 'rc-tree-select/lib/TreeSelect'; import type { BaseSelectRef } from 'rc-select'; +import type { TreeSelectProps as RcTreeSelectProps } from 'rc-tree-select'; +import RcTreeSelect, { SHOW_ALL, SHOW_CHILD, SHOW_PARENT, TreeNode } from 'rc-tree-select'; +import type { BaseOptionType, DefaultOptionType } from 'rc-tree-select/lib/TreeSelect'; +import omit from 'rc-util/lib/omit'; +import * as React from 'react'; import { useContext } from 'react'; import { ConfigContext } from '../config-provider'; -import warning from '../_util/warning'; -import type { AntTreeNodeProps, TreeProps } from '../tree'; -import type { SwitcherIcon } from '../tree/Tree'; -import getIcons from '../select/utils/iconUtil'; -import renderSwitcherIcon from '../tree/utils/iconUtil'; +import defaultRenderEmpty from '../config-provider/defaultRenderEmpty'; +import DisabledContext from '../config-provider/DisabledContext'; import type { SizeType } from '../config-provider/SizeContext'; import SizeContext from '../config-provider/SizeContext'; -import DisabledContext from '../config-provider/DisabledContext'; -import type { SelectCommonPlacement } from '../_util/motion'; -import { getTransitionName, getTransitionDirection } from '../_util/motion'; import { FormItemInputContext } from '../form/context'; +import getIcons from '../select/utils/iconUtil'; +import type { AntTreeNodeProps, TreeProps } from '../tree'; +import type { SwitcherIcon } from '../tree/Tree'; +import renderSwitcherIcon from '../tree/utils/iconUtil'; +import type { SelectCommonPlacement } from '../_util/motion'; +import { getTransitionDirection, getTransitionName } from '../_util/motion'; import type { InputStatus } from '../_util/statusUtils'; import { getMergedStatus, getStatusClassNames } from '../_util/statusUtils'; -import defaultRenderEmpty from '../config-provider/defaultRenderEmpty'; +import warning from '../_util/warning'; type RawValue = string | number; diff --git a/components/tree-select/style/index.tsx b/components/tree-select/style/index.tsx index def4cc2b8c..29767e2faa 100644 --- a/components/tree-select/style/index.tsx +++ b/components/tree-select/style/index.tsx @@ -3,5 +3,5 @@ import './index.less'; // style dependencies // deps-lint-skip: tree, form -import '../../select/style'; import '../../empty/style'; +import '../../select/style'; diff --git a/components/tree/Tree.tsx b/components/tree/Tree.tsx index 0586cf4c9b..4c407b9553 100644 --- a/components/tree/Tree.tsx +++ b/components/tree/Tree.tsx @@ -1,14 +1,14 @@ -import * as React from 'react'; import HolderOutlined from '@ant-design/icons/HolderOutlined'; -import type { TreeProps as RcTreeProps, BasicDataNode } from 'rc-tree'; -import RcTree, { TreeNode } from 'rc-tree'; import classNames from 'classnames'; +import type { BasicDataNode, TreeProps as RcTreeProps } from 'rc-tree'; +import RcTree, { TreeNode } from 'rc-tree'; import type { DataNode, Key } from 'rc-tree/lib/interface'; -import DirectoryTree from './DirectoryTree'; +import * as React from 'react'; import { ConfigContext } from '../config-provider'; import collapseMotion from '../_util/motion'; -import renderSwitcherIcon from './utils/iconUtil'; +import DirectoryTree from './DirectoryTree'; import dropIndicatorRender from './utils/dropIndicator'; +import renderSwitcherIcon from './utils/iconUtil'; export type SwitcherIcon = React.ReactNode | ((props: { expanded: boolean }) => React.ReactNode); diff --git a/components/tree/__tests__/type.test.tsx b/components/tree/__tests__/type.test.tsx index bab03a099b..8631b459da 100644 --- a/components/tree/__tests__/type.test.tsx +++ b/components/tree/__tests__/type.test.tsx @@ -51,7 +51,6 @@ describe('Tree.TypeScript', () => { expect(container).toBeTruthy(); }); - it('directoryTree support generic', () => { interface MyDataNode extends BasicDataNode { bamboo: string; diff --git a/components/tree/index.tsx b/components/tree/index.tsx index 527c78cddc..e822168412 100644 --- a/components/tree/index.tsx +++ b/components/tree/index.tsx @@ -1,18 +1,16 @@ import Tree from './Tree'; -export { EventDataNode, DataNode } from 'rc-tree/lib/interface'; - +export { DataNode, EventDataNode } from 'rc-tree/lib/interface'; +export { DirectoryTreeProps, ExpandAction as DirectoryTreeExpandAction } from './DirectoryTree'; export { - TreeProps, - AntTreeNode, - AntTreeNodeMouseEvent, - AntTreeNodeExpandedEvent, - AntTreeNodeCheckedEvent, - AntTreeNodeSelectedEvent, AntdTreeNodeAttribute, + AntTreeNode, + AntTreeNodeCheckedEvent, + AntTreeNodeExpandedEvent, + AntTreeNodeMouseEvent, AntTreeNodeProps, + AntTreeNodeSelectedEvent, + TreeProps, } from './Tree'; -export { ExpandAction as DirectoryTreeExpandAction, DirectoryTreeProps } from './DirectoryTree'; - export default Tree; diff --git a/components/tree/utils/iconUtil.tsx b/components/tree/utils/iconUtil.tsx index eb456733a3..1ae6c4f00a 100644 --- a/components/tree/utils/iconUtil.tsx +++ b/components/tree/utils/iconUtil.tsx @@ -1,12 +1,12 @@ -import * as React from 'react'; -import classNames from 'classnames'; -import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; +import CaretDownFilled from '@ant-design/icons/CaretDownFilled'; import FileOutlined from '@ant-design/icons/FileOutlined'; +import LoadingOutlined from '@ant-design/icons/LoadingOutlined'; import MinusSquareOutlined from '@ant-design/icons/MinusSquareOutlined'; import PlusSquareOutlined from '@ant-design/icons/PlusSquareOutlined'; -import CaretDownFilled from '@ant-design/icons/CaretDownFilled'; +import classNames from 'classnames'; +import * as React from 'react'; +import { cloneElement, isValidElement } from '../../_util/reactNode'; import type { AntTreeNodeProps, SwitcherIcon } from '../Tree'; -import { isValidElement, cloneElement } from '../../_util/reactNode'; export default function renderSwitcherIcon( prefixCls: string, diff --git a/components/typography/Base/Ellipsis.tsx b/components/typography/Base/Ellipsis.tsx index bd3b065668..46db79beab 100644 --- a/components/typography/Base/Ellipsis.tsx +++ b/components/typography/Base/Ellipsis.tsx @@ -1,6 +1,6 @@ -import * as React from 'react'; import toArray from 'rc-util/lib/Children/toArray'; import useIsomorphicLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect'; +import * as React from 'react'; export interface EllipsisProps { enabledMeasure?: boolean; diff --git a/components/typography/Base/index.tsx b/components/typography/Base/index.tsx index f93ab3f5e6..d09b2a9904 100644 --- a/components/typography/Base/index.tsx +++ b/components/typography/Base/index.tsx @@ -1,26 +1,26 @@ -import * as React from 'react'; -import classNames from 'classnames'; -import useMergedState from 'rc-util/lib/hooks/useMergedState'; -import toArray from 'rc-util/lib/Children/toArray'; -import copy from 'copy-to-clipboard'; -import omit from 'rc-util/lib/omit'; -import { composeRef } from 'rc-util/lib/ref'; -import EditOutlined from '@ant-design/icons/EditOutlined'; import CheckOutlined from '@ant-design/icons/CheckOutlined'; import CopyOutlined from '@ant-design/icons/CopyOutlined'; +import EditOutlined from '@ant-design/icons/EditOutlined'; +import classNames from 'classnames'; +import copy from 'copy-to-clipboard'; import ResizeObserver from 'rc-resize-observer'; import type { AutoSizeType } from 'rc-textarea/lib/ResizableTextArea'; +import toArray from 'rc-util/lib/Children/toArray'; import useIsomorphicLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect'; +import useMergedState from 'rc-util/lib/hooks/useMergedState'; +import omit from 'rc-util/lib/omit'; +import { composeRef } from 'rc-util/lib/ref'; +import * as React from 'react'; import { ConfigContext } from '../../config-provider'; import { useLocaleReceiver } from '../../locale-provider/LocaleReceiver'; -import TransButton from '../../_util/transButton'; -import { isStyleSupport } from '../../_util/styleChecker'; import Tooltip from '../../tooltip'; -import type { TypographyProps } from '../Typography'; -import Typography from '../Typography'; +import { isStyleSupport } from '../../_util/styleChecker'; +import TransButton from '../../_util/transButton'; import Editable from '../Editable'; import useMergedConfig from '../hooks/useMergedConfig'; import useUpdatedEffect from '../hooks/useUpdatedEffect'; +import type { TypographyProps } from '../Typography'; +import Typography from '../Typography'; import Ellipsis from './Ellipsis'; import EllipsisTooltip from './EllipsisTooltip'; diff --git a/components/typography/Editable.tsx b/components/typography/Editable.tsx index 1a171a0bc8..bf3f3f4487 100644 --- a/components/typography/Editable.tsx +++ b/components/typography/Editable.tsx @@ -1,10 +1,10 @@ -import * as React from 'react'; -import classNames from 'classnames'; -import KeyCode from 'rc-util/lib/KeyCode'; import EnterOutlined from '@ant-design/icons/EnterOutlined'; +import classNames from 'classnames'; import type { AutoSizeType } from 'rc-textarea/lib/ResizableTextArea'; -import TextArea from '../input/TextArea'; +import KeyCode from 'rc-util/lib/KeyCode'; +import * as React from 'react'; import type { DirectionType } from '../config-provider'; +import TextArea from '../input/TextArea'; import { cloneElement } from '../_util/reactNode'; interface EditableProps { diff --git a/components/typography/Text.tsx b/components/typography/Text.tsx index 0684f07b99..32d489cf96 100644 --- a/components/typography/Text.tsx +++ b/components/typography/Text.tsx @@ -1,5 +1,5 @@ -import * as React from 'react'; import omit from 'rc-util/lib/omit'; +import * as React from 'react'; import warning from '../_util/warning'; import type { BlockProps, EllipsisConfig } from './Base'; import Base from './Base'; diff --git a/components/typography/Title.tsx b/components/typography/Title.tsx index 04d895628f..1d1e2a82eb 100644 --- a/components/typography/Title.tsx +++ b/components/typography/Title.tsx @@ -1,8 +1,8 @@ import * as React from 'react'; +import { tupleNum } from '../_util/type'; import warning from '../_util/warning'; import type { BlockProps } from './Base'; import Base from './Base'; -import { tupleNum } from '../_util/type'; const TITLE_ELE_LIST = tupleNum(1, 2, 3, 4, 5); diff --git a/components/typography/__tests__/copy.test.tsx b/components/typography/__tests__/copy.test.tsx index ef5afb9d43..63ec402fe6 100644 --- a/components/typography/__tests__/copy.test.tsx +++ b/components/typography/__tests__/copy.test.tsx @@ -1,7 +1,7 @@ -import React from 'react'; import { LikeOutlined, SmileOutlined } from '@ant-design/icons'; -import * as copyObj from 'copy-to-clipboard'; import { act } from '@testing-library/react'; +import * as copyObj from 'copy-to-clipboard'; +import React from 'react'; import { fireEvent, render, waitFor } from '../../../tests/utils'; import Base from '../Base'; diff --git a/components/typography/__tests__/ellipsis.test.js b/components/typography/__tests__/ellipsis.test.js index 212e95e6be..0439f2d466 100644 --- a/components/typography/__tests__/ellipsis.test.js +++ b/components/typography/__tests__/ellipsis.test.js @@ -1,9 +1,8 @@ -import React from 'react'; import { spyElementPrototypes } from 'rc-util/lib/test/domHook'; -import Base from '../Base'; +import React from 'react'; import { fireEvent, render, sleep, triggerResize, waitFor } from '../../../tests/utils'; +import Base from '../Base'; // eslint-disable-next-line no-unused-vars -import * as styleChecker from '../../_util/styleChecker'; jest.mock('copy-to-clipboard'); diff --git a/components/typography/__tests__/enter-key-callback.test.tsx b/components/typography/__tests__/enter-key-callback.test.tsx index a9fbac1083..eeb5a2a8cb 100644 --- a/components/typography/__tests__/enter-key-callback.test.tsx +++ b/components/typography/__tests__/enter-key-callback.test.tsx @@ -1,7 +1,7 @@ -import React from 'react'; import KeyCode from 'rc-util/lib/KeyCode'; -import Paragraph from '../Paragraph'; +import React from 'react'; import { fireEvent, render } from '../../../tests/utils'; +import Paragraph from '../Paragraph'; test('Callback on enter key is triggered', () => { const onEditStart = jest.fn(); diff --git a/components/typography/__tests__/index.test.js b/components/typography/__tests__/index.test.js index 14790863c9..b63a33ee43 100644 --- a/components/typography/__tests__/index.test.js +++ b/components/typography/__tests__/index.test.js @@ -1,17 +1,17 @@ -import React from 'react'; import { CheckOutlined, HighlightOutlined, LikeOutlined, SmileOutlined } from '@ant-design/icons'; +import copy from 'copy-to-clipboard'; import KeyCode from 'rc-util/lib/KeyCode'; import { resetWarned } from 'rc-util/lib/warning'; -import copy from 'copy-to-clipboard'; -import Title from '../Title'; +import React from 'react'; +import mountTest from '../../../tests/shared/mountTest'; +import rtlTest from '../../../tests/shared/rtlTest'; +import { fireEvent, render, sleep, waitFor } from '../../../tests/utils'; +import Base from '../Base'; import Link from '../Link'; import Paragraph from '../Paragraph'; import Text from '../Text'; -import Base from '../Base'; -import mountTest from '../../../tests/shared/mountTest'; -import rtlTest from '../../../tests/shared/rtlTest'; +import Title from '../Title'; import Typography from '../Typography'; -import { fireEvent, render, sleep, waitFor } from '../../../tests/utils'; jest.mock('copy-to-clipboard'); diff --git a/components/typography/index.tsx b/components/typography/index.tsx index a8f50ada4b..9f9f3084cb 100644 --- a/components/typography/index.tsx +++ b/components/typography/index.tsx @@ -1,8 +1,8 @@ -import OriginTypography from './Typography'; -import Text from './Text'; import Link from './Link'; -import Title from './Title'; import Paragraph from './Paragraph'; +import Text from './Text'; +import Title from './Title'; +import OriginTypography from './Typography'; export type TypographyProps = typeof OriginTypography & { Text: typeof Text; diff --git a/components/typography/style/index.tsx b/components/typography/style/index.tsx index c7f4eeb992..3c25dadbdc 100644 --- a/components/typography/style/index.tsx +++ b/components/typography/style/index.tsx @@ -2,5 +2,5 @@ import '../../style/index.less'; import './index.less'; // style dependencies -import '../../tooltip/style'; import '../../input/style'; +import '../../tooltip/style'; diff --git a/components/upload/UploadList/ListItem.tsx b/components/upload/UploadList/ListItem.tsx index 9622a5c756..eaf8e61b4e 100644 --- a/components/upload/UploadList/ListItem.tsx +++ b/components/upload/UploadList/ListItem.tsx @@ -1,12 +1,12 @@ -import * as React from 'react'; -import CSSMotion from 'rc-motion'; -import classNames from 'classnames'; -import EyeOutlined from '@ant-design/icons/EyeOutlined'; import DeleteOutlined from '@ant-design/icons/DeleteOutlined'; import DownloadOutlined from '@ant-design/icons/DownloadOutlined'; -import Tooltip from '../../tooltip'; -import Progress from '../../progress'; +import EyeOutlined from '@ant-design/icons/EyeOutlined'; +import classNames from 'classnames'; +import CSSMotion from 'rc-motion'; +import * as React from 'react'; import { ConfigContext } from '../../config-provider'; +import Progress from '../../progress'; +import Tooltip from '../../tooltip'; import type { ItemRender, diff --git a/components/upload/__tests__/dragger.test.js b/components/upload/__tests__/dragger.test.js index 3e9a5fc601..645cdbddd2 100644 --- a/components/upload/__tests__/dragger.test.js +++ b/components/upload/__tests__/dragger.test.js @@ -2,9 +2,9 @@ import React from 'react'; import { act } from 'react-dom/test-utils'; import Upload from '..'; -import { setup, teardown } from './mock'; import mountTest from '../../../tests/shared/mountTest'; import { fireEvent, render, waitFor } from '../../../tests/utils'; +import { setup, teardown } from './mock'; describe('Upload.Dragger', () => { mountTest(Upload.Dragger); diff --git a/components/upload/__tests__/upload.test.js b/components/upload/__tests__/upload.test.js index b07a5dd62a..e331d51fc2 100644 --- a/components/upload/__tests__/upload.test.js +++ b/components/upload/__tests__/upload.test.js @@ -1,16 +1,16 @@ /* eslint-disable react/no-string-refs, react/prefer-es6-class */ -import React from 'react'; -import { act } from 'react-dom/test-utils'; import produce from 'immer'; import { cloneDeep } from 'lodash'; +import React from 'react'; +import { act } from 'react-dom/test-utils'; import Upload from '..'; -import Form from '../../form'; -import { getFileItem, removeFileItem, isImageUrl } from '../utils'; -import { setup, teardown } from './mock'; -import { resetWarned } from '../../_util/warning'; 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 Form from '../../form'; +import { resetWarned } from '../../_util/warning'; +import { getFileItem, isImageUrl, removeFileItem } from '../utils'; +import { setup, teardown } from './mock'; globalThis.IS_REACT_ACT_ENVIRONMENT = true; diff --git a/components/upload/index.tsx b/components/upload/index.tsx index 6d046c9b5a..4d7cc1fe59 100644 --- a/components/upload/index.tsx +++ b/components/upload/index.tsx @@ -2,8 +2,8 @@ import Dragger from './Dragger'; import type { UploadProps } from './Upload'; import InternalUpload, { LIST_IGNORE } from './Upload'; -export { UploadProps, UploadListProps, UploadChangeParam, UploadFile, RcFile } from './interface'; export { DraggerProps } from './Dragger'; +export { RcFile, UploadChangeParam, UploadFile, UploadListProps, UploadProps } from './interface'; type InternalUploadType = typeof InternalUpload; interface UploadInterface extends InternalUploadType { diff --git a/components/upload/interface.tsx b/components/upload/interface.tsx index 932de191e9..1b1c218085 100755 --- a/components/upload/interface.tsx +++ b/components/upload/interface.tsx @@ -1,9 +1,9 @@ -import type * as React from 'react'; import type { RcFile as OriRcFile, - UploadRequestOption as RcCustomRequestOptions, UploadProps as RcUploadProps, + UploadRequestOption as RcCustomRequestOptions, } from 'rc-upload/lib/interface'; +import type * as React from 'react'; import type { ProgressProps } from '../progress'; export interface RcFile extends OriRcFile { diff --git a/components/upload/utils.tsx b/components/upload/utils.tsx index 9d92ca7aa8..c80c78a030 100644 --- a/components/upload/utils.tsx +++ b/components/upload/utils.tsx @@ -1,4 +1,4 @@ -import type { RcFile, UploadFile, InternalUploadFile } from './interface'; +import type { InternalUploadFile, RcFile, UploadFile } from './interface'; export function file2Obj(file: RcFile): InternalUploadFile { return {