-
Notifications
You must be signed in to change notification settings - Fork 146
/
Copy pathKeyboardNavigation.razor
214 lines (203 loc) · 8.04 KB
/
KeyboardNavigation.razor
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
@page "/file-manager/keyboard-navigation"
@using Syncfusion.Blazor.FileManager;
@inject IJSRuntime JsRuntime;
@*Hidden:Lines*@
@inherits SampleBaseComponent
@inject NavigationManager NavigationManager
<PageTitle>Blazor File Manager Keyboard Navigation Example - Syncfusion Demos</PageTitle>
<HeadContent>
<meta name="description" content="This example demonstrates the Keyboard Navigation in Blazor File Manager Component. Explore here for more details." />
<link rel="canonical" href="@canonicalURL" />
</HeadContent>
@*End:Hidden*@
<SampleDescription>
<p>In the demonstrated example, the <a target='_blank' href='https://www.syncfusion.com/blazor-components/blazor-file-manager'>Blazor File Manager </a> component's operations are made more accessible through the use of keyboard shortcuts, allowing for easy interaction with various key combinations and the functions of the File Manager.</p>
</SampleDescription>
<ActionDescription>
<p>The following list presents the applicable key combinations and their corresponding functionalities.</p>
<ul>
<li>
<b>Focus</b>
<ul>
<li>
<span class="key-class"><kbd>Alt</kbd> + <kbd>J</kbd></span>
<span> - Focuses on the first component of the sample.</span>
</li>
</ul>
</li>
<li>
<b>Supported keys and user actions</b>
<ul>
<li>
<span class="key-class"><kbd>F5</kbd></span>
<span> - Refresh the component.</span>
</li>
<li>
<span class="key-class"><kbd>F2</kbd></span>
<span> - Renames the selected item.</span>
</li>
<li>
<span class="key-class"><kbd>Space</kbd></span>
<span> - Selects the focused item.</span>
</li>
<li>
<span class="key-class"><kbd>Home</kbd></span>
<span> - Selects the first item in the component.</span>
</li>
<li>
<span class="key-class"><kbd>End</kbd></span>
<span> - Selects the last item in the component.</span>
</li>
<li>
<span class="key-class"><kbd>Enter</kbd></span>
<span> - Opens the selected item.</span>
</li>
<li>
<span class="key-class"><kbd>Del</kbd> or <kbd>Shift</kbd> + <kbd>Del</kbd></span>
<span> - Deletes the selected item.</span>
</li>
<li>
<span class="key-class"><kbd>Alt</kbd> + <kbd>N</kbd></span>
<span> - Creates a new folder.</span>
</li>
<li>
<span class="key-class"><kbd>Ctrl</kbd> + <kbd>A</kbd></span>
<span> - Selects all the items.</span>
</li>
<li>
<span class="key-class"><kbd>Ctrl</kbd> + <kbd>D</kbd></span>
<span> - Downloads the selected item.</span>
</li>
<li>
<span class="key-class"><kbd>Ctrl</kbd> + <kbd>X</kbd></span>
<span> - Cuts the selected item.</span>
</li>
<li>
<span class="key-class"><kbd>Ctrl</kbd> + <kbd>C</kbd></span>
<span> - Copies the selected item.</span>
</li>
<li>
<span class="key-class"><kbd>Ctrl</kbd> + <kbd>V</kbd></span>
<span> - Pastes the copied items in the current path.</span>
</li>
<li>
<span class="key-class"><kbd>Ctrl</kbd> + <kbd>U</kbd></span>
<span> - Opens the file open window to upload an item.</span>
</li>
<li>
<span class="key-class"><kbd>Alt</kbd> + <kbd>Enter</kbd></span>
<span> - Provides the details of the selected items.</span>
</li>
<li>
<span class="key-class"><kbd>Ctrl</kbd> + <kbd>Home</kbd></span>
<span> - Moves the focus to the first item.</span>
</li>
<li>
<span class="key-class"><kbd>Ctrl</kbd> + <kbd>End</kbd></span>
<span> - Moves the focus to the last item.</span>
</li>
<li>
<span class="key-class"><kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>1</kbd></span>
<span> - Changes the view to display the items in <code>Details view</code>.</span>
</li>
<li>
<span class="key-class"><kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>2</kbd></span>
<span> - Changes the view to display the items in <code>LargeIcons view</code>.</span>
</li>
<li>
<span class="key-class"><kbd>Shift</kbd> + <kbd>Home</kbd> or <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Home</kbd></span>
<span> - Selects the files in between the last selected file and the first file in the component.</span>
</li>
<li>
<span class="key-class"><kbd>Shift</kbd> + <kbd>End</kbd> or <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>End</kbd></span>
<span> - Selects the files in between the last selected file and the first file in the component.</span>
</li>
<li>
<span class="key-class"><kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Space</kbd> or <kbd>Shift</kbd> + <kbd>Space</kbd></span>
<span> - Selects the currently focused item and items in between the currently focused item and last selected item.</span>
</li>
</ul>
</li>
<li>
<b>Large Icons view</b>
<ul>
<li>
<span class="key-class"><kbd>Arrow keys</kbd></span>
<span> - Selects the item in the corresponding direction.</span>
</li>
<li>
<span class="key-class"><kbd>Ctrl</kbd> + <kbd>Arrow keys</kbd></span>
<span> - Moves the focus to the item in the corresponding direction.</span>
</li>
<li>
<span class="key-class"><kbd>Shift</kbd> + <kbd>Arrow keys</kbd> or <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>Arrow keys</kbd></span>
<span> - Selects the next item in the corresponding direction.</span>
</li>
</ul>
</li>
<li>
<b>Details view</b>
<ul>
<li>
<span class="key-class"><kbd>Up arrow</kbd> or <kbd>Down arrow</kbd></span>
<span> - Selects the file in the corresponding direction.</span>
</li>
<li>
<span class="key-class"><kbd>Ctrl</kbd> + <kbd>Up arrow</kbd> or <kbd>Ctrl</kbd> + <kbd>Down arrow</kbd></span>
<span> - Moves the focus to the next file in the corresponding direction.</span>
</li>
<li>
<span class="key-class"><kbd>Shift</kbd> + <kbd>Up arrow</kbd> or <kbd>Shift</kbd> + <kbd>Down arrow</kbd></span>
<span> - Selects the next file in the corresponding direction.</span>
</li>
</ul>
</li>
</ul>
</ActionDescription>
<div class="control-section">
@* Initialization of default File Manager component *@
<SfFileManager TValue="FileManagerDirectoryContent" ShowFileExtension="false">
<FileManagerAjaxSettings Url="https://ej2-aspcore-service.azurewebsites.net/api/FileManager/FileOperations"
UploadUrl="https://ej2-aspcore-service.azurewebsites.net/api/FileManager/Upload"
DownloadUrl="https://ej2-aspcore-service.azurewebsites.net/api/FileManager/Download"
GetImageUrl="https://ej2-aspcore-service.azurewebsites.net/api/FileManager/GetImage">
</FileManagerAjaxSettings>
<FileManagerToolbarSettings ToolbarItems="@Items"></FileManagerToolbarSettings>
<FileManagerContextMenuSettings Layout="@LayoutItems" Visible="true"></FileManagerContextMenuSettings>
</SfFileManager>
</div>
@*Hidden:Lines*@
@code {
private string canonicalURL { get; set; }
protected override void OnInitialized()
{
canonicalURL = NavigationManager.Uri.Split("?")[0];
}
public List<ToolBarItemModel> Items = new List<ToolBarItemModel>()
{
new ToolBarItemModel() { Name = "NewFolder" },
new ToolBarItemModel() { Name = "Cut" },
new ToolBarItemModel() { Name = "Copy" },
new ToolBarItemModel() { Name = "Paste" },
new ToolBarItemModel() { Name = "Delete" },
new ToolBarItemModel() { Name = "Rename" },
new ToolBarItemModel() { Name = "SortBy" },
new ToolBarItemModel() { Name = "Refresh" },
new ToolBarItemModel() { Name = "Selection" },
new ToolBarItemModel() { Name = "View" },
new ToolBarItemModel() { Name = "Details" },
};
public string[] LayoutItems = new string[] { "SortBy", "View", "Refresh", "|", "Paste", "|", "NewFolder", "|", "Details", "|", "SelectAll" };
}
@*End:Hidden*@
<style>
/* Sample specific styles */
.key-class {
display: inline-block;
width: 400px;
}
.bootstrap5 .e-filemanager .e-large-icons .e-list-img, .bootstrap5-dark .e-filemanager .e-large-icons .e-list-img,
.bootstrap4 .e-filemanager .e-large-icons .e-list-img {
border: none !important;
}
</style>