Skip to content

Commit 4cc502d

Browse files
committed
apply suggestions
1 parent 2d62c84 commit 4cc502d

File tree

1 file changed

+54
-53
lines changed

1 file changed

+54
-53
lines changed

knowledge-base/in-place-editor.md

Lines changed: 54 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -34,23 +34,23 @@ The sample below uses an algorithm which toggles between read-only UI and an edi
3434

3535
### How It Works
3636

37-
* `TelerikInPlaceEditor` is a generic component. It supports strings and most value types, including nullable types.
37+
* `InPlaceEditor` is a generic component. It supports strings and most value types, including nullable types.
3838
* Initially, the component renders a clickable [Button]({%slug components/button/overview%}) with [`Clear` `FillMode`]({%slug button-appearance%}) that shows the current `Value`.
3939
* The component detects the type of its `Value` and renders the appropriate Telerik editor:
40-
* [CheckBox]({%slug checkbox-overview%}}) for `bool`
41-
* [DatePicker]({%slug components/datepicker/overview%}}) for `DateTime` and `DateOnly`
42-
* [NumericTextBox]({%slug components/numerictextbox/overview%}}) for `int`, `double`, `decimal`, and the other numeric types
43-
* [TextBox]({%slug components/textbox/overview%}}) for `string`
44-
* [TimePicker]({%slug components/timepicker/overview%}}) for `TimeOnly`
40+
* [CheckBox]({%slug checkbox-overview%}) for `bool`
41+
* [DatePicker]({%slug components/datepicker/overview%}) for `DateTime` and `DateOnly`
42+
* [NumericTextBox]({%slug components/numerictextbox/overview%}) for `int`, `double`, `decimal`, and the other numeric types
43+
* [TextBox]({%slug components/textbox/overview%}) for `string`
44+
* [TimePicker]({%slug components/timepicker/overview%}) for `TimeOnly`
4545
* If the `Width` parameter is not set, the In-Place Editor approximately matches the width of its editor components to the current `Value` length. The component uses a `monospace` `font-family` to make this easier.
4646
* The component features a `ReadOnly` mode that controls the editability, for example, depending on user permissions.
4747
* The `DisplayFormat` parameter affects the `Value` consistently in both read mode and edit mode.
4848
* The `Placeholder` parameter provides a helper label that will show when the `Value` is `null` or empty.
49-
* The `ShowIcons` parameter controls the visibility of optional [SVG Icons]({%slug common-features-icons%}}#svgicon-component). The icons hint users about the ability to edit the component `Value` or provide clickable **Save** and **Cancel** commands in edit mode. The parameter is of type `InPlaceEditorShowIcons`, which is a custom enum and must be imported in both `TelerikInPlaceEditor.razor` and all `.razor` files that use `TelerikInPlaceEditor`.
49+
* The `ShowIcons` parameter controls the visibility of optional [SVG Icons]({%slug common-features-icons%}}#svgicon-component). The icons hint users about the ability to edit the component `Value` or provide clickable **Save** and **Cancel** commands in edit mode. The parameter is of type `InPlaceEditorShowIcons`, which is a custom enum and must be imported in both `InPlaceEditor.razor` and all `.razor` files that use `InPlaceEditor`.
5050
* The `Class` parameter allows you to apply custom styles.
5151
* The `Title` parameter allows you to show a tooltip hint on read mode.
5252
* To [see invalid state styling and validation messages in Forms]({%slug inputs-kb-validate-child-component%}), pass the respective `ValueExpression` values to the `InPlaceEditor` component.
53-
* `TelerikInPlaceEditor.razor.css` is a <a href="https://learn.microsoft.com/en-us/aspnet/core/blazor/components/css-isolation" target="_blank">CSS isolation file</a>. It depends on a `YourAppName.styles.css` file in `App.razor` to load.
53+
* `InPlaceEditor.razor.css` is a <a href="https://learn.microsoft.com/en-us/aspnet/core/blazor/components/css-isolation" target="_blank">CSS isolation file</a>. It depends on a `YourAppName.styles.css` file in `App.razor` to load.
5454

5555
### Example
5656

