Skip to content
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

Refactor Vertical property on Flex to Direction #4410

Merged

Conversation

pathartl
Copy link
Contributor

@pathartl pathartl commented Jan 7, 2025

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • Bundle size optimization
  • Performance optimization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

Refactored the Vertical attribute to use FlexDirection, similar to Space.Direction. This also allows for expansion in the future to support other flex-direction CSS values.

📝 Changelog

Replaced Flex.Vertical with Flex.Direction

Language Changelog
🇺🇸 English
🇨🇳 Chinese

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Changelog is provided or not needed

Copy link

github-actions bot commented Jan 7, 2025

Copy link

Walkthrough

This pull request refactors the Vertical property in the Flex component to use a new FlexDirection enum, allowing for more flexible direction settings. The change is aimed at aligning with the Space.Direction property and facilitating future expansions to support other CSS flex-direction values.

Changes

Files Summary
components/flex/Flex.razor.cs Replaced Vertical property with Direction property using FlexDirection enum. Marked Vertical as obsolete.
components/flex/FlexDirection.cs Introduced a new FlexDirection enum with Horizontal and Vertical values.
site/AntDesign.Docs/Demos/Components/Flex/demo/*.razor Updated demo files to use Direction instead of Vertical.
site/AntDesign.Docs/Demos/Components/Flex/doc/index.en-US.md Updated documentation to reflect the change from Vertical to Direction.

@@ -34,7 +36,25 @@ public partial class Flex : AntDomComponentBase
/// <summary>
/// Is direction of the flex vertical, use flex-direction: column
/// </summary>
[Parameter] public bool Vertical { get; set; }
[Obsolete("Use FlexDirection instead")]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Vertical property is marked as obsolete, which is a good practice to inform users about the transition to FlexDirection. Ensure that this change is well-documented in the release notes to prevent any confusion.

@ElderJames
Copy link
Member

Thanks for contribution @pathartl . Please change the target to feature branch for adding new features. We will release the bug fixed branch(master) first.

@ElderJames ElderJames merged commit 50ef47c into ant-design-blazor:master Feb 1, 2025
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants