IzzyBlazor.Autocomplete in the IzzyBlazor.Core package, generated from the 0.1.0-alpha.31 assembly
and its doc comments.
Properties (10)
ItemsIEnumerable<string>?Suggestions, narrowed in the browser as the user types.
SearchFunc<string, CancellationToken, Task<IEnumerable<string>>>?Finds suggestions for the typed text, for lists too long to send whole. Called with "" to fill the list at first, and for each pause in typing. Return a short list, such as the first 10 matches.
On static pages, each pause in typing fetches the page with the typed text in its address, and Search runs in that render; it sees the address, not the form's current values. The field needs a name (inside a Form it has one) or an id; without either, the browser narrows the first results.
ItemsProviderFunc<DataRequest<string>, ValueTask<DataResult<string>>>?Finds suggestions with the provider signature Table and DataGrid use: the request's Search is the typed text and its Take is MaxSuggestions, and request.ToResult(query) (or ToResultAsync, through EF Core) applies both to a query of strings. Called with an empty search to fill the list at first, and for each pause in typing.
On static pages, each pause in typing fetches the page with the typed text in its address, and ItemsProvider runs in that render; it sees the address, not the form's current values. The field needs a name (inside a Form it has one) or an id; without either, the browser narrows the first results.
MaxSuggestionsint = 50The most suggestions ItemsProvider is asked for (its request's Take). Defaults to 50.
DebounceTimeSpan = TimeSpan.FromMilliseconds(250)How long to wait after the last keystroke before searching. Defaults to 250 milliseconds.
Placeholderstring?Text in the empty field, such as "Start typing a city".
Clearablebool = falseA button in the field that empties it, there while it holds text. Off by default.
ReadOnlybool = falseMakes the field read-only: the text shows in a read-only text field, and the value still posts.
@bind-Valuestring?The value, bound with @bind-Value.
DisplayNamestring?The field's name in validation messages from the input itself, such as a value that can't be parsed.
Events (0)
No events.
Types (2)
DataRequest
recordWhat a data component (a Table<T>) asks its ItemsProvider for: a range of rows, sorted and filtered, or the page after a cursor. Apply it to a query with ToResultAsync or Apply; the component's columns say how each key reads an item, so a provider never maps keys to properties itself. It travels: to JSON with System.Text.Json, and to a query string with ToQueryString, for a WebAssembly app that calls an API, where Apply applies it through the fields the server declares.
| Member | Description |
|---|---|
Sort IReadOnlyList<SortField> | The sort, first key first; empty for the source's own order. |
Filter Filter? | The filter, or null for none. |
Search string? | Free text to look for, in the searchable fields (text, by default); null for none. |
Skip int = 0 | Rows to skip: any offset, such as 1,036 for a virtual-scrolling grid. |
Take int? | Rows to take; null for every row. |
Cursor string? | |
Parent string? | For a |
FilterBranch bool = false | For a |
NeedsTotal bool = true | Whether the component needs the total count. False when it pages by cursor, where the total is optional. |
CancellationToken CancellationToken = CancellationToken.None | Canceled when the component no longer needs this answer (a newer request, or it went away). |
Page int = 1 | |
Apply(IQueryable<TItem> source) | Filters, searches, sorts and takes the range of a query, with the component's fields. EF Core translates it. |
Apply(IQueryable<TItem> source, IReadOnlyList<DataField<TItem>> fields) | Filters, searches, sorts and takes the range of a query, mapping keys through these fields only: on a server, for a request that came over the wire. A filter on a key that isn't one of them (or isn't filterable) matches nothing, and a sort by one is left out, so a request can't reach other properties. |
ApplyFiltering(IQueryable<TItem> source) | Keeps what the filter and search match, with the component's fields: count this for the total. |
ApplyFiltering(IQueryable<TItem> source, IReadOnlyList<DataField<TItem>> fields) | Keeps what the filter and search match, through these fields only. |
ApplySorting(IQueryable<TItem> source) | Sorts a query, with the component's fields. |
ApplySorting(IQueryable<TItem> source, IReadOnlyList<DataField<TItem>> fields) | Sorts a query by the sortable fields named in |
ToODataQuery() | The request as OData query options, for a provider whose API is an OData endpoint: |
ToODataQuery(IReadOnlyList<DataField<TItem>> fields) | The request as OData query options, with values written as these fields' types. |
ToQueryString() | The request as a query string, for a GET API: |
ToResult(IQueryable<TItem> source) | The count of what the filter keeps (when |
ToResult(IQueryable<TItem> source, IReadOnlyList<DataField<TItem>> fields) | The count and items, through these fields only (see |
ToResultAsync(IQueryable<TItem> source, Func<IQueryable<TItem>, CancellationToken, Task<int>> count, Func<IQueryable<TItem>, CancellationToken, Task<List<TItem>>> list) | The count of what the filter keeps (only when |
ToResultAsync(IQueryable<TItem> source, IReadOnlyList<DataField<TItem>> fields, Func<IQueryable<TItem>, CancellationToken, Task<int>> count, Func<IQueryable<TItem>, CancellationToken, Task<List<TItem>>> list) | The count and items through your async methods, mapping keys through these fields only. |
ToTreeResult<TKey, TParent>(IQueryable<TItem> source, Expression<Func<TItem, TKey>> key, Expression<Func<TItem, TParent>> parent) | |
ToTreeResultAsync<TKey, TParent>(IQueryable<TItem> source, Expression<Func<TItem, TKey>> key, Expression<Func<TItem, TParent>> parent, Func<IQueryable<TItem>, CancellationToken, Task<int>> count, Func<IQueryable<TItem>, CancellationToken, Task<List<TItem>>> list) |
DataResult
recordWhat an ItemsProvider returns: the rows asked for, and the total count or the cursors of the pages around them.
| Member | Description |
|---|---|
Items IReadOnlyList<TItem> | The rows. |
Total int? | How many rows match in all. A Table with numbered pages ( |
Next string? | The cursor of the page after this one, or null on the last page. Used when the component pages by cursor. |
Previous string? | The cursor of the page before this one, if your data source gives one. Without it a Table goes back to cursors it has seen on interactive pages; on static pages Previous is unavailable past the second page (First still works). |