Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit 58ccdee

Browse files
committed
Format auto suggest readme.
Added line breaks and language highlighting hints. PiperOrigin-RevId: 214303618
1 parent 3dd4207 commit 58ccdee

File tree

1 file changed

+49
-17
lines changed

1 file changed

+49
-17
lines changed
Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
# Overview
22

3-
Most selection widgets care about two data points: what is selectable and what is selected.
3+
Most selection widgets care about two data points: what is selectable and what
4+
is selected.
45

5-
In ACX selection widgets, what is selectable is represented by the [`SelectionOptions`](https://github.com/dart-lang/angular_components/blob/master/angular_components/lib/model/selection/selection_options.dart) interface, while what is selected is represented by the [`SelectionModel`](https://github.com/dart-lang/angular_components/blob/master/angular_components/lib/model/selection/selection_model.dart) interface. Material auto select input uses these two interfaces via the `selectionOptions` and `selection` inputs, but additionally it has `inputText` which presents the text the user has entered.
6+
In ACX selection widgets, what is selectable is represented by the
7+
[`SelectionOptions`](https://github.com/dart-lang/angular_components/blob/master/angular_components/lib/model/selection/selection_options.dart)
8+
interface, while what is selected is represented by the
9+
[`SelectionModel`](https://github.com/dart-lang/angular_components/blob/master/angular_components/lib/model/selection/selection_model.dart)
10+
interface. Material auto select input uses these two interfaces via the
11+
`selectionOptions` and `selection` inputs, but additionally it has `inputText`
12+
which presents the text the user has entered.
613

7-
Which input combinations to use for Material Auto Suggest Input depends on your use case.
14+
Which input combinations to use for Material Auto Suggest Input depends on your
15+
use case.
816

9-
If you are using the component to accept user entered content, and the list of options is used to assist content entry, you want to use `selectionOptions` and `inputText`. Together with the `inputTextChange` output, you can setup two-way binding for the input text.
17+
If you are using the component to accept user entered content, and the list of
18+
options is used to assist content entry, you want to use `selectionOptions` and
19+
`inputText`. Together with the `inputTextChange` output, you can setup two-way
20+
binding for the input text.
1021

1122
HTML:
12-
```
23+
24+
```html
1325
<material-auto-suggest-input
1426
[selectionOptions]="myOptions"
1527
[(inputText)]="myInput"
@@ -18,17 +30,22 @@ HTML:
1830
```
1931

2032
Dart:
21-
```
33+
34+
```dart
2235
class MyView {
2336
final myOptions = ['Foo', 'Bar', 'Baz'];
2437
String myInput = 'Bar';
2538
}
2639
```
2740

28-
If you are using the component to select one or more items from a list of options, and the input is used for filtering, you want to use `selectionOptions` and `selection`. Together with the `selectionChange` output, you can setup two-way binding for the selected value.
41+
If you are using the component to select one or more items from a list of
42+
options, and the input is used for filtering, you want to use `selectionOptions`
43+
and `selection`. Together with the `selectionChange` output, you can setup
44+
two-way binding for the selected value.
2945

3046
HTML:
31-
```
47+
48+
```html
3249
<material-auto-suggest-input
3350
[selectionOptions]="myOptions"
3451
[(selection)]="mySelection"
@@ -37,7 +54,8 @@ HTML:
3754
```
3855

3956
Dart:
40-
```
57+
58+
```dart
4159
class MyView {
4260
final myOptions = [1, 2, 3];
4361
int mySelection = 2;
@@ -46,20 +64,34 @@ class MyView {
4664

4765
# The selectionOptions input
4866

49-
The `selectionOptions` input accepts either a `SelectionOptions` class or a generic `List`.
67+
The `selectionOptions` input accepts either a `SelectionOptions` class or a
68+
generic `List`.
5069

51-
If a `List` is passed, a [`StringSelectionOptions`](https://github.com/dart-lang/angular_components/blob/master/angular_components/lib/model/selection/string_selection_options.dart) will be created with the list and the `ItemRenderer` if specified to support basic filtering.
70+
If a `List` is passed, a
71+
[`StringSelectionOptions`](https://github.com/dart-lang/angular_components/blob/master/angular_components/lib/model/selection/string_selection_options.dart)
72+
will be created with the list and the `ItemRenderer` if specified to support
73+
basic filtering.
5274

53-
If you need more advanced features, like grouped options, custom filtering or async search, you could also pass an implementation of `SelectionOptions`.
75+
If you need more advanced features, like grouped options, custom filtering or
76+
async search, you could also pass an implementation of `SelectionOptions`.
5477

5578
# The selection input & output
5679

57-
The `selection` input accepts either a `SelectionModel`, a selected value or null.
80+
The `selection` input accepts either a `SelectionModel`, a selected value or
81+
null.
5882

59-
By default Material Auto Suggest Input uses [`SingleSelectionModel`](https://github.com/dart-lang/angular_components/blob/master/angular_components/lib/src/model/selection/single_selection_model_impl.dart). If a selected value is passed to the `selection` input, this value will be selected by the default selection model. If a null value is passed to the input, the default selection model will clear the selection.
83+
By default Material Auto Suggest Input uses
84+
[`SingleSelectionModel`](https://github.com/dart-lang/angular_components/blob/master/angular_components/lib/src/model/selection/single_selection_model_impl.dart).
85+
If a selected value is passed to the `selection` input, this value will be
86+
selected by the default selection model. If a null value is passed to the input,
87+
the default selection model will clear the selection.
6088

61-
If you need to use a `MultiSelectionModel` or a custom implementation of `SelectionModel`, you could also use the same input.
89+
If you need to use a `MultiSelectionModel` or a custom implementation of
90+
`SelectionModel`, you could also use the same input.
6291

63-
The `selectionChange` output emits the selected value(s) whenever selection changes. For single select, it will either be the selected value or null. For multi select, it will a list of selected values or an empty list.
92+
The `selectionChange` output emits the selected value(s) whenever selection
93+
changes. For single select, it will either be the selected value or null. For
94+
multi select, it will a list of selected values or an empty list.
6495

65-
For simpler single select use cases, you can use the `[(selection)]` syntax to setup two-way binding for your selected value.
96+
For simpler single select use cases, you can use the `[(selection)]` syntax to
97+
setup two-way binding for your selected value.

0 commit comments

Comments
 (0)