Skip to content

Commit

Permalink
fix(layout): fix menu item icon style error (ant-design#6745)
Browse files Browse the repository at this point in the history
* fix(layout): fix menu item icon style error

* fix build error

* fix build error

* chore: best test case

* chore: best test case

* chore: best test case
  • Loading branch information
chenshuai2144 committed Mar 9, 2023
1 parent 7828d57 commit 87f9656
Show file tree
Hide file tree
Showing 132 changed files with 434 additions and 422 deletions.
3 changes: 2 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ es
.umi
.github
scripts
webpack.config.js
webpack.config.js
server
3 changes: 2 additions & 1 deletion .fatherrc.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ export default defineConfig({
esm: {
input: 'src', // 默认编译目录
output: 'es',
extraBabelPlugins: [[require.resolve('./scripts/replaceLib'), {}]],
platform: 'browser', // 默认构建为 Browser 环境的产物
transformer: 'babel', // 默认使用 babel 以提供更好的兼容性
},
// 以下为 cjs 配置项启用时的默认值,有自定义需求时才需配置
cjs: {
extraBabelPlugins: [[require.resolve('./scripts/replaceLib'), { 3: 'b' }]],
extraBabelPlugins: [[require.resolve('./scripts/replaceEs'), {}]],
input: 'src', // 默认编译目录
output: 'lib',
platform: 'browser', // 默认构建为 Node.js 环境的产物
Expand Down
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@
**/lib
**/es
**\__snapshots__\**
pnpm-lock.yaml
pnpm-lock.yaml
server
2 changes: 1 addition & 1 deletion packages/card/src/components/Card/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { LabelIconTip } from '@ant-design/pro-utils';
import { ConfigProvider, Grid, Tabs } from 'antd';
import classNames from 'classnames';
import omit from 'omit.js';
import useMergedState from 'rc-util/es/hooks/useMergedState';
import useMergedState from 'rc-util/lib/hooks/useMergedState';
import React, { useContext } from 'react';
import type { Breakpoint, CardProps, Gutter } from '../../typing';
import Actions from '../Actions';
Expand Down
4 changes: 2 additions & 2 deletions packages/card/src/components/StatisticCard/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import type { StatisticProps } from '../Statistic';
import Statistic from '../Statistic';
import { useStyle } from './style';

import 'antd/es/divider/style';
import 'antd/es/statistic/style';
import 'antd/lib/divider/style';
import 'antd/lib/statistic/style';
import { ConfigContext } from 'antd/lib/config-provider';

export type StatisticCardProps = {
Expand Down
4 changes: 2 additions & 2 deletions packages/card/src/components/TabPane/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { TabPaneProps, TabsProps } from 'antd';
import { ConfigProvider, Tabs, version } from 'antd';
import classNames from 'classnames';
import toArray from 'rc-util/es/Children/toArray';
import { noteOnce } from 'rc-util/es/warning';
import toArray from 'rc-util/lib/Children/toArray';
import { noteOnce } from 'rc-util/lib/warning';
import React, { useContext } from 'react';
import type { ProCardTabPaneProps, ProCardTabsProps } from '../../typing';
import Card from '../Card';
Expand Down
2 changes: 1 addition & 1 deletion packages/card/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type { ProCardProps } from './ProCard';
import ProCard from './ProCard';
import type { ProCardTabsProps } from './typing';

import 'antd/es/card/style';
import 'antd/lib/card/style';

export type {
ProCardTabsProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/card/src/typing.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { TabPaneProps, TabsProps } from 'antd';
import type { LabelTooltipType } from 'antd/es/form/FormItemLabel';
import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
import type { ReactNode } from 'react';

export type Breakpoint = 'xxl' | 'xl' | 'lg' | 'md' | 'sm' | 'xs';
Expand Down
8 changes: 4 additions & 4 deletions packages/descriptions/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ import {
} from '@ant-design/pro-utils';
import type { DescriptionsProps, FormInstance, FormProps } from 'antd';
import { ConfigProvider, Descriptions, Space } from 'antd';
import type { LabelTooltipType } from 'antd/es/form/FormItemLabel';
import toArray from 'rc-util/es/Children/toArray';
import get from 'rc-util/es/utils/get';
import type { LabelTooltipType } from 'antd/lib/form/FormItemLabel';
import toArray from 'rc-util/lib/Children/toArray';
import get from 'rc-util/lib/utils/get';
import React, { useContext, useEffect } from 'react';
import { stringify } from 'use-json-comparison';
import type { RequestData } from './useFetchData';
import useFetchData from './useFetchData';

// 兼容代码-----------
import 'antd/es/descriptions/style';
import 'antd/lib/descriptions/style';
import type { ProFieldFCMode } from '@ant-design/pro-provider';
//----------------------

Expand Down
2 changes: 1 addition & 1 deletion packages/descriptions/src/useFetchData.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import useMergedState from 'rc-util/es/hooks/useMergedState';
import useMergedState from 'rc-util/lib/hooks/useMergedState';
import { useEffect } from 'react';

export type RequestData<T = any> = {
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Cascader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { FieldSelectProps } from '../Select';
import { ObjToMap, proFieldParsingText, useFieldFetchData } from '../Select';
import { ConfigContext } from 'antd/lib/config-provider';
// 兼容代码-----------
import 'antd/es/cascader/style';
import 'antd/lib/cascader/style';
//----------------------

export type GroupProps = {
Expand Down
4 changes: 2 additions & 2 deletions packages/field/src/components/Checkbox/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useStyle } from '@ant-design/pro-utils';
import { Checkbox, ConfigProvider, Space, Spin } from 'antd';
import type { CheckboxGroupProps } from 'antd/es/checkbox';
import type { CheckboxGroupProps } from 'antd/lib/checkbox';
import classNames from 'classnames';
import React, { useContext, useImperativeHandle, useRef } from 'react';
import type { ProFieldFC } from '../../index';
Expand All @@ -12,7 +12,7 @@ export type GroupProps = {
} & FieldSelectProps;
import { ConfigContext } from 'antd/lib/config-provider';
// 兼容代码-----------
import 'antd/es/checkbox/style';
import 'antd/lib/checkbox/style';
//----------------------
/**
* 多选组件
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Code/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import 'antd/es/input/style';
import 'antd/lib/input/style';
//----------------------

const languageFormat = (text: string, language: string) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/ColorPicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SketchPicker } from '@chenshuai2144/sketch-color';
import type { PopoverProps } from 'antd';
import { ConfigProvider, Popover } from 'antd';
import { ConfigContext } from 'antd/lib/config-provider';
import useMergedState from 'rc-util/es/hooks/useMergedState';
import useMergedState from 'rc-util/lib/hooks/useMergedState';
import React, { useContext, useImperativeHandle } from 'react';
import type { ProFieldFC } from '../../index';

Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/DatePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import React, { useContext, useState } from 'react';
import type { ProFieldFC, ProFieldLightProps } from '../../index';
import { ConfigContext } from 'antd/lib/config-provider';
// 兼容代码-----------
import 'antd/es/date-picker/style';
import 'antd/lib/date-picker/style';
//----------------------

dayjs.extend(weekOfYear);
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Digit/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import omit from 'omit.js';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import 'antd/es/input-number/style';
import 'antd/lib/input-number/style';
import { useIntl } from '@ant-design/pro-provider';
//----------------------

Expand Down
4 changes: 2 additions & 2 deletions packages/field/src/components/DigitRange/index.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Input, InputNumber } from 'antd';
import useMergedState from 'rc-util/es/hooks/useMergedState';
import useMergedState from 'rc-util/lib/hooks/useMergedState';
import React from 'react';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import 'antd/es/input-number/style';
import 'antd/lib/input-number/style';
import { useIntl } from '@ant-design/pro-provider';
//----------------------

Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/FromNow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import relativeTime from 'dayjs/plugin/relativeTime';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import 'antd/es/date-picker/style';
import 'antd/lib/date-picker/style';
import React from 'react';
//----------------------

Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Image/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import { useIntl } from '@ant-design/pro-provider';
import 'antd/es/image/style';
import 'antd/lib/image/style';
//----------------------

export type FieldImageProps = {
Expand Down
6 changes: 3 additions & 3 deletions packages/field/src/components/Money/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ import { intlMap as allIntlMap, useIntl } from '@ant-design/pro-provider';
import type { InputNumberProps } from 'antd';
import { InputNumber, Popover } from 'antd';
import omit from 'omit.js';
import useMergedState from 'rc-util/es/hooks/useMergedState';
import useMergedState from 'rc-util/lib/hooks/useMergedState';
import React, { useCallback, useMemo } from 'react';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import 'antd/es/input-number/style';
import 'antd/es/popover/style';
import 'antd/lib/input-number/style';
import 'antd/lib/popover/style';
//----------------------

import { openVisibleCompatible } from '@ant-design/pro-utils';
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Options/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { useContext, useImperativeHandle } from 'react';
import type { ProFieldFC } from '../../index';
import { ConfigContext } from 'antd/lib/config-provider';
// 兼容代码-----------
import 'antd/es/space/style';
import 'antd/lib/space/style';
//----------------------

const addArrayKeys = (doms: React.ReactNode[]) =>
Expand Down
6 changes: 3 additions & 3 deletions packages/field/src/components/Password/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { EyeInvisibleOutlined, EyeOutlined } from '@ant-design/icons';
import { useIntl } from '@ant-design/pro-provider';
import { Input, Space } from 'antd';
import useMergedState from 'rc-util/es/hooks/useMergedState';
import useMergedState from 'rc-util/lib/hooks/useMergedState';
import React from 'react';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import 'antd/es/input/style';
import 'antd/es/space/style';
import 'antd/lib/input/style';
import 'antd/lib/space/style';
//----------------------

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Percent/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import type { ProFieldFC } from '../../index';
import { getColorByRealValue, getRealTextWithPrecision, getSymbolByRealValue } from './util';

// 兼容代码-----------
import 'antd/es/input-number/style';
import 'antd/lib/input-number/style';
import { useIntl } from '@ant-design/pro-provider';
//------------

Expand Down
4 changes: 2 additions & 2 deletions packages/field/src/components/Progress/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import React, { useMemo } from 'react';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import 'antd/es/input-number/style';
import 'antd/es/progress/style';
import 'antd/lib/input-number/style';
import 'antd/lib/progress/style';
import { useIntl } from '@ant-design/pro-provider';
//------------

Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Radio/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import type { ProFieldFC } from '../../index';
import type { FieldSelectProps } from '../Select';
import { ObjToMap, proFieldParsingText, useFieldFetchData } from '../Select';
// 兼容代码-----------
import 'antd/es/radio/style';
import 'antd/lib/radio/style';
import { ConfigContext } from 'antd/lib/config-provider';
//------------
export type GroupProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/RangePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React, { useCallback } from 'react';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import 'antd/es/date-picker/style';
import 'antd/lib/date-picker/style';
//------------

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Rate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import 'antd/es/rate/style';
import 'antd/lib/rate/style';
//------------

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Second/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { InputNumber } from 'antd';
import React from 'react';
import type { ProFieldFC } from '../../index';
// 兼容代码-----------
import 'antd/es/input-number/style';
import 'antd/lib/input-number/style';
import { useIntl } from '@ant-design/pro-provider';
//------------

Expand Down
4 changes: 2 additions & 2 deletions packages/field/src/components/Segmented/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import omit from 'omit.js';
import type { FieldSelectProps } from '../Select';
import { ObjToMap, proFieldParsingText, useFieldFetchData } from '../Select';

import 'antd/es/segmented/style';
import 'antd/es/spin/style';
import 'antd/lib/segmented/style';
import 'antd/lib/spin/style';

/**
* Segmented https://ant.design/components/segmented-cn/
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Select/LightSelect/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { SelectProps } from 'antd';
import { ConfigProvider, Input, Select } from 'antd';
import { ConfigContext } from 'antd/lib/config-provider';
import classNames from 'classnames';
import toArray from 'rc-util/es/Children/toArray';
import toArray from 'rc-util/lib/Children/toArray';
import React, { useContext, useMemo, useState } from 'react';
import type { ProFieldLightProps } from '../../../index';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { RequestOptionsType } from '@ant-design/pro-utils';
import type { SelectProps } from 'antd';
import { ConfigProvider, Select } from 'antd';
import { ConfigContext } from 'antd/lib/config-provider';
import type { LabeledValue } from 'antd/es/select';
import type { LabeledValue } from 'antd/lib/select';
import classNames from 'classnames';
import React, { useContext, useEffect, useImperativeHandle, useRef, useState } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Select/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import LightSelect from './LightSelect';
import SearchSelect from './SearchSelect';
import { ConfigContext } from 'antd/lib/config-provider';
// 兼容代码-----------
import 'antd/es/select/style';
import 'antd/lib/select/style';
//------------

type SelectOptionType = Partial<RequestOptionsType>[];
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Slider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import 'antd/es/slider/style';
import 'antd/lib/slider/style';
//------------
/**
* 评分组件
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Status/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { CSSProperties } from 'react';
import React from 'react';

// 兼容代码-----------
import 'antd/es/badge/style';
import 'antd/lib/badge/style';
//------------

type StatusProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Switch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React, { useMemo } from 'react';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import 'antd/es/switch/style';
import 'antd/lib/switch/style';
//------------

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/Text/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { useEffect, useImperativeHandle, useRef } from 'react';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import 'antd/es/input/style';
import 'antd/lib/input/style';
//------------

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/TextArea/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import 'antd/es/input/style';
import 'antd/lib/input/style';
//------------
/**
* 最基本的组件,就是个普通的 Input.TextArea
Expand Down
2 changes: 1 addition & 1 deletion packages/field/src/components/TimePicker/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import React, { useState } from 'react';
import type { ProFieldFC, ProFieldLightProps } from '../../index';

// 兼容代码-----------
import 'antd/es/date-picker/style';
import 'antd/lib/date-picker/style';
import { useDatePickerStyle } from '../DatePicker';
//----------------------;

Expand Down
Loading

0 comments on commit 87f9656

Please sign in to comment.