mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-11-04 14:27:21 +00:00
Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace AIStudio.Components;
|
|
|
|
/// <summary>
|
|
/// A file-pattern field with shared, collapsible help and optional, always-visible exclusions.
|
|
/// Callers supply their existing fields, preserving validation and managed-configuration locks.
|
|
/// </summary>
|
|
public partial class FilePatternSelection : MSGComponentBase
|
|
{
|
|
/// <summary>
|
|
/// How many lines a field for file patterns or exclusions grows to. A longer list scrolls.
|
|
/// </summary>
|
|
public const int MAX_FIELD_LINES = 6;
|
|
|
|
[Parameter, EditorRequired]
|
|
public RenderFragment AllowedContent { get; set; } = null!;
|
|
|
|
/// <summary>
|
|
/// When supplied, shows the existing exclusion field below the inclusion field.
|
|
/// Both groups stay visible and use the same help control.
|
|
/// </summary>
|
|
[Parameter]
|
|
public RenderFragment? ExcludedContent { get; set; }
|
|
|
|
private bool HasExclusions => this.ExcludedContent is not null;
|
|
|
|
private bool showHelp;
|
|
|
|
private void ToggleHelp() => this.showHelp = !this.showHelp;
|
|
}
|