Skip to content

Commit

Permalink
Fix #934 Readonly->ReadOnly changes
Browse files Browse the repository at this point in the history
Fix test
  • Loading branch information
vnbaaij committed Nov 6, 2023
1 parent 565b838 commit 56c3808
Show file tree
Hide file tree
Showing 13 changed files with 80 additions and 23 deletions.
17 changes: 12 additions & 5 deletions Microsoft.FluentUI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,15 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 17.7.33808.371
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{805140F8-CC9F-4C32-BB72-3D67D13BEBA7}"
ProjectSection(SolutionItems) = preProject
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
CONTRIBUTING.md = CONTRIBUTING.md
LICENSE = LICENSE
README.md = README.md
SECURITY.md = SECURITY.md
unit-tests.md = unit-tests.md
WHATSNEW.md = WHATSNEW.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "eng", "eng", "{558E0FEA-094D-4AA4-994A-8ED67ABEDED4}"
EndProject
Expand Down Expand Up @@ -43,13 +52,11 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FluentUI.Demo.Generators",
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B89F06FD-2497-4041-B9EE-EDD889A2C14C}"
ProjectSection(SolutionItems) = preProject
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
CONTRIBUTING.md = CONTRIBUTING.md
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
global.json = global.json
LICENSE = LICENSE
README.md = README.md
SECURITY.md = SECURITY.md
WHATSNEW.md = WHATSNEW.md
NuGet.config = NuGet.config
EndProjectSection
EndProject
Global
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<FluentCheckbox Name="prevent" @bind-Value="_preventScroll">
Prevent scroll
</FluentCheckbox>
<FluentCheckbox Name="hidden" @bind-Value="Hidden" Readonly="true">
<FluentCheckbox Name="hidden" @bind-Value="Hidden" ReadOnly="true">
Hidden
</FluentCheckbox>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<FluentNumberField @bind-Value=value7 Disabled="true" Placeholder="placeholder"></FluentNumberField>

<h4>Read only</h4>
<FluentNumberField @bind-Value=value8 Readonly="true"></FluentNumberField>
<FluentNumberField @bind-Value=value9 Readonly="true" Label="label"></FluentNumberField>
<FluentNumberField @bind-Value=value8 ReadOnly="true"></FluentNumberField>
<FluentNumberField @bind-Value=value9 ReadOnly="true" Label="label"></FluentNumberField>

