Move components into subfolders

This commit is contained in:
Pat Hartl 2025-09-06 13:09:47 -05:00
parent 0eb233ac30
commit 5fefdfdef1
35 changed files with 66 additions and 23 deletions

View file

@ -1,3 +1,5 @@
@namespace LANCommander.UI.Components
<span class="anticon" role="img">
<svg focusable="false" width="@Width" height="@Height" fill="@Color">
<use href="_content/LANCommander.UI/bootstrap-icons.svg#@Type"></use>

View file

@ -1,3 +1,5 @@
@namespace LANCommander.UI.Components
@ByteSizeLib.ByteSize.FromBytes(@Value).ToString()
@code {

View file

@ -2,6 +2,7 @@
@using Microsoft.AspNetCore.Components.Authorization
@inject Client Client
@inject AuthenticationStateProvider AuthenticationStateProvider
@namespace LANCommander.UI.Components
<Button OnClick="StartThread">New Thread</Button>

View file

@ -0,0 +1 @@
@namespace LANCommander.UI.Components

View file

@ -1,3 +1,5 @@
@namespace LANCommander.UI.Components
<p>
@Content
</p>

View file

@ -1,4 +1,5 @@
@using System.Globalization
@namespace LANCommander.UI.Components
<Comment Author="@UserName" Datetime="@StartedOn.ToString(CultureInfo.CurrentCulture)">
<ContentTemplate>

View file

@ -2,6 +2,7 @@
@using LANCommander.SDK
@using Microsoft.AspNetCore.Components.Web.Virtualization
@inject Client Client
@namespace LANCommander.UI.Components
<Flex Direction="FlexDirection.Vertical">
<div style="flex-grow: 1;">

View file

@ -4,6 +4,7 @@
@inject NavigationManager Navigator
@inject IJSRuntime JS
@inject IMessageService MessageService
@namespace LANCommander.UI.Components
<div class="ant-upload ant-upload-select-text ant-upload-drag ant-upload-select chunk-uploader" data-status="@CurrentProgressStatus">
<Progress Type="ProgressType.Circle" Percent="Progress" Status="@CurrentProgressStatus" Class="uploader-progress" />

View file

@ -1,6 +1,6 @@
@using Microsoft.JSInterop
@inject IJSRuntime JS
@inject NavigationManager NavigationManager
@namespace LANCommander.UI.Components
<ErrorBoundary>
<ChildContent>

View file

@ -1,3 +1,5 @@
@namespace LANCommander.UI.Components
<Flex Gap="FlexGap.Middle" Align="FlexAlign.Center">
@ChildContent

View file

@ -1,3 +1,5 @@
<script src="/_content/LANCommander.UI/bundle.js"></script>
@namespace LANCommander.UI.Components
<script src="/_content/LANCommander.UI/bundle.js"></script>
<script src="/_content/PSC.Blazor.Components.MarkdownEditor/js/easymde.min.js"></script>
<script src="/_content/PSD.Blazor.Components.MarkdownEditor/js/markdownEditor.js"></script>

View file

@ -0,0 +1,4 @@
@namespace LANCommander.UI.Components
<link rel="stylesheet" href="/_content/PSC.Blazor.Components.MarkdownEditor/css/markdowneditor.css" />
<link rel="stylesheet" href="/_content/PSC.Blazor.Components.MarkdownEditor/css/easymde.min.css" />

View file

@ -1,6 +1,7 @@
@using LANCommander.UI.Providers
@implements IDisposable
@inject TimeProvider TimeProvider
@namespace LANCommander.UI.Components
@if (Value.HasValue && Value.Value != DateTime.MinValue)
{

View file

@ -2,6 +2,7 @@
@using Microsoft.JSInterop
@inject TimeProvider TimeProvider
@inject IJSRuntime JS
@namespace LANCommander.UI.Components
@code {
protected override async Task OnAfterRenderAsync(bool firstRender)

View file

@ -1,7 +1,8 @@
@using LANCommander.SDK.Models
@inject SDK.Client Client
@namespace LANCommander.UI.Components
<Spin Spinning="_loading">
<Spin Spinning="_loading" WrapperClassName="@Class safe-image">
@if (!_error)
{
if (!String.IsNullOrWhiteSpace(Source))

View file

@ -0,0 +1,9 @@
.safe-image {
& > div,
.ant-spin-container,
img {
display: inline-block;
max-width: 100%;
max-height: 100%;
}
}

View file

@ -1,4 +1,6 @@
<div class="pane @Class" data-size="@Size">
@namespace LANCommander.UI.Components
<div class="pane @Class" data-size="@Size">
@ChildContent
</div>

View file

@ -1,5 +1,6 @@
@using Microsoft.JSInterop
@inject IJSRuntime JS
@namespace LANCommander.UI.Components
<CascadingValue Value="this" IsFixed="@true">
<div id="split-pane-@(PaneId.ToString())" class="split-pane @Class" style="@Style">

View file

@ -1,4 +1,4 @@
import Split from 'split.js'
import Split from 'split.js'
export class SplitPane {
SplitPanes: HTMLElement[] = [];

View file

@ -1,2 +0,0 @@
<link rel="stylesheet" href="/_content/PSC.Blazor.Components.MarkdownEditor/css/markdowneditor.css" />
<link rel="stylesheet" href="/_content/PSC.Blazor.Components.MarkdownEditor/css/easymde.min.css" />

View file

@ -1,12 +1,14 @@
@using LANCommander.SDK.Models
@typeparam TItem where TItem : IKeyedModel
@namespace LANCommander.UI.Components
<Select
@ref="@Select"
Mode="SelectMode.Multiple"
Mode="SelectMode.Tags"
DataSource="Entities"
ItemValue="e => e.Id"
ItemLabel="OptionLabelSelector"
OnCreateCustomTag="async (tag) => await OnCreateCustomTag(tag)"
@bind-Values="@SelectedValues"
EnableSearch
EnableVirtualization>
@ -15,6 +17,8 @@
@code {
[Parameter] public Func<TItem, string> OptionLabelSelector { get; set; }
[Parameter] public IEnumerable<TItem> Entities { get; set; }
[Parameter] public EventCallback<string> OnCreateTag { get; set; }
[Parameter] public ICollection<TItem> Values { get; set; }
[Parameter] public EventCallback<ICollection<TItem>> ValuesChanged { get; set; }
@ -38,4 +42,10 @@
}
}
}
private async Task OnCreateCustomTag(string tag)
{
if (OnCreateTag.HasDelegate)
await OnCreateTag.InvokeAsync(tag);
}
}

View file

@ -1,6 +1,6 @@
import { Uploader } from "./Scripts/Uploader"
import { SplitPane } from "./Scripts/SplitPane"
import { TimeProvider } from "./Scripts/TimeProvider";
import { Uploader } from "./Components/ChunkUploader/Uploader"
import { SplitPane } from "./Components/SplitPane/SplitPane"
import { TimeProvider } from "./Components/LocalTime/TimeProvider";
import { Readline } from "xterm-readline"
import { FitAddon } from "@xterm/addon-fit"

View file

@ -1,11 +0,0 @@
@use '_blazor-error';
@use '_layout';
@use '_panel-layout';
@use '_menu';
@use '_file-manager';
@use '_chunk-uploader';
@use '_pdf-reader';
@use '_transfer';
@use '_split-pane';
@use '_markdown-editor';
@use '_authentication-provider';

View file

@ -0,0 +1,12 @@
@forward 'Styles/_blazor-error';
@forward 'Styles/_layout';
@forward 'Styles/_panel-layout';
@forward 'Styles/_menu';
@forward 'Styles/_pdf-reader';
@forward 'Styles/_transfer';
@forward 'Styles/_markdown-editor';
@forward 'Styles/_authentication-provider';
@forward 'Components/FileManager/FileManager.razor';
@forward 'Components/ChunkUploader/ChunkUploader.razor';
@forward 'Components/SplitPane/SplitPane.razor';
@forward 'Components/SafeImage/SafeImage.razor';

View file

@ -3,7 +3,7 @@ const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: ['./Main.ts', './Styles/ui.scss'], // Adjust the path if your index.js is located elsewhere
entry: ['./Main.ts', './_Imports.razor.scss'], // Adjust the path if your index.js is located elsewhere
module: {
rules: [
{