Skip to content

Commit

Permalink
Merge pull request #87 from ofaruk84/master
Browse files Browse the repository at this point in the history
Group with Context menu implemented
  • Loading branch information
emncnozge authored Sep 20, 2024
2 parents 5790cc2 + 1e5fa1e commit 529b2ff
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
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

0 comments on commit 529b2ff

Please sign in to comment.