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: Add Timeline.Item.position (#16148) #16193
Conversation
Deploy preview for ant-design ready! Built with commit 52a1370 |
components/timeline/Timeline.tsx
Outdated
@@ -12,7 +12,7 @@ export interface TimelineProps { | |||
pendingDot?: React.ReactNode; | |||
style?: React.CSSProperties; | |||
reverse?: boolean; | |||
mode?: 'left' | 'alternate' | 'right'; | |||
mode?: 'left' | 'alternate' | 'right' | 'customize'; |
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.
No need to add mode="customize"
, just follow postion of item in higher priority.
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.
That's good idea
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.
I think the mode shuld be in higher priority.
fc4f12b
to
e28570b
Compare
You should pull and rebase |
I did rebase, I'll try again tonight. It is necessary to rewrite history(Squash |
Not necessary but better~ |
Thank you very much. |
e28570b
to
80b2618
Compare
Codecov Report
@@ Coverage Diff @@
## feature #16193 +/- ##
===========================================
- Coverage 95.29% 95.25% -0.05%
===========================================
Files 255 255
Lines 6824 6826 +2
Branches 1972 1949 -23
===========================================
- Hits 6503 6502 -1
- Misses 320 323 +3
Partials 1 1
Continue to review full report at Codecov.
|
components/timeline/TimelineItem.tsx
Outdated
@@ -58,6 +60,7 @@ const TimelineItem: React.SFC<TimeLineItemProps> = props => ( | |||
TimelineItem.defaultProps = { | |||
color: 'blue', | |||
pending: false, | |||
position: 'left', |
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.
should follow <Timeline mode="xxx">
, don't set in defaultProps.
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.
After the mode is set, the position will be invalid.
80b2618
to
a8bebf3
Compare
components/timeline/Timeline.tsx
Outdated
: '', | ||
: ele.props.position === 'right' | ||
? `${prefixCls}-item-right` | ||
: `${prefixCls}-item-left`, |
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.
这段代码原本就挺看不懂,现在更难懂了。抽出来吧。
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.
I think so
fb86a1c
to
7b563b1
Compare
@zombieJ I have modified. Is there other problem? |
https://deploy-preview-16193--ant-design.netlify.com/components/timeline-cn/#header |
Yes, I have to change the style to accommodate that you can set the |
We should not break origin behavior. |
Yeah, I understand, so I started to consider adding a mode I think you have to add a new mode except you have a good plan |
We can use |
Haha, nice, I also consider it, but feel a bit strange, so I add a I'll be commit tonight!! |
7b563b1
to
19c3fef
Compare
I've updated, if you have time, please review it. Thank you! |
components/timeline/index.en-US.md
Outdated
@@ -41,3 +41,4 @@ Node of timeline | |||
| -------- | ----------- | ---- | ------- | | |||
| color | Set the circle's color to `blue`, `red`, `green` or other custom colors | string | `blue` | | |||
| dot | Customize timeline dot | string\|ReactNode | - | | |||
| position | Customize node position | `left` \| `right` | - | |
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.
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.
OK, I'll update tonight
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.
version
should be 3.16.6
?
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.
feature branch always released with minor version. Use 3.17.0
instead.
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.
Thank you
* use ul in list * update snapshot * update comment * feat: TreeSelect support `showSearch` in multiple mode (#15933) * update rc-tree-select * typo * update desc & snapshot * update desc & snapshot * check default showSearch * feat: table customizing variable (#15971) * feat: added table selected row color variable * fix: @table-selected-row-color default is inherit * feat: Upload support customize previewFile (#15984) * support preview file * use promise * dealy load * use canvas of render * use domHook of test * update demo * add snapshot * update types * update testcase * feat: form customizing variables (#15954) * fix: added styling form input background-color * feat: added '@form-warning-input-bg' variable * feat: added '@form-error-input-bg' variable * use li wrap with comment * feat: Support append theme less file with less-variable (#16118) * add override * add override support * update doc * feat: dropdown support set right icon * docs: update doc of dropdown component * style: format dropdown-button.md * test: update updateSnapshot * style: format dropdown-button.md * test: update updateSnapshot * test: update updateSnapshot * style: change style of dropdown-button demo * fix: fix document table order * feat: Support SkeletonAvatarProps.size accept number (#16078) (#16128) * chore:update style of demo * feat: Notification functions accept top, bottom and getContainer as arguments * drawer: add afterVisibleChange * rm onVisibleChange * update * feat: 🇭🇷 hr_HR locale (#16258) * Added Croatian locale * fixed lint error * ✅ Add test cases for hr_HR * 📝 update i18n documentation * feat: add `htmlFor` in Form.Item (#16278) * add htmlFor in Form.Item * update doc * feat: Button support `link` type (#16289) close #15892 * feat: Add Timeline.Item.position (#16148) (#16193) * fix: Timeline.pendingDot interface documentation there is a small problem (#16177) * feat: Add Timeline.Item.position (#16148) * doc: add version infomation for Timeline.Item.position * refactor: Update Tree & TreeSelect deps (#16330) * use CSSMotion * update snapshot * feat: Collapse support `expandIconPosition` (#16365) * update doc * support expandIconPosition * update snapshot * feat: Breadcrumb support DropDown (#16315) * breadcrumbs support drop down menu * update doc * add require less * fix test * fix md doc * less code * fix style warning * update snap * add children render test * feat: TreeNode support checkable * feat: add optional to support top and left slick dots (#16186) (#16225) * add optional to support top and left slick dots * update carousel snapshot * Update doc, add placement demo * update carousel placement demo snapshots * rename dots placement to position * update vertical as deprecated * rename dotsPosition to dotPosition * refine code * add warning testcase for vertical * remove unused warning * update expression * Additional test case for dotPosition * refactor: Upgrade `rc-tree-select` to support pure React motion (#16402) * upgrade `rc-tree-select` * update snapshot * 3.17.0 changelog * fix warning * fix review warning
🤔 This is a ...
👻 What's the background?
close #16177 and #16148
💡 Solution
reuse 'alternate' less
📝 Changelog
add Timeline.Item.position
☑️ Self Check before Merge
View rendered components/timeline/index.en-US.md
View rendered components/timeline/index.zh-CN.md