mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-03-29 17:31:37 +00:00
83 lines
3.0 KiB
C#
83 lines
3.0 KiB
C#
|
|
namespace AIStudio.Tools.PluginSystem.Assistants.DataModel;
|
||
|
|
|
||
|
|
internal sealed class AssistantTimePicker : AssistantComponentBase
|
||
|
|
{
|
||
|
|
public override AssistantComponentType Type => AssistantComponentType.TIME_PICKER;
|
||
|
|
public override Dictionary<string, object> Props { get; set; } = new();
|
||
|
|
public override List<IAssistantComponent> Children { get; set; } = new();
|
||
|
|
|
||
|
|
public string Name
|
||
|
|
{
|
||
|
|
get => AssistantComponentPropHelper.ReadString(this.Props, nameof(this.Name));
|
||
|
|
set => AssistantComponentPropHelper.WriteString(this.Props, nameof(this.Name), value);
|
||
|
|
}
|
||
|
|
|
||
|
|
public string Label
|
||
|
|
{
|
||
|
|
get => AssistantComponentPropHelper.ReadString(this.Props, nameof(this.Label));
|
||
|
|
set => AssistantComponentPropHelper.WriteString(this.Props, nameof(this.Label), value);
|
||
|
|
}
|
||
|
|
|
||
|
|
public string Value
|
||
|
|
{
|
||
|
|
get => AssistantComponentPropHelper.ReadString(this.Props, nameof(this.Value));
|
||
|
|
set => AssistantComponentPropHelper.WriteString(this.Props, nameof(this.Value), value);
|
||
|
|
}
|
||
|
|
|
||
|
|
public string Placeholder
|
||
|
|
{
|
||
|
|
get => AssistantComponentPropHelper.ReadString(this.Props, nameof(this.Placeholder));
|
||
|
|
set => AssistantComponentPropHelper.WriteString(this.Props, nameof(this.Placeholder), value);
|
||
|
|
}
|
||
|
|
|
||
|
|
public string HelperText
|
||
|
|
{
|
||
|
|
get => AssistantComponentPropHelper.ReadString(this.Props, nameof(this.HelperText));
|
||
|
|
set => AssistantComponentPropHelper.WriteString(this.Props, nameof(this.HelperText), value);
|
||
|
|
}
|
||
|
|
|
||
|
|
public string TimeFormat
|
||
|
|
{
|
||
|
|
get => AssistantComponentPropHelper.ReadString(this.Props, nameof(this.TimeFormat));
|
||
|
|
set => AssistantComponentPropHelper.WriteString(this.Props, nameof(this.TimeFormat), value);
|
||
|
|
}
|
||
|
|
|
||
|
|
public bool AmPm
|
||
|
|
{
|
||
|
|
get => AssistantComponentPropHelper.ReadBool(this.Props, nameof(this.AmPm), false);
|
||
|
|
set => AssistantComponentPropHelper.WriteBool(this.Props, nameof(this.AmPm), value);
|
||
|
|
}
|
||
|
|
|
||
|
|
public string PickerVariant
|
||
|
|
{
|
||
|
|
get => AssistantComponentPropHelper.ReadString(this.Props, nameof(this.PickerVariant));
|
||
|
|
set => AssistantComponentPropHelper.WriteString(this.Props, nameof(this.PickerVariant), value);
|
||
|
|
}
|
||
|
|
|
||
|
|
public string UserPrompt
|
||
|
|
{
|
||
|
|
get => AssistantComponentPropHelper.ReadString(this.Props, nameof(this.UserPrompt));
|
||
|
|
set => AssistantComponentPropHelper.WriteString(this.Props, nameof(this.UserPrompt), value);
|
||
|
|
}
|
||
|
|
|
||
|
|
public string Class
|
||
|
|
{
|
||
|
|
get => AssistantComponentPropHelper.ReadString(this.Props, nameof(this.Class));
|
||
|
|
set => AssistantComponentPropHelper.WriteString(this.Props, nameof(this.Class), value);
|
||
|
|
}
|
||
|
|
|
||
|
|
public string Style
|
||
|
|
{
|
||
|
|
get => AssistantComponentPropHelper.ReadString(this.Props, nameof(this.Style));
|
||
|
|
set => AssistantComponentPropHelper.WriteString(this.Props, nameof(this.Style), value);
|
||
|
|
}
|
||
|
|
|
||
|
|
public string GetTimeFormat()
|
||
|
|
{
|
||
|
|
if (!string.IsNullOrWhiteSpace(this.TimeFormat))
|
||
|
|
return this.TimeFormat;
|
||
|
|
|
||
|
|
return this.AmPm ? "hh:mm tt" : "HH:mm";
|
||
|
|
}
|
||
|
|
}
|