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

Group with Context menu implemented #87

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -904,6 +904,18 @@ private void DrawerButtonClicked()
</Group>
```

### Group with Context
```razor
<Group Id="group" Header="Main Header" SubHeader="Subheader">
<Dropdown Id="dropdown" IsForGroupContext="true">
<DropdownItem Label="Item 1"></DropdownItem>
<DropdownItem Label="Item 1"></DropdownItem>
</Dropdown>
<GroupItem Id="groupitem1" Text="Example text 1"></GroupItem>
<GroupItem Id="groupitem2" Text="Example text 2"></GroupItem>
</Group>
```

## HTML table

```razor
Expand Down
3 changes: 2 additions & 1 deletion SiemensIXBlazor.Tests/Dropdown/DropdownTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ public void ComponentRendersWithCorrectProperties()
.Add(p => p.Placement, "bottom-start")
.Add(p => p.PositioningStrategy, "fixed")
.Add(p => p.Show, false)
.Add(p => p.IsForGroupContext, true)
.Add(p => p.SuppressAutomaticPlacement, false)
.Add(p => p.Trigger, "testTrigger")
.Add(p => p.ChildContent, (RenderFragment)(builder => builder.AddMarkupContent(0, "Test content"))));

// Assert
cut.MarkupMatches(
"<ix-dropdown id=\"testId\" trigger=\"testTrigger\" anchor=\"testAnchor\" close-behavior=\"both\" header=\"testHeader\" placement=\"bottom-start\" positioning-strategy=\"fixed\">Test content</ix-dropdown>");
"<ix-dropdown id=\"testId\" trigger=\"testTrigger\" anchor=\"testAnchor\" slot=\"dropdown\" close-behavior=\"both\" header=\"testHeader\" placement=\"bottom-start\" positioning-strategy=\"fixed\">Test content</ix-dropdown>");
}

[Fact]
Expand Down
1 change: 1 addition & 0 deletions SiemensIXBlazor/Components/Dropdown/Dropdown.razor
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ placement="@Placement"
positioning-strategy="@PositioningStrategy"
suppress-automatic-placement="@SuppressAutomaticPlacement"
show="@Show"
slot="@(IsForGroupContext ? "dropdown" : string.Empty)"
style="@Style"
class="@Class">
@ChildContent
Expand Down
2 changes: 2 additions & 0 deletions SiemensIXBlazor/Components/Dropdown/Dropdown.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public partial class Dropdown
[Parameter]
public bool SuppressAutomaticPlacement { get; set; } = false;
[Parameter]
public bool IsForGroupContext { get; set; } = false;
[Parameter]
public string? Trigger { get; set; }
[Parameter]
public RenderFragment? ChildContent { get; set; }
Expand Down
Loading