-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDriverJsConfig.cs
More file actions
160 lines (133 loc) · 5.49 KB
/
DriverJsConfig.cs
File metadata and controls
160 lines (133 loc) · 5.49 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
151
152
153
154
155
156
157
158
159
160
// Copyright (c) BootstrapBlazor & Argo Zhang (argo@live.ca). 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/
namespace BootstrapBlazor.Components;
/// <summary>
/// FocusGuide 配置类
/// </summary>
public class DriverJsConfig
{
/// <summary>
/// Array of steps to highlight.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<DriverJsStep> Steps { get; set; } = [];
/// <summary>
/// Whether to animate the product tour. (default: true)
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? Animate { get; set; }
/// <summary>
/// Overlay color. (default: black)
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? OverlayColor { get; set; }
/// <summary>
/// Whether to smooth scroll to the highlighted element. (default: false)
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? SmoothScroll { get; set; }
/// <summary>
/// Whether to allow closing the popover by clicking on the backdrop. (default: true)
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? AllowClose { get; set; }
/// <summary>
/// Opacity of the backdrop. (default: 0.5)
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public float? OverlayOpacity { get; set; }
/// <summary>
/// Distance between the highlighted element and the cutout. (default: 10)
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public float? StagePadding { get; set; }
/// <summary>
/// Radius of the cutout around the highlighted element. (default: 5)
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? StageRadius { get; set; }
/// <summary>
/// Whether to allow keyboard navigation. (default: true)
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? AllowKeyboardControl { get; set; }
/// <summary>
/// Whether to disable interaction with the highlighted element. (default: false)
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? DisableActiveInteraction { get; set; }
/// <summary>
/// If you want to add custom class to the popover
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? PopoverClass { get; set; }
/// <summary>
/// Distance between the popover and the highlighted element. (default: 10)
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public float? PopoverOffset { get; set; }
/// <summary>
/// Array of buttons to show in the popover. Defaults to ["next", "previous", "close"]
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string>? ShowButtons { get; set; }
/// <summary>
/// Array of buttons to disable.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public List<string>? DisableButtons { get; set; }
/// <summary>
/// Whether to show the progress text in popover. (default: false)
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? ShowProgress { get; set; }
/// <summary>
/// Template for the progress text. You can use the following placeholders in the template:
/// - {{current}}: The current step number
/// - {{total}}: Total number of steps
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? ProgressText { get; set; }
/// <summary>
/// Text to show in the next buttons.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? NextBtnText { get; set; }
/// <summary>
/// Text to show in the prev buttons.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? PrevBtnText { get; set; }
/// <summary>
/// Text to show in the done buttons.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? DoneBtnText { get; set; }
[JsonInclude]
private bool HookDestroyStarted => OnDestroyStartedAsync != null;
/// <summary>
/// 获得/设置 组件销毁前回调方法名称
/// </summary>
[JsonIgnore]
public Func<DriverJsConfig, int, Task<string?>>? OnDestroyStartedAsync { get; set; }
[JsonInclude]
private bool HookDestroyed => OnDestroyedAsync != null;
/// <summary>
/// 获得/设置 组件销毁前回调方法名称
/// </summary>
[JsonIgnore]
public Func<Task>? OnDestroyedAsync { get; set; }
/// <summary>
/// 获得/设置 点击遮罩行为 close nextStep function 默认 close
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? OverlayClickBehavior { get; set; }
[JsonInclude]
private string OverlayClickCallbackMethod => nameof(OnOverlayClickedAsync);
/// <summary>
/// 获得/设置 组件销毁前回调方法名称
/// </summary>
[JsonIgnore]
public Func<DriverJs, DriverJsConfig, int, Task>? OnOverlayClickedAsync { get; set; }
}