@@ -69,35 +69,36 @@ Replace `YourAppName` with the actual root namespace of your app.
6969
<h1>InPlaceEditor Component</h1>
7070
7171
<p>
72-
This in-place editor component works with value types, including nullables
72+
This in-place editor component works with strings and value types, including nullables, for example:
7373
74-
<TelerikInPlaceEditor @bind-Value="@NumericValue"
75-
DisplayFormat="C2"
76-
Placeholder="Enter Number..." />
74+
<InPlaceEditor @bind-Value="@NumericValue"
75+
DisplayFormat="C2"
76+
Placeholder="Enter Number..." />
7777
78-
The component supports custom styles
78+
The component supports custom styles and responsive textbox width that depends on the value:
7979
80-
<TelerikInPlaceEditor @bind-Value="@StringValue"
81-
Class="primary-color"
82-
ShowIcons="@InPlaceEditorShowIcons.Hover" />
80+
<InPlaceEditor @bind-Value="@StringValue"
81+
Class="primary-color"
82+
ShowIcons="@InPlaceEditorShowIcons.Hover" />
8383
84-
and the icon can be visible only on hover
84+
The icon can be visible only on hover:
8585
86-
<TelerikInPlaceEditor @bind-Value="@DateValue"
87-
Class="primary-color"
88-
DisplayFormat="d"
89-
ShowIcons="@InPlaceEditorShowIcons.Hover" />
86+
<InPlaceEditor @bind-Value="@DateValue"
87+
Class="primary-color"
88+
DisplayFormat="d"
89+
ShowIcons="@InPlaceEditorShowIcons.Hover" />
9090
91-
(unless the value is empty) or never
91+
(unless the value is empty) or never:
9292
93-
<TelerikInPlaceEditor @bind-Value="@TimeValue"
94-
DisplayFormat="HH:mm"
95-
ShowIcons="@InPlaceEditorShowIcons.Never" />
93+
<InPlaceEditor @bind-Value="@TimeValue"
94+
Class="primary-color"
95+
DisplayFormat="HH:mm"
96+
ShowIcons="@InPlaceEditorShowIcons.Never" />
9697
97-
You can even edit booleans
98+
You can even edit booleans:
9899
99-
<TelerikInPlaceEditor @bind-Value="@BoolValue"
100-
Class="primary-color" />
100+
<InPlaceEditor @bind-Value="@BoolValue"
101+
Class="primary-color" />
101102
</p>
102103
103104
<h2>Configuration</h2>
@@ -146,13 +147,13 @@ Replace `YourAppName` with the actual root namespace of your app.
146147
147148
<p>
148149
In Place Editor:
149-
<TelerikInPlaceEditor @bind-Value="@InPlaceEditorValue"
150-
Class="primary-color"
151-
Placeholder="@InPlaceEditorPlaceholder"
152-
ReadOnly="@InPlaceEditorReadOnly"
153-
ShowIcons="@InPlaceEditorShowIcons"
154-
Title="@InPlaceEditorTitle"
155-
Width="@( InPlaceEditorWidth.HasValue ? $"{InPlaceEditorWidth}px" : null )" />
150+
<InPlaceEditor @bind-Value="@InPlaceEditorValue"
151+
Class="primary-color"
152+
Placeholder="@InPlaceEditorPlaceholder"
153+
ReadOnly="@InPlaceEditorReadOnly"
154+
ShowIcons="@InPlaceEditorShowIcons"
155+
Title="@InPlaceEditorTitle"
156+
Width="@( InPlaceEditorWidth.HasValue ? $"{InPlaceEditorWidth}px" : null )" />
156157
</p>
157158
158159
<h2>Form Validation</h2>
@@ -165,22 +166,22 @@ Replace `YourAppName` with the actual root namespace of your app.
165166
<FormItem Field="@nameof(Person.Name)">
166167
<Template>
167168
Name:
168-
<TelerikInPlaceEditor Value="@Employee.Name"
169-
ValueChanged="@( (string newValue) => Employee.Name = newValue )"
170-
ValueExpression="@( () => Employee.Name )"
171-
Placeholder="Enter Name..." />
169+
<InPlaceEditor Value="@Employee.Name"
170+
ValueChanged="@( (string newValue) => Employee.Name = newValue )"
171+
ValueExpression="@( () => Employee.Name )"
172+
Placeholder="Enter Name..." />
172173
<TelerikValidationMessage For="@( () => Employee.Name )" />
173174
</Template>
174175
</FormItem>
175176
<FormItem Field="@nameof(Person.BirthDate)">
176177
<Template>
177178
Hire Date:
178-
<TelerikInPlaceEditor Value="@Employee.BirthDate"
179-
ValueChanged="@( (DateTime? newValue) => Employee.BirthDate = newValue )"
180-
ValueExpression="@( () => Employee.BirthDate )"
181-
DisplayFormat="d"
182-
Placeholder="Enter Date..."
183-
T="@(DateTime?)" />
179+
<InPlaceEditor Value="@Employee.BirthDate"
180+
ValueChanged="@( (DateTime? newValue) => Employee.BirthDate = newValue )"
181+
ValueExpression="@( () => Employee.BirthDate )"
182+
DisplayFormat="d"
183+
Placeholder="Enter Date..."
184+
T="@(DateTime?)" />
184185
<TelerikValidationMessage For="@( () => Employee.BirthDate )" />
185186
</Template>
186187
</FormItem>
@@ -226,7 +227,7 @@ Replace `YourAppName` with the actual root namespace of your app.
226227
}
227228
}
228229
````
229-
````TelerikInPlaceEditor.razor
230+
````InPlaceEditor.razor
230231
@* import InPlaceEditorType enum *@
231232
@using YourAppName.Models
232233
@@ -686,7 +687,7 @@ Replace `YourAppName` with the actual root namespace of your app.
686687
}
687688
}
688689
````
689-
````TelerikInPlaceEditor.razor.css
690+
````InPlaceEditor.razor.css
690691
.in-place-editor {
691692
display: inline-flex;
692693
font-family: monospace;
@@ -735,9 +736,9 @@ namespace YourAppName.Models
735736

736737
## See Also
737738

738-
* [Button Overview]({%slug components/button/overview%}})
739-
* [CheckBox Overview]({%slug checkbox-overview%}})
740-
* [DatePicker Overview]({%slug components/datepicker/overview%}})
741-
* [NumericTextBox Overview]({%slug components/numerictextbox/overview%}})
742-
* [TextBox Overview]({%slug components/textbox/overview%}})
743-
* [TimePicker Overview]({%slug components/timepicker/overview%}})
739+
* [Button Overview]({%slug components/button/overview%})
740+
* [CheckBox Overview]({%slug checkbox-overview%})
741+
* [DatePicker Overview]({%slug components/datepicker/overview%})
742+
* [NumericTextBox Overview]({%slug components/numerictextbox/overview%})
743+
* [TextBox Overview]({%slug components/textbox/overview%})
744+
* [TimePicker Overview]({%slug components/timepicker/overview%})

0 commit comments

Comments
 (0)