-
-
Notifications
You must be signed in to change notification settings - Fork 268
Expand file tree
/
Copy pathBitFileUpload.razor
More file actions
56 lines (51 loc) · 1.46 KB
/
BitFileUpload.razor
File metadata and controls
56 lines (51 loc) · 1.46 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
@namespace Bit.BlazorUI
@inherits BitComponentBase
<div @ref="@RootElement" @attributes="HtmlAttributes"
id="@_Id"
style="@StyleBuilder.Value"
class="@ClassBuilder.Value"
dir="@Dir?.ToString().ToLower()">
@if (LabelTemplate is not null)
{
@LabelTemplate
}
else if (Label.HasValue())
{
<button @onclick="Browse"
type="button"
class="bit-upl-lbl">
@Label
</button>
}
<input @ref="_inputRef"
@onchange="HandleOnChange"
type="file"
id="@InputId"
class="bit-upl-fi"
multiple="@Multiple"
disabled="@(IsEnabled is false)"
aria-labelledby="@(Label.HasValue() ? Label : null)"
accept="@(Accept ?? string.Join(",", AllowedExtensions))" />
@if (Files is not null)
{
<div class="bit-upl-fl">
@for (var i = 0; i < Files.Count; i++)
{
var index = i;
var file = Files[index];
file.Index = index;
if (HideFileView is false)
{
if (FileViewTemplate is not null)
{
@FileViewTemplate(file)
}
else
{
<_BitFileUploadItem FileUpload="this" Item="file" />
}
}
}
</div>
}
</div>