@code {
int? value1, value2, value3, value4, value5, value6, value7, value8=1, value9=2;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

<!-- Read only -->
<h4>Read only</h4>
<FluentNumberField @bind-Value=value8 Appearance="FluentInputAppearance.Filled" Readonly="true"></FluentNumberField>
<FluentNumberField @bind-Value=value9 Appearance="FluentInputAppearance.Filled" Readonly="true" Label="label"></FluentNumberField>
<FluentNumberField @bind-Value=value8 Appearance="FluentInputAppearance.Filled" ReadOnly="true"></FluentNumberField>
<FluentNumberField @bind-Value=value9 Appearance="FluentInputAppearance.Filled" ReadOnly="true" Label="label"></FluentNumberField>

@code {
int? value1, value2, value3, value4, value5, value6, value7, value8=3, value9=4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@

<!-- Read only -->
<h4>Read only</h4>
<FluentSearch @bind-Value=value Appearance="FluentInputAppearance.Filled" Readonly="true"></FluentSearch>
<FluentSearch @bind-Value=value Appearance="FluentInputAppearance.Filled" Readonly="true">label</FluentSearch>
<FluentSearch @bind-Value=value Appearance="FluentInputAppearance.Filled" ReadOnly="true"></FluentSearch>
<FluentSearch @bind-Value=value Appearance="FluentInputAppearance.Filled" ReadOnly="true">label</FluentSearch>
@code {
string? value;
}
4 changes: 2 additions & 2 deletions examples/Demo/Shared/Pages/Search/Examples/SearchStates.razor
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<FluentSearch @bind-Value=value Disabled="true" Placeholder="placeholder"></FluentSearch>

<h4>Read only</h4>
<FluentSearch @bind-Value=value Readonly="true"></FluentSearch>
<FluentSearch @bind-Value=value Readonly="true">label</FluentSearch>
<FluentSearch @bind-Value=value ReadOnly="true"></FluentSearch>
<FluentSearch @bind-Value=value ReadOnly="true">label</FluentSearch>
@code {
string? value;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</FluentSlider>

<h5 style="margin-top: 60px;">Read Only</h5>
<FluentSlider Min="0" Max="100" Step="5" Readonly="true" @bind-Value=value2>
<FluentSlider Min="0" Max="100" Step="5" ReadOnly="true" @bind-Value=value2>
<FluentSliderLabel Position="0">0</FluentSliderLabel>
<FluentSliderLabel Position="10">10</FluentSliderLabel>
<FluentSliderLabel Position="20">20</FluentSliderLabel>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@

<!-- Read only -->
<h4>Read only</h4>
<FluentTextArea @bind-Value=value8 Appearance="FluentInputAppearance.Filled" Readonly="true">
<FluentTextArea @bind-Value=value8 Appearance="FluentInputAppearance.Filled" ReadOnly="true">
label
</FluentTextArea>
<FluentTextArea @bind-Value=value9 Appearance="FluentInputAppearance.Filled" Readonly="true">
<FluentTextArea @bind-Value=value9 Appearance="FluentInputAppearance.Filled" ReadOnly="true">
label
</FluentTextArea>
@code {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<FluentTextArea @bind-Value=value4 Disabled="true" Placeholder="placeholder"></FluentTextArea>

<h4>Read only</h4>
<FluentTextArea @bind-Value=value5 Readonly="true"></FluentTextArea>
<FluentTextArea @bind-Value=value6 Readonly="true">label</FluentTextArea>
<FluentTextArea @bind-Value=value5 ReadOnly="true"></FluentTextArea>
<FluentTextArea @bind-Value=value6 ReadOnly="true">label</FluentTextArea>

@code {
string? value1, value2, value3, value4, value5 = "Readonly text area", value6 = "Readonly text area";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<FluentTextField @bind-Value=value7 Appearance="FluentInputAppearance.Filled" Disabled="true" Placeholder="placeholder"></FluentTextField>

<h4>Read only</h4>
<FluentTextField @bind-Value=value8 Appearance="FluentInputAppearance.Filled" Readonly="true"></FluentTextField>
<FluentTextField @bind-Value=value9 Appearance="FluentInputAppearance.Filled" Readonly="true">label</FluentTextField>
<FluentTextField @bind-Value=value8 Appearance="FluentInputAppearance.Filled" ReadOnly="true"></FluentTextField>
<FluentTextField @bind-Value=value9 Appearance="FluentInputAppearance.Filled" ReadOnly="true">label</FluentTextField>

@code {
string? value1, value2, value3, value4, value5 = "Disabled", value6 = "Disabled", value7 = "Disabled", value8 = "Readonly", value9 = "Readonly";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<FluentTextField @bind-Value=value4 Disabled="true" Placeholder="placeholder"></FluentTextField>

<h4>Read only</h4>
<FluentTextField @bind-Value=value5 Readonly="true"></FluentTextField>
<FluentTextField @bind-Value=value6 Readonly="true">label</FluentTextField>
<FluentTextField @bind-Value=value5 ReadOnly="true"></FluentTextField>
<FluentTextField @bind-Value=value6 ReadOnly="true">label</FluentTextField>

@code{
string? value1, value2="Disabled", value3="Disabled", value4="Disabled", value5="Read only", value6="Read only";
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

<fluent-dialog id="xxx" class="fluent-dialog-main prevent-scroll" style="position: absolute; z-index: 999; top: 50%; left: 50%; --dialog-width: 500px; --dialog-height: 200px;" modal="true" trap-focus="true" blazor:ondialogdismiss="1" b-nhhazhtmim="" blazor:elementreference="">
<div class="stack-horizontal fluent-dialog-header" style="justify-content: start; align-items: start; column-gap: 10px; row-gap: 10px; width: 100%;" b-rm53amj1yp="">
<div style="width: 100%;">
<h4 typo="pane-header" class="fluent-typography" b-r6kodva1vo="">Sample title</h4>
</div>
<fluent-button type="button" aria-label="Close" title="Close" appearance="stealth" blazor:onclick="6" b-ai83c66izh="" blazor:elementreference="xxx">
<svg style="width: 16px; fill: var(--accent-fill-rest);" focusable="false" viewBox="0 0 24 24" aria-hidden="true" blazor:onclick="8">
<path d="m4.4 4.55.07-.08a.75.75 0 0 1 .98-.07l.08.07L12 10.94l6.47-6.47a.75.75 0 1 1 1.06 1.06L13.06 12l6.47 6.47c.27.27.3.68.07.98l-.07.08a.75.75 0 0 1-.98.07l-.08-.07L12 13.06l-6.47 6.47a.75.75 0 0 1-1.06-1.06L10.94 12 4.47 5.53a.75.75 0 0 1-.07-.98l.07-.08-.07.08Z"></path>
</svg>
</fluent-button>
</div>
<div class="stack-horizontal fluent-dialog-footer" style="justify-content: end; align-items: end; column-gap: 10px; row-gap: 10px; width: 100%;" b-rm53amj1yp="">
<fluent-button type="button" appearance="accent" blazor:onclick="7" b-ai83c66izh="" blazor:elementreference="xxx">Close</fluent-button>
</div>
<div class="fluent-dialog-body">
My body
</div>
</fluent-dialog>
31 changes: 31 additions & 0 deletions tests/Core/Dialog/TestDialogHeaderFooter.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@implements IDialogContentComponent

@* Header *@
<FluentDialogHeader ShowDismiss="true">
<FluentLabel Typo="Typography.PaneHeader">
@Dialog?.Instance?.Parameters?.Title
</FluentLabel>
</FluentDialogHeader>

@* Footer *@
<FluentDialogFooter>
<FluentButton Appearance="Appearance.Accent" OnClick="@SaveAsync">Close</FluentButton>
</FluentDialogFooter>

@* Body *@
<FluentDialogBody>
My body
</FluentDialogBody>

@code {
[CascadingParameter]
public FluentDialog? Dialog { get; set; }

private async Task SaveAsync()
{
if (Dialog is not null)
{
await Dialog.CloseAsync();
}
}
}

0 comments on commit 56c3808

Please sign in to comment.