-
Notifications
You must be signed in to change notification settings - Fork 296
feat(rate): v14 #2797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(rate): v14 #2797
Changes from all commits
94c8cbf
0e45a54
985c08d
5114094
2bd65c7
77be6a5
2064c28
516f5e4
056cb64
49a7f24
9dcafdb
87a5190
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html | ||
|
|
||
| exports[`size test 1`] = ` | ||
| <div> | ||
| <div | ||
| class="nut-rate" | ||
| > | ||
| <div | ||
| class="nut-rate-item nut-rate-item-large" | ||
| > | ||
| <div | ||
| class="nut-rate-item-icon nut-rate-item-icon-disabled" | ||
| > | ||
| <svg | ||
| aria-labelledby="StarFill" | ||
| class="nut-icon nut-icon-StarFill " | ||
| role="presentation" | ||
| viewBox="0 0 1024 1024" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| > | ||
| <path | ||
| d="m908.1 353.1-253.9-36.9L540.7 86.1c-3.1-6.3-8.2-11.4-14.5-14.5-15.8-7.8-35-1.3-42.9 14.5L369.8 316.2l-253.9 36.9c-7 1-13.4 4.3-18.3 9.3-12.3 12.7-12.1 32.9.6 45.3l183.7 179.1-43.4 252.9c-1.2 6.9-.1 14.1 3.2 20.3 8.2 15.6 27.6 21.7 43.2 13.4L512 754l227.1 119.4c6.2 3.3 13.4 4.4 20.3 3.2 17.4-3 29.1-19.5 26.1-36.9l-43.4-252.9 183.7-179.1c5-4.9 8.3-11.3 9.3-18.3 2.7-17.5-9.5-33.7-27-36.3" | ||
| fill="currentColor" | ||
| fill-opacity="0.9" | ||
| /> | ||
| </svg> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| `; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,13 @@ | ||
| import React from 'react' | ||
| import { Rate } from '@nutui/nutui-react' | ||
| import { Rate, Space } from '@nutui/nutui-react' | ||
|
|
||
| const Demo1 = () => { | ||
| return <Rate defaultValue={3} /> | ||
| return ( | ||
| <Space direction="vertical"> | ||
| <Rate defaultValue={3} size="large" /> | ||
| <Rate defaultValue={3} /> | ||
| <Rate defaultValue={3} size="small" /> | ||
| </Space> | ||
| ) | ||
| } | ||
| export default Demo1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,13 @@ | ||
| import React from 'react' | ||
| import { Rate } from '@nutui/nutui-react-taro' | ||
| import { Rate, Space } from '@nutui/nutui-react-taro' | ||
|
|
||
| const Demo1 = () => { | ||
| return <Rate defaultValue={3} /> | ||
| return ( | ||
| <Space direction="vertical"> | ||
| <Rate defaultValue={3} size="large" /> | ||
| <Rate defaultValue={3} /> | ||
| <Rate defaultValue={3} size="small" /> | ||
| </Space> | ||
| ) | ||
| } | ||
| export default Demo1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import { Rate } from './rate.taro' | ||
|
|
||
| export type { RateProps } from './rate.taro' | ||
| export type { RateSize, RateProps } from './types' | ||
| export default Rate |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import { Rate } from './rate' | ||
|
|
||
| export type { RateProps } from './rate' | ||
| export type { RateSize, RateProps } from './types' | ||
| export default Rate |
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -16,13 +16,9 @@ | |||||||||||||
|
|
||||||||||||||
| &-item { | ||||||||||||||
| display: flex; | ||||||||||||||
| align-items: center; | ||||||||||||||
| flex-shrink: 0; | ||||||||||||||
| position: relative; | ||||||||||||||
| margin-left: $rate-item-margin; | ||||||||||||||
|
|
||||||||||||||
| &:first-child { | ||||||||||||||
| margin-left: 0; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-half { | ||||||||||||||
| position: absolute; | ||||||||||||||
|
|
@@ -37,8 +33,41 @@ | |||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-normal { | ||||||||||||||
| margin-left: $rate-item-margin; | ||||||||||||||
| .nut-icon { | ||||||||||||||
| height: $rate-icon-size; | ||||||||||||||
| width: $rate-icon-size; | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-large { | ||||||||||||||
| margin-left: calc($rate-item-margin * 2); | ||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 计算逻辑视觉认可吗,从规范表述上可以套用这个计算逻辑,但是不是明确过这样的计算逻辑? |
||||||||||||||
| .nut-icon { | ||||||||||||||
| height: calc($rate-icon-size + 8px); | ||||||||||||||
| width: calc($rate-icon-size + 8px); | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-small { | ||||||||||||||
| margin-left: calc($rate-item-margin / 2); | ||||||||||||||
| .nut-icon { | ||||||||||||||
| height: calc($rate-icon-size - 4px); | ||||||||||||||
| width: calc($rate-icon-size - 4px); | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-normal, | ||||||||||||||
| &-large, | ||||||||||||||
| &-small { | ||||||||||||||
| &:first-child { | ||||||||||||||
| margin-left: 0; | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-icon { | ||||||||||||||
| display: flex; | ||||||||||||||
| align-items: center; | ||||||||||||||
| cursor: pointer; | ||||||||||||||
|
|
||||||||||||||
| .nut-icon { | ||||||||||||||
|
|
@@ -66,18 +95,59 @@ | |||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-score { | ||||||||||||||
| display: inline-flex; | ||||||||||||||
| align-items: center; | ||||||||||||||
| color: $rate-font-color; | ||||||||||||||
| font-family: 'JD'; | ||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 关于京东字体的事情,我觉得我们需要再看看,留作待办。 |
||||||||||||||
| line-height: 1; | ||||||||||||||
|
|
||||||||||||||
| &-normal { | ||||||||||||||
| padding-left: $rate-item-margin; | ||||||||||||||
| font-size: $rate-font-size; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-large { | ||||||||||||||
| font-size: calc($rate-font-size + 6px); | ||||||||||||||
| padding-left: calc($rate-item-margin * 2); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-small { | ||||||||||||||
| font-size: calc($rate-font-size - 2px); | ||||||||||||||
| padding-left: calc($rate-item-margin / 2); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-disabled { | ||||||||||||||
| color: $rate-icon-inactive-color; | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| [dir='rtl'] .nut-rate, | ||||||||||||||
| .nut-rtl .nut-rate { | ||||||||||||||
| &-item { | ||||||||||||||
| margin-right: 0; | ||||||||||||||
| margin-left: $rate-item-margin; | ||||||||||||||
| margin-left: 0; | ||||||||||||||
| &:first-child { | ||||||||||||||
| margin-right: 0; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-normal { | ||||||||||||||
| margin-right: $rate-item-margin; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-large { | ||||||||||||||
| margin-right: calc($rate-item-margin * 2); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-small { | ||||||||||||||
| margin-right: calc($rate-item-margin - 2px); | ||||||||||||||
| } | ||||||||||||||
|
Comment on lines
+143
to
+145
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 修正 RTL 模式下的间距计算 RTL 模式下的 small 尺寸间距计算与 LTR 模式不一致:
这可能会导致布局不对称。 &-small {
- margin-right: calc($rate-item-margin - 2px);
+ margin-right: calc($rate-item-margin / 2);
}📝 Committable suggestion
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| &:last-child { | ||||||||||||||
| margin-right: 0; | ||||||||||||||
| margin-left: 0; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-half { | ||||||||||||||
| left: auto; | ||||||||||||||
| right: 0; | ||||||||||||||
|
|
@@ -95,4 +165,20 @@ | |||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-score { | ||||||||||||||
| padding-left: 0; | ||||||||||||||
|
|
||||||||||||||
| &-large { | ||||||||||||||
| padding-right: calc($rate-item-margin * 2); | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-normal { | ||||||||||||||
| padding-right: $rate-item-margin; | ||||||||||||||
| } | ||||||||||||||
|
|
||||||||||||||
| &-small { | ||||||||||||||
| padding-right: calc($rate-item-margin - 2px); | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Based on all the gathered information, I can now provide the final response:
需要补充 v14 版本的文档说明
经过验证,以下组件已在 config.json 中标记为 v14 版本:
但是这些组件的文档中都缺少相应的版本更新说明。建议:
🔗 Analysis chain
请确保版本标记的一致性
多个组件被标记为 v14 版本。建议:
Also applies to: 993-994
Let me verify the documentation paths first.
Let me check the component names associated with these v14 tags.
Let me check the component names and their documentation structure.
Let me check the content of the documentation files for version information.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
Length of output: 1726
Script:
Length of output: 517
Script:
Length of output: 3024
Script:
Length of output: 7805
Script:
Length of output: 1470