-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathWidgetsConfig.cs
More file actions
150 lines (124 loc) · 3.27 KB
/
WidgetsConfig.cs
File metadata and controls
150 lines (124 loc) · 3.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using System.Text.Json.Serialization;
namespace BootstrapBlazor.Components.Data;
/// <summary>
/// 节点组件配置
/// </summary>
public abstract record WidgetOptions
{
// public string? On { get; set; }
// public string? Off { get; set; }
/// <summary>
/// 是否只读
/// </summary>
public bool? ReadOnly { get; set; }
// public int? Y { get; set; }
// public bool? Multiline { get; set; }
// TODO: 待测试
public string? Property { get; set; }
/// <summary>
/// 不显示可编辑组件
/// </summary>
public bool? Socketless { get; set; }
// TODO: Combo中使用
// public TValue[]? Values { get; set; }
}
/// <summary>
/// 布尔组件配置
/// </summary>
public record BooleanWidgetOptions : WidgetOptions
{
}
/// <summary>
/// 数字组件配置
/// </summary>
public record NumberWidgetOptions : WidgetOptions
{
/// <summary>
/// 最小值
/// </summary>
public double? Min { get; set; }
/// <summary>
/// 最大值
/// </summary>
public double? Max { get; set; }
// step 已经废弃
/// <summary>
/// 步长
/// </summary>
[JsonPropertyName("step2")]
public double? Step { get; set; }
/// <summary>
/// 精度
/// </summary>
public int? Precision { get; set; }
}
/// <summary>
/// 滑动条组件配置
/// </summary>
public record SliderWidgetOptions : WidgetOptions
{
/// <summary>
/// 最小值
/// </summary>
public double Min { get; set; }
/// <summary>
/// 最大值
/// </summary>
public double Max { get; set; }
// step 已经废弃
/// <summary>
/// 步长
/// </summary>
[JsonPropertyName("step2")]
public double? Step { get; set; }
/// <summary>
/// 精度
/// </summary>
public int? Precision { get; set; }
// TODO: CanvasColour
// public object? SliderColor { get; set; } // TODO: Replace with actual type for CanvasColour
// public object? MarkerColor { get; set; } // TODO: Replace with actual type for CanvasColour
}
/// <summary>
/// 旋钮组件配置
/// </summary>
public record KnobWidgetOptions : WidgetOptions
{
/// <summary>
/// 最小值
/// </summary>
public double Min { get; set; }
/// <summary>
/// 最大值
/// </summary>
public double Max { get; set; }
// step 已经废弃
/// <summary>
/// 步长
/// </summary>
[JsonPropertyName("step2")]
public double? Step { get; set; }
/// <summary>
/// 精度
/// </summary>
public int? Precision { get; set; }
// TODO: CanvasColour
// public object? SliderColor { get; set; } // TODO: Replace with actual type for CanvasColour
// public object? MarkerColor { get; set; } // TODO: Replace with actual type for CanvasColour
// public string? GradientStops { get; set; }
}
/// <summary>
/// 文本组件配置
/// </summary>
public record StringWidgetOptions : WidgetOptions
{
}
/// <summary>
/// 按钮组件配置
/// </summary>
public record ButtonWidgetOptions : WidgetOptions
{
}