Skip to content

Commit 37905cc

Browse files
docs(dropdowns): automatic width calculation
1 parent 1dabb73 commit 37905cc

File tree

4 files changed

+77
-5
lines changed

4 files changed

+77
-5
lines changed

components/autocomplete/overview.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,24 +47,42 @@ User input: @TheValue
4747
4848
The AutoComplete is a generic component and its type is determined by the type of the model you use as its data source. You can find examples in the [Data Bind - Considerations]({%slug autocomplete-databind%}#considerations) article.
4949

50+
## Features
51+
5052
>caption The AutoComplete provides the following features:
5153
5254
* `Class` - the CSS class that will be rendered on the main wrapping element of the combobox.
55+
5356
* `ClearButton` - whether the user will have the option to clear the selected value with a button on the input. When it is clicked, the `Value` will be updated to `string.Empty`.
57+
5458
* `Data` - allows you to provide the data source. Required.
59+
5560
* `Enabled` - whether the component is enabled.
61+
5662
* `Filterable` - whether [filtering]({%slug autocomplete-filter%}) is enabled for the end user (suggestions will get narrowed down as they type).
63+
5764
* `FilterOperator` - the string operation that will be used for [filtering]({%slug autocomplete-filter%}). Defaults to `StartsWith`.
65+
5866
* `Id` - renders as the `id` attribute on the `<input />` element, so you can attach a `<label for="">` to the input.
67+
5968
* `MinLength` - how many characters the text has to be before the suggestions list appears. Cannot be `0`. Often works together with [filtering]({%slug autocomplete-filter%}).
69+
6070
* `Placeholder` - the text the user sees as a hint when there is no text in the input.
71+
6172
* `PopupHeight` - the height of the expanded dropdown list element.
62-
* `PopupWidth` - the width of the expanded dropdown list element.
73+
74+
* `PopupWidth` - the width of the expanded dropdown list element. If you don't specify a value, the dropdown width will match the main element which can help with responsive layouts and 100% widths.
75+
6376
* `TItem` - the type of the model to which the component is bound. Required if you can't provide `Data` or `Value`. Determines the type of the reference object.
77+
6478
* `Value` and `bind-Value`- get/set the value of the component, can be used for binding. Use the `@bind-Value` syntax for two-way binding, for example, to a variable of your own. The `Value` must be a `string`.
79+
6580
* `ValueField` - the name of the field from the model that will be shown as hints to the user. Defaults to `Value`. Not required when binding to a simple list of strings.
81+
6682
* `Width` - the width of the main element.
83+
6784
* Templates - they allow you to control the rendering of items in the component. See the [Templates]({%slug autocomplete-templates%}) article for more details.
85+
6886
* Validation - see the [Input Validation]({%slug common-features/input-validation%}) article for more details.
6987

7088

components/combobox/overview.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,20 +58,35 @@ The ComboBox is a generic component and its type is determined by the type of th
5858
>caption The ComboBox provides the following features:
5959
6060
* `AllowCustom` - whether the user can enter [custom values]({%slug components/combobox/custom-value%}). If enabled, the `ValueField` must be a `string`.
61+
6162
* `Class` - the CSS class that will be rendered on the main wrapping element of the combobox.
63+
6264
* `ClearButton` - whether the user will have the option to clear the selected value. When it is clicked, the `Value` will be updated to `default(TValue)`, so there must be no item in the `Data` that has such a `Value`. For example, if `TValue` is `int`, clearing the value will lead to a `0` `Value`, so if there is an Item with `0` in its `ValueField` - issues may arise with its selection. This feature can often go together with `AllowCustom`.
65+
6366
* `Data` - allows you to provide the data source. Required.
67+
6468
* `Enabled` - whether the component is enabled.
69+
6570
* `Filterable` - whether [filtering]({%slug components/combobox/filter%}) is enabled for the end user.
71+
6672
* `FilterOperator` - the method of [filtering]({%slug components/combobox/filter%}) the items. Defaults to `StartsWith`.
73+
6774
* `Id` - renders as the `id` attribute on the `<input />` element, so you can attach a `<label for="">` to the input.
75+
6876
* `Placeholder` - the text the user sees as a hint when no item is selected (the `Value` is `null` or an empty string).
77+
6978
* `PopupHeight` - the height of the expanded dropdown list element.
70-
* `PopupWidth` - the width of the expanded dropdown list element.
79+
80+
* `PopupWidth` - the width of the expanded dropdown list element. If you don't specify a value, the dropdown width will match the main element which can help with responsive layouts and 100% widths.
81+
7182
* `TItem` - the type of the model to which the component is bound. Required if you can't provide `Data` or `Value`. Determines the type of the reference object.
83+
7284
* `TValue` - the type of the value field from the model to which the component is bound. Required if you can't provide `Data` or `Value`. Determines the type of the reference object.
85+
7386
* `TextField` - the name of the field from the model that will be shown to the user. Defaults to `Text`.
87+
7488
* `ValueField` - the name of the field from the model that will be the underlying `value`. Defaults to `Value`.
89+
7590
* `Value` and `bind-Value`- get/set the value of the component, can be used for binding. If you set it to a value allowed by the model class value field, the corresponding item from the data collection will be pre-selected. Use the `bind-Value` syntax for two-way binding, for example, to a variable of your own.
7691

7792
The `Value` and `ValueField` can be of types:
@@ -80,8 +95,11 @@ The ComboBox is a generic component and its type is determined by the type of th
8095
* `string`
8196
* `Guid`
8297
* `Enum`
98+
8399
* `Width` - the width of the dropdown and the main element.
100+
84101
* Templates - they allow you to control the rendering of items in the component. See the [Templates]({%slug components/combobox/templates%}) article for more details.
102+
85103
* Validation - see the [Input Validation]({%slug common-features/input-validation%}) article for more details.
86104

87105

components/dropdownlist/overview.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,29 @@ See the [Component Reference]({%slug components/dropdownlist/databind%}#componen
5656
The DropDownList provides the following features:
5757

5858
* `Class` - the CSS class that will be rendered on the main wrapping element of the dropdownlist.
59+
5960
* `Data` - allows you to provide the data source. Required.
61+
6062
* `DefaultText` - sets the hint that is shown if the `Value` has the `default` value for the type of the `ValueField`. For example, `0` for an `int`, and `null` for an `int?` or `string`. You need to make sure that it does not match the value of an existing item in the data source. You can find examples in the [Examples section](#examples) in this article and in the [Input Validation]({%slug common-features/input-validation%}#dropdownlist) article.
63+
6164
* `Enabled` - whether the component is enabled.
65+
6266
* `Id` - renders as the `id` attribute on the `<select />` element, so you can attach a `<label for="">` to it.
67+
6368
* `PopupHeight` - the height of the expanded dropdown list element.
64-
* `PopupWidth` - the width of the expanded dropdown list element.
69+
70+
* `PopupWidth` - the width of the expanded dropdown list element. If you don't specify a value, the dropdown width will match the main element which can help with responsive layouts and 100% widths.
71+
6572
* `TItem` - the type of the model to which the component is bound. Required if you can't provide `Data` or `Value`. Determines the type of the reference object.
73+
6674
* `TValue` - the type of the value field from the model to which the component is bound. Required if you can't provide `Data` or `Value`. Determines the type of the reference object.
75+
6776
* `TabIndex` - the `tabindex` attribute rendered on the dropdown.
77+
6878
* `TextField` - the name of the field from the model that will be shown to the user. Defaults to `Text`.
79+
6980
* `ValueField` - the name of the field from the model that will be the underlying `value`. Defaults to `Value`.
81+
7082
* `Value` and `bind-Value`- get/set the value of the component, can be used for binding. If you set it to a value allowed by the model class value field, the corresponding item from the data collection will be pre-selected. Use the `bind-Value` syntax for two-way binding, for example, to a variable of your own.
7183

7284
The `Value` and `ValueField` can be of types:
@@ -75,8 +87,11 @@ The DropDownList provides the following features:
7587
* `string`
7688
* `Guid`
7789
* `Enum`
90+
7891
* `Width` - the width of the dropdown and the main element.
92+
7993
* Templates - they allow you to control the rendering of items in the component. See the [Templates]({%slug components/dropdownlist/templates%}) article for more details.
94+
8095
* Validation - see the [Input Validation]({%slug common-features/input-validation%}) article for more details.
8196

8297

components/multiselect/overview.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,21 +68,38 @@ To use a Telerik MultiSelect for Blazor
6868
6969
The MultiSelect is a generic component and its type is determined by the type of the model you use as its data source. You can find examples in the [Data Bind - Considerations]({%slug multiselect-databind%}#considerations) article.
7070

71+
72+
## Features
73+
7174
>caption The MultiSelect provides the following features:
7275
7376
* `Class` - the CSS class that will be rendered on the main wrapping element of the multiselect.
77+
7478
* `ClearButton` - whether the user will have the option to clear the selected items with a button on the input. When it is clicked, the `Value` will be updated to an empty list.
79+
7580
* `Data` - allows you to provide the data source. Required.
81+
7682
* `Enabled` - whether the component is enabled.
77-
* `Filterable` - whether [filtering]({%slug multiselect-filter%}) is enabled for the end user (suggestions will get narrowed down as they type).
83+
84+
* `Filterable` - whether [filtering]({%slug multiselect-filter%}) is enabled for the end user
85+
(suggestions will get narrowed down as they type).
86+
7887
* `FilterOperator` - the string operation that will be used for [filtering]({%slug multiselect-filter%}). Defaults to `StartsWith`.
88+
7989
* `Id` - renders as the `id` attribute on the `<select />` element, so you can attach a `<label for="">` to it.
90+
8091
* `MinLength` - how many characters the text has to be before the suggestions list appears. Cannot be `0`. Often works together with [filtering]({%slug multiselect-filter%}).
92+
8193
* `Placeholder` - the text the user sees as a hint when there is no selection.
94+
8295
* `PopupHeight` - the height of the expanded dropdown list element.
83-
* `PopupWidth` - the width of the expanded dropdown list element.
96+
97+
* `PopupWidth` - the width of the expanded dropdown list element. If you don't specify a value, the dropdown width will match the main element which can help with responsive layouts and 100% widths.
98+
8499
* `TextField` - the field in the model from which the text of the items is taken. Defaults to `Text`.
100+
85101
* `TItem` - the type of the model to which the component is bound. Required if you can't provide `Data` or `Value`. Determines the type of the reference object.
102+
86103
* `TValue` - the type of the value field in the model to which the component is bound. Required if you can't provide `Data` or `Value`. Determines the type of the reference object.
87104

88105
The type of the values can be:
@@ -93,9 +110,13 @@ The MultiSelect is a generic component and its type is determined by the type of
93110
* `Enum`
94111

95112
* `Value` and `bind-Value`- get/set the value of the component, can be used for binding. Use the `@bind-Value` syntax for two-way binding, for example, to a variable of your own. The `Value` must be a `List<TValue>`.
113+
96114
* `ValueField` - the name of the field from the model that will be used as values in the selection. Defaults to `Value`.
115+
97116
* `Width` - the width of the main element.
117+
98118
* Templates - they allow you to control the rendering of items in the component. See the [Templates]({%slug multiselect-templates%}) article for more details.
119+
99120
* Validation - see the [Input Validation]({%slug common-features/input-validation%}) article for more details.
100121

101122

0 commit comments

Comments
 (0)