-
Notifications
You must be signed in to change notification settings - Fork 401
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace fluent-label with HTML label (#3335)
- Loading branch information
Showing
11 changed files
with
80 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# FluentField | ||
|
||
The `FluentField` component is a wrapper around a input component that add a label and a message to the input. | ||
|
||
## Usage | ||
|
||
You can use it by enclosing your component in a FluentField like this. | ||
You need to specify the `ForId`, `Class` and `Style` properties for the component to work correctly. | ||
|
||
The `@Id` property does not have to be defined when you create your component, | ||
it is automatically generated by the `FluentField` component. | ||
|
||
```razor | ||
<FluentField InputComponent="@this" ForId="@Id" Class="@ClassValue" Style="@StyleValue"> | ||
<!-- Your input component here --> | ||
</FluentField> | ||
``` | ||
|
||
As the `ClassValue` and `StyleValue` attributes are added to the FluentField, you don't need to add them to your input component. | ||
|
||
## Example | ||
|
||
See FluentTextField for an example. |
6 changes: 3 additions & 3 deletions
6
tests/Core/Components/Field/FluentFieldTests.FluentField_Default.verified.razor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
<fluent-field label-position="above" class="my-3"> | ||
<fluent-label slot="label" for="xxx">My label | ||
</fluent-label> | ||
<label slot="label" for="xxx">My label | ||
</label> | ||
<div slot="input" id="xxx">Field content</div> | ||
<fluent-text as="span" size="200" slot="message">My message</fluent-text> | ||
</fluent-field> | ||
</fluent-field> |
6 changes: 3 additions & 3 deletions
6
tests/Core/Components/Field/FluentFieldTests.FluentField_DefaultTemplate.verified.razor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
|
||
<fluent-field label-position="above" class="my-3"> | ||
<fluent-label slot="label" for="xxx"> | ||
<label slot="label" for="xxx"> | ||
My | ||
<b>label</b> | ||
</fluent-label> | ||
</label> | ||
<div slot="input" id="xxx"> | ||
Field content | ||
</div> | ||
<fluent-text as="span" size="200" slot="message"> | ||
My | ||
<i>message</i> | ||
</fluent-text> | ||
</fluent-field> | ||
</fluent-field> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
tests/Core/Components/List/FluentSelectTests.FluentSelect_Label.verified.razor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ore/Components/TextInput/FluentTextInputTests.FluentInputText_Default.verified.razor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
<fluent-field id="xxx" label-position="above" class="my-3"> | ||
<fluent-label id="xxx" slot="label" for="xxx"> | ||
<label id="xxx" slot="label" for="xxx"> | ||
My Label | ||
</fluent-label> | ||
</label> | ||
<fluent-text-input appearance="outline" autofocus="" aria-label="My aria label" id="xxx" name="xxx" placeholder="My help" slot="input" value="My Value" blazor:onfocusout="1" blazor:onchange="2" blazor:oninput="3" blazor:elementreference="xxx"></fluent-text-input> | ||
</fluent-field> |
4 changes: 2 additions & 2 deletions
4
...mponents/TextInput/FluentTextInputTests.FluentInputText_LabelTemplate.verified.razor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
|
||
<fluent-field id="xxx" label-position="above" class="my-3"> | ||
<fluent-label id="xxx" slot="label" for="xxx"> | ||
<label id="xxx" slot="label" for="xxx"> | ||
<div style="font-weight: bold;">My label</div> | ||
</fluent-label> | ||
</label> | ||
<fluent-text-input appearance="outline" id="xxx" slot="input" blazor:onfocusout="1" blazor:onchange="2" blazor:oninput="3" blazor:elementreference="xxx"></fluent-text-input> | ||
</fluent-field> |