55 lines
1.2 KiB
Plaintext
55 lines
1.2 KiB
Plaintext
@*@using MP.SPEC.Components
|
|
@using MP.SPEC.Data
|
|
|
|
@inject MessageService AppMService
|
|
|
|
<div class="input-group input-group-sm" hidden>
|
|
<input @bind-value="@searchVal" @bind-value:event="oninput" type="text" class="form-control" title="Campo Ricerca" placeholder="Ricerca [ALT-R]" accesskey="R" />
|
|
<button @onclick="reset" class="btn btn-success input-group-text"><i class="fa-solid fa-rotate"></i></button>
|
|
</div>
|
|
|
|
@code {
|
|
|
|
[Parameter]
|
|
public EventCallback<string> searchUpdated { get; set; }
|
|
|
|
[Parameter]
|
|
public string searchVal
|
|
{
|
|
get
|
|
{
|
|
return AppMService.SearchVal;
|
|
}
|
|
set
|
|
{
|
|
AppMService.SearchVal = value;
|
|
reportChange();
|
|
}
|
|
}
|
|
|
|
protected override Task OnInitializedAsync()
|
|
{
|
|
AppMService.EA_SearchUpdated += OnSeachUpdated;
|
|
return base.OnInitializedAsync();
|
|
}
|
|
|
|
public async void OnSeachUpdated()
|
|
{
|
|
await InvokeAsync(() =>
|
|
{
|
|
StateHasChanged();
|
|
});
|
|
}
|
|
|
|
|
|
private void reportChange()
|
|
{
|
|
searchUpdated.InvokeAsync(searchVal);
|
|
}
|
|
|
|
private void reset()
|
|
{
|
|
searchVal = "";
|
|
}
|
|
|
|
}*@ |