From 5d70073db0a5365f363854ce4e10e3d7cfa696aa Mon Sep 17 00:00:00 2001 From: qiuyan Date: Wed, 8 Nov 2023 16:55:22 +0800 Subject: [PATCH] =?UTF-8?q?perf:=20lego=E7=BB=84=E4=BB=B6=E5=BA=93?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=86=99=E6=B3=95,=E5=8E=BB=E6=8E=89warning?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .changeset/rare-news-prove.md | 5 +++++ packages/lego/src/horizontal-bar/index.tsx | 12 ++++-------- packages/lego/src/img-line/index.tsx | 6 ++---- packages/lego/src/progress/index.tsx | 4 ++-- packages/lego/src/radar/index.tsx | 4 ++-- packages/lego/src/utils/createStackSeries.ts | 6 ++---- 6 files changed, 17 insertions(+), 20 deletions(-) create mode 100644 .changeset/rare-news-prove.md diff --git a/.changeset/rare-news-prove.md b/.changeset/rare-news-prove.md new file mode 100644 index 0000000000..fc7c3d8342 --- /dev/null +++ b/.changeset/rare-news-prove.md @@ -0,0 +1,5 @@ +--- +'@td-design/lego': patch +--- + +perf: lego组件库更新写法,去掉warning diff --git a/packages/lego/src/horizontal-bar/index.tsx b/packages/lego/src/horizontal-bar/index.tsx index 7c94f7d008..90afb7f40b 100644 --- a/packages/lego/src/horizontal-bar/index.tsx +++ b/packages/lego/src/horizontal-bar/index.tsx @@ -126,11 +126,9 @@ export default forwardRef( show: true, }, axisLabel: { + ...theme.typography[inModal ? 'p0' : 'p2'], show: true, - textStyle: { - ...theme.typography[inModal ? 'p0' : 'p2'], - color: theme.colors.gray100, - }, + color: theme.colors.gray100, }, axisTick: { show: true, @@ -164,11 +162,9 @@ export default forwardRef( ]), }, label: { + ...theme.typography[inModal ? 'p0' : 'p2'], + color: theme.colors.gray100, formatter: '{b}', - textStyle: { - ...theme.typography[inModal ? 'p0' : 'p2'], - color: theme.colors.gray100, - }, position: 'left', distance: 10, // 向右偏移位置 show: true, diff --git a/packages/lego/src/img-line/index.tsx b/packages/lego/src/img-line/index.tsx index 410447213d..5ff4a71ab4 100644 --- a/packages/lego/src/img-line/index.tsx +++ b/packages/lego/src/img-line/index.tsx @@ -154,10 +154,8 @@ export default forwardRef( }, }, areaStyle: { - normal: { - color: getAreaColorsByIndex(index), - shadowColor: getColorsByIndex(index), - }, + color: getAreaColorsByIndex(index), + shadowColor: getColorsByIndex(index), }, })), }, diff --git a/packages/lego/src/progress/index.tsx b/packages/lego/src/progress/index.tsx index 104344b652..4869e9e913 100644 --- a/packages/lego/src/progress/index.tsx +++ b/packages/lego/src/progress/index.tsx @@ -99,7 +99,7 @@ export default forwardRef( }, itemStyle: { color: createLinearGradient(theme.colors.primary50, false), - barBorderRadius: 11, + borderRadius: 11, }, }, { @@ -121,7 +121,7 @@ export default forwardRef( }, itemStyle: { color: createLinearGradient(theme.colors.primary100, false), - barBorderRadius: 11, + borderRadius: 11, }, }, { diff --git a/packages/lego/src/radar/index.tsx b/packages/lego/src/radar/index.tsx index b30de7cbbb..f334a6c4f0 100644 --- a/packages/lego/src/radar/index.tsx +++ b/packages/lego/src/radar/index.tsx @@ -108,8 +108,8 @@ export default forwardRef( radar: { center: ['50%', '50%'], radius: '70%', - nameGap: 5, - name: { + axisNameGap: 5, + axisName: { formatter: (_: string, indicator: IndicatorItem) => { return `{a|${indicator.name ?? ''}}\n{a|${indicator.max}${indicator.unit ?? ''}}`; }, diff --git a/packages/lego/src/utils/createStackSeries.ts b/packages/lego/src/utils/createStackSeries.ts index 91f94256d8..f044a5f95e 100644 --- a/packages/lego/src/utils/createStackSeries.ts +++ b/packages/lego/src/utils/createStackSeries.ts @@ -19,10 +19,8 @@ export default function createStackSeries( symbolSize: ['100%', 10], symbolRotate: 0, itemStyle: { - normal: { - borderWidth: 0, - color: chartColor[0][0], - }, + borderWidth: 0, + color: chartColor[0][0], }, animation: false, barMaxWidth: 20,