Files with editor update
This commit is contained in:
@ -1,3 +1,12 @@
|
||||
@inherits FileItemBase
|
||||
|
||||
|
||||
<div class="level">
|
||||
<div class="level-left">
|
||||
<div class="level-item">
|
||||
<p class="is-size-7"><sub>@File.Folder</sub></p>
|
||||
<p class="@(File.CanBeDeleted ? "has-text-danger" : null)">
|
||||
@File.Name
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -14,7 +14,7 @@
|
||||
<div class="content">
|
||||
<div class="field">
|
||||
<div class="control">
|
||||
<InputText Value="SearchInput" ValueChanged="OnSearchChanged" class="input is-primary" type="text" placeholder="Search..." />
|
||||
<InputText Value="SearchInput" ValueChanged="SearchInputChanged" class="input is-primary" type="text" placeholder="Search..." />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -23,30 +23,28 @@
|
||||
<ul class="menu-list">
|
||||
@foreach (var file in Files)
|
||||
{
|
||||
<li>
|
||||
<FileItem File="file" @onclick="OnFileClick(file)"></FileItem>
|
||||
<li @onclick="e => OnFileClick(file)" @key="file" class="@file.IsVisible">
|
||||
<FileItem File="file"></FileItem>
|
||||
</li>
|
||||
}
|
||||
<li><a>Dashboard</a></li>
|
||||
<li><a>Customers</a></li>
|
||||
</ul>
|
||||
</aside>
|
||||
</div>
|
||||
<div class="content">
|
||||
<div class="buttons has-addons">
|
||||
<button class="button is-primary">
|
||||
<button class="button is-primary" @onclick="OnAddDialog">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-plus-box-outline"></i>
|
||||
</span>
|
||||
Add
|
||||
</button>
|
||||
<button class="button is-warning">
|
||||
<button class="button is-warning" @onclick="OnUpdateDialog">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-pencil-box-outline"></i>
|
||||
</span>
|
||||
Update
|
||||
</button>
|
||||
<button class="button is-danger">
|
||||
<button class="button is-danger" @onclick="OnDeleteDialog">
|
||||
<span class="icon is-small">
|
||||
<i class="mdi mdi-minus-box-outline"></i>
|
||||
</span>
|
||||
@ -61,5 +59,7 @@
|
||||
@Editor
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -21,6 +21,13 @@ namespace Seenginx.Components
|
||||
[Parameter]
|
||||
public EventCallback<string> ApplyFilter { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public EventCallback AddFile { get; set; }
|
||||
[Parameter]
|
||||
public EventCallback<CFile> UpdateFile { get; set; }
|
||||
[Parameter]
|
||||
public EventCallback<CFile> DeleteFile { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public RenderFragment<CFile> Editor { get; set; }
|
||||
|
||||
@ -35,14 +42,17 @@ namespace Seenginx.Components
|
||||
|
||||
protected bool IsAnyFileSelected => SelectedFile != default;
|
||||
|
||||
private CFile SelectedFile { get; set; }
|
||||
[Parameter]
|
||||
public EventCallback<CFile> SelectedFileChanged { get; set; }
|
||||
[Parameter]
|
||||
public CFile SelectedFile { get; set; }
|
||||
|
||||
protected string SearchInput { get; set; }
|
||||
|
||||
protected async Task OnDeselectClick()
|
||||
{
|
||||
SelectedFile = null;
|
||||
//Clean on the right
|
||||
await SelectedFileChanged.InvokeAsync(SelectedFile);
|
||||
}
|
||||
|
||||
protected async Task OnFilterClick(EventArgs e, string filter)
|
||||
@ -55,7 +65,7 @@ namespace Seenginx.Components
|
||||
Files[index].Unhide();
|
||||
}
|
||||
|
||||
protected async Task OnSearchChanged()
|
||||
protected void SearchInputChanged()
|
||||
{
|
||||
if (string.IsNullOrEmpty(SearchInput))
|
||||
Files.ForEach(f => f.Hide());
|
||||
@ -71,17 +81,20 @@ namespace Seenginx.Components
|
||||
|
||||
protected async Task OnFileClick(CFile file)
|
||||
{
|
||||
SelectedFile = file;
|
||||
await SelectedFileChanged.InvokeAsync(file);
|
||||
}
|
||||
|
||||
protected async Task OnCreateFile()
|
||||
protected async Task OnAddDialog()
|
||||
{
|
||||
await AddFile.InvokeAsync(null);
|
||||
}
|
||||
protected async Task OnUpdateDialog(CFile file)
|
||||
protected async Task OnUpdateDialog()
|
||||
{
|
||||
await UpdateFile.InvokeAsync(SelectedFile);
|
||||
}
|
||||
protected async Task OnDeleteDialog(CFile file)
|
||||
protected async Task OnDeleteDialog()
|
||||
{
|
||||
await UpdateFile.InvokeAsync(SelectedFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,3 +0,0 @@
|
||||
@*<RadzenTabs>
|
||||
|
||||
</RadzenTabs>*@
|
@ -1,13 +0,0 @@
|
||||
using Microsoft.AspNetCore.Components;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Seenginx.Components
|
||||
{
|
||||
public class TabsBase : ComponentBase
|
||||
{
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user