Closed ArgoZhang closed 3 days ago
This PR redesigns the TreeView component's DOM structure by flattening the nested ul/li hierarchy into a simpler div-based layout. The changes improve the component's structure while maintaining existing functionality through updated selectors and styling.
classDiagram
class TreeView {
+bool IsDisabled
+bool CanExpandWhenDisabled
+List~TreeViewItem~ Rows
+RenderFragment~TreeViewItem~ RenderTreeRow
+string? GetContentClassString(TreeViewItem item)
+bool CanTriggerClickNode(TreeViewItem item)
+Task OnClick(TreeViewItem item)
}
class TreeViewItem {
+bool IsDisabled
+bool HasChildren
+List~TreeViewItem~ Items
+TreeViewItem Parent
}
TreeView o-- TreeViewItem
note for TreeView "Redesigned DOM structure with div-based layout"
classDiagram
class TreeViewCSS {
+--bb-tree-padding
+--bb-tree-margin
+--bb-tree-padding-left
+--bb-tree-item-margin
+--bb-tree-icon-width
+--bb-tree-check-margin
+--bb-tree-disabled-opacity
+--bb-tree-item-active-color
+--bb-tree-item-active-bg
+--bb-tree-item-hover-bg
}
note for TreeViewCSS "Updated CSS variables and structure for TreeView"
Change | Details | Files |
---|---|---|
Simplified DOM structure by removing nested ul/li elements |
|
src/BootstrapBlazor/Components/TreeView/TreeView.razor src/BootstrapBlazor/Components/TreeView/TreeView.razor.scss src/BootstrapBlazor/wwwroot/scss/theme/bootstrapblazor.scss |
Improved test structure and assertions |
|
test/UnitTest/Components/TreeViewTest.cs test/UnitTest/Components/SelectTreeTest.cs |
Enhanced component behavior and state management |
|
src/BootstrapBlazor/Components/TreeView/TreeView.razor.cs src/BootstrapBlazor/Components/Checkbox/Checkbox.razor.js src/BootstrapBlazor/Misc/ExpandableNodeCache.cs |
Issue | Objective | Addressed | Explanation |
---|---|---|---|
#4695 | Redesign TreeView DOM structure to improve organization and maintainability | ✅ |
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 100.00%. Comparing base (
4673c39
) to head (661b584
). Report is 1 commits behind head on main.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
redesign TreeView dom structure
Summary of the changes (Less than 80 chars)
简单描述你更改了什么, 不超过80个字符;如果有关联 Issue 请在下方填写相关编号
Description
fixes #4695
Regression?
[If yes, specify the version the behavior has regressed from]
[是否影响老版本]
Risk
[Justify the selection above]
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
⚠️ Please check all items below before review. ⚠️
Summary by Sourcery
Redesign the TreeView component's DOM structure to enhance its layout and styling, and update the corresponding unit tests to reflect these changes.
Enhancements:
Tests: