From d8d53f14cf90ca4e2e434d10003a77b2c094c472 Mon Sep 17 00:00:00 2001 From: JarvisArt <1120886013@qq.com> Date: Mon, 20 Nov 2023 10:18:05 +0800 Subject: [PATCH] chore: Delete the rate useless css (#45927) Co-authored-by: afc163 --- .../__snapshots__/demo-extend.test.ts.snap | 1842 +++++++++-------- .../__tests__/__snapshots__/demo.test.ts.snap | 1744 ++++++++-------- components/rate/demo/clear.tsx | 14 +- components/rate/demo/text.tsx | 8 +- components/rate/style/index.tsx | 7 - 5 files changed, 1834 insertions(+), 1781 deletions(-) diff --git a/components/rate/__tests__/__snapshots__/demo-extend.test.ts.snap b/components/rate/__tests__/__snapshots__/demo-extend.test.ts.snap index ab2f34701140..295864088ca6 100644 --- a/components/rate/__tests__/__snapshots__/demo-extend.test.ts.snap +++ b/components/rate/__tests__/__snapshots__/demo-extend.test.ts.snap @@ -1261,609 +1261,629 @@ exports[`renders components/rate/demo/character-function.tsx extend context corr exports[`renders components/rate/demo/clear.tsx extend context correctly 1`] = ` Array [ - , - - allowClear: true - , + + + + + + + + +
+ + allowClear: true + +
+ ,
, - , - - allowClear: false - , + + + + + + + + +
+ + allowClear: false + +
+ , ] `; @@ -2773,404 +2793,412 @@ exports[`renders components/rate/demo/half.tsx extend context correctly 1`] = ` exports[`renders components/rate/demo/half.tsx extend context correctly 2`] = `[]`; exports[`renders components/rate/demo/text.tsx extend context correctly 1`] = ` - - - + + + +
+
+
+ +
+
+ +
+
- normal - - + + normal + +
+ `; exports[`renders components/rate/demo/text.tsx extend context correctly 2`] = `[]`; diff --git a/components/rate/__tests__/__snapshots__/demo.test.ts.snap b/components/rate/__tests__/__snapshots__/demo.test.ts.snap index 9ac4ea2e1ac8..cbf0d9e53ac7 100644 --- a/components/rate/__tests__/__snapshots__/demo.test.ts.snap +++ b/components/rate/__tests__/__snapshots__/demo.test.ts.snap @@ -1255,609 +1255,629 @@ Array [ exports[`renders components/rate/demo/clear.tsx correctly 1`] = ` Array [ - , - - allowClear: true - , + + + + + + + + +
+ + allowClear: true + +
+ ,
, - , - - allowClear: false - , + + + + + + +
  • +
    +
    + + + +
    +
    + + + +
    +
    +
  • + + +
    + + allowClear: false + +
    + , ] `; @@ -2759,307 +2779,315 @@ exports[`renders components/rate/demo/half.tsx correctly 1`] = ` `; exports[`renders components/rate/demo/text.tsx correctly 1`] = ` - -
      +
      -
    • - -
    • -
    • -
      -
      - - + +
      +
      +
    • +
    • +
      +
      + - - - -
      -
      - - + +
      +
      + - - - -
      -
      -
    • -
    • -
      -
      - - + +
      +
      +
    • +
    • +
      +
      + - - - -
      -
      - - + +
      +
      + - - - -
      -
      -
    • -
    • -
      -
      - - + +
      +
      +
    • +
    • +
      +
      + - - - -
      -
      - - + +
      +
      + - - - -
      -
      -
    • -
    • -
      -
      - - + +
      +
      +
    • +
    • +
      +
      + - - - -
      -
      - - + +
      +
      + - - - -
      -
      -
    • -
    - + + + + + +
    - normal - - + + normal + +
    + `; diff --git a/components/rate/demo/clear.tsx b/components/rate/demo/clear.tsx index 845e31ee12e8..eed37f8e4f0e 100644 --- a/components/rate/demo/clear.tsx +++ b/components/rate/demo/clear.tsx @@ -1,13 +1,17 @@ import React from 'react'; -import { Rate } from 'antd'; +import { Space, Rate } from 'antd'; const App: React.FC = () => ( <> - - allowClear: true + + + allowClear: true +
    - - allowClear: false + + + allowClear: false + ); diff --git a/components/rate/demo/text.tsx b/components/rate/demo/text.tsx index a306d87fd4c7..0122b64821bb 100644 --- a/components/rate/demo/text.tsx +++ b/components/rate/demo/text.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { Rate } from 'antd'; +import { Space, Rate } from 'antd'; const desc = ['terrible', 'bad', 'normal', 'good', 'wonderful']; @@ -7,10 +7,10 @@ const App: React.FC = () => { const [value, setValue] = useState(3); return ( - + - {value ? {desc[value - 1]} : ''} - + {value ? {desc[value - 1]} : ''} + ); }; diff --git a/components/rate/style/index.tsx b/components/rate/style/index.tsx index 25a34ed5ec50..3dd745dd5e4f 100644 --- a/components/rate/style/index.tsx +++ b/components/rate/style/index.tsx @@ -120,13 +120,6 @@ const genRateStyle: GenerateStyle = (token) => { // star styles ...genRateStarStyle(token), - // text styles - [`+ ${componentCls}-text`]: { - display: 'inline-block', - marginInlineStart: token.marginXS, - fontSize: token.fontSize, - }, - // rtl styles ...genRateRtlStyle(token), },