Skip to content

Commit

Permalink
fix: 将 antd 转为 antd/es
Browse files Browse the repository at this point in the history
  • Loading branch information
luozefeng committed Nov 16, 2021
1 parent 1a4becf commit 0cdda82
Show file tree
Hide file tree
Showing 25 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions packages/lb-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
"dependencies": {
"@ant-design/icons": "^4.6.2",
"@sensetime/annotation": "1.5.0-alpha.1",
"antd": "^4.15.0",
"classnames": "^2.3.0",
"@sensetime/lb-utils": "^1.0.0",
"lodash": "^4.17.21",
Expand All @@ -53,7 +52,8 @@
"resize-observer-polyfill": "^1.5.1"
},
"peerDependencies": {
"react": ">=16.9.0"
"react": ">=16.9.0",
"antd": ">=4.15.0"
},
"devDependencies": {
"@commitlint/cli": "^13.1.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/lb-components/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ export default {
},
}),
],
external: ['react'],
external: ['react', 'antd'],
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import React, { useEffect, useRef, useImperativeHandle, useState } from 'react';
import { ViewOperation, ImgUtils } from '@sensetime/annotation';
import { Spin } from 'antd';
import { Spin } from 'antd/es';

interface IProps {
src: string; // 图片路径
Expand Down
2 changes: 1 addition & 1 deletion packages/lb-components/src/components/ImageError/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ReloadOutlined } from '@ant-design/icons';
import { Button } from 'antd';
import { Button } from 'antd/es';
import React from 'react';

interface IProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { COLORS_ARRAY, NULL_COLOR } from '@/data/Style';
import { ColorTag } from '@/components/colorTag';
import { Radio } from 'antd';
import { Radio } from 'antd/es';
import React from 'react';

export const ATTRIBUTE_COLORS = [NULL_COLOR].concat(COLORS_ARRAY);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Checkbox } from 'antd';
import { Checkbox } from 'antd/es';
import React from 'react';

interface IProps {
Expand Down
2 changes: 1 addition & 1 deletion packages/lb-components/src/store/annotation/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import styleString from '@/constant/styleString';
import { getFormatSize } from '@/components/customResizeHook';
import { AnnotationEngine, CommonToolUtils, ImgUtils } from '@sensetime/annotation';
import { AnnotationState, AnnotationActionTypes } from './types';
import { message } from 'antd';
import { message } from 'antd/es';
import { SetAnnotationLoading } from './actionCreators';

export const getStepConfig = (stepList: any[], step: number) =>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useRef, useState } from 'react';
import { Spin, message } from 'antd';
import { Spin, message } from 'antd/es';
import { AppState } from 'src/store';
import { connect } from 'react-redux';
import { ImgAttributeState } from 'src/store/imgAttribute/types';
Expand Down
2 changes: 1 addition & 1 deletion packages/lb-components/src/views/MainView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Sidebar from './sidebar';
import ToolFooter from './toolFooter';
import { prefix } from '@/constant';
import { getNewNode } from '@/utils';
import { Layout } from 'antd';
import { Layout } from 'antd/es';

const { Sider, Content } = Layout;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useEffect, useState } from 'react';
import { message } from 'antd';
import { message } from 'antd/es';
import TextAreaFormat from '@/views/MainView/sidebar/TextAreaFormat';
import { TextUtils } from '@/utils/TextUtils';
import { AppState } from '@/store';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Tooltip } from 'antd';
import { Tooltip } from 'antd/es';
import React, { useState } from 'react';

// 图片调整的刷子
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { Col, Popconfirm } from 'antd';
import { Col, Popconfirm } from 'antd/es';
import clearResultSvg from '@/assets/annotation/common/icon_clear.svg';
import clearResultASvg from '@/assets/annotation/common/icon_clear_a.svg';
import copyBackStepSvg from '@/assets/annotation/common/icon_invalid.svg';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Col, Row, Slider, Switch, Input } from 'antd';
import { Col, Row, Slider, Switch, Input } from 'antd/es';
import { connect } from 'react-redux';
import { throttle } from 'lodash';
import React, { useEffect } from 'react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import RadioList from '@/components/attributeList';
import CheckBoxList from '@/components/checkboxList';
import { CaretRightOutlined } from '@ant-design/icons';
import { Badge, Collapse, Tooltip } from 'antd';
import { Badge, Collapse, Tooltip } from 'antd/es';
import { cloneDeep } from 'lodash';
import React, { useCallback, useEffect, useRef, useState } from 'react';
import clearSmall from '@/assets/annotation/common/icon_clearSmall.svg';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { TEXT_ATTRIBUTE_MAX_LENGTH } from '@/data/enums/ToolType';
import { TextUtils } from '@/utils/TextUtils';
import { Input, message, Tooltip } from 'antd';
import { Input, message, Tooltip } from 'antd/es';
import React, { FocusEvent, useEffect, useState } from 'react';
import IconClearSmallA from '@/assets/annotation/common/icon_clearSmall_a.svg';
import IconClearSmall from '@/assets/annotation/common/icon_clearSmall.svg';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { connect } from 'react-redux';
import { AppState } from '@/store';
import { cloneDeep } from 'lodash';
import { classnames } from '@/utils';
import { Input } from 'antd';
import { Input } from 'antd/es';
import { cKeyCode } from '@sensetime/annotation';
import { PageForward } from '@/store/annotation/actionCreators';
import { ConfigUtils } from '@/utils/ConfigUtils';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Slider } from 'antd';
import { Slider } from 'antd/es';
import React from 'react';
import widthSvg from '@/assets/toolStyle/icon_border.svg';
import colorSvg from '@/assets/toolStyle/icon_borderColor.svg';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Row, Collapse } from 'antd';
import { Row, Collapse } from 'antd/es';
import iconRectPatternSvg from '@/assets/annotation/rectTool/icon_rectPattern.svg';
import iconPolygonPatternASvg from '@/assets/annotation/polygonTool/icon_polygon_a.svg';
import pointASvg from '@/assets/annotation/pointTool/icon_point_a.svg';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Popover } from 'antd';
import { Popover } from 'antd/es';
import _ from 'lodash';
import React, { useState } from 'react';
import { useSelector } from 'react-redux';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
import { AppState } from '@/store';
import { connect } from 'react-redux';
import { ToolInstance } from '@/store/annotation/types';
import { Divider } from 'antd';
import { Divider } from 'antd/es';
import { useTranslation } from 'react-i18next';

interface IProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
import { AppState } from '@/store';
import { connect } from 'react-redux';
import { GraphToolInstance } from '@/store/annotation/types';
import { Divider } from 'antd';
import { Divider } from 'antd/es';
import { useTranslation } from 'react-i18next';

interface IProps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useRef, useEffect } from 'react';
import { Divider, Input } from 'antd';
import { Divider, Input } from 'antd/es';
import { LeftOutlined, RightOutlined } from '@ant-design/icons';
import { AppState } from '@/store';
import { connect, useDispatch } from 'react-redux';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Button } from 'antd';
import { Button } from 'antd/es';
import { AppState } from '@/store';
import { ToolInstance } from '@/store/annotation/types';
import { connect } from 'react-redux';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* 用于多步骤中的切换
*/

import { Dropdown } from 'antd';
import { Dropdown } from 'antd/es';
import { CaretDownOutlined, OrderedListOutlined } from '@ant-design/icons';
import React from 'react';
import { connect, useDispatch } from 'react-redux';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ESubmitType, prefix } from '@/constant';
import ExportData from './ExportData';
import HeaderOption from './headerOption';
import { AnnotationEngine } from '@sensetime/annotation';
import { Button, Tooltip } from 'antd';
import { Button, Tooltip } from 'antd/es';
import { ToNextStep, ToSubmitFileData } from '@/store/annotation/actionCreators';
import StepSwitch from './StepSwitch';
import { EToolName } from '@/data/enums/ToolType';
Expand Down

0 comments on commit 0cdda82

Please sign in to comment.