File tree Expand file tree Collapse file tree 10 files changed +27
-39
lines changed Expand file tree Collapse file tree 10 files changed +27
-39
lines changed Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk.Razor" >
22
33 <PropertyGroup >
4- <Version >9.7.4 </Version >
4+ <Version >9.8.0-beta01 </Version >
55 </PropertyGroup >
66
77 <ItemGroup >
Original file line number Diff line number Diff line change 4646
4747@code {
4848 RenderFragment RenderAdd =>
49- @< div id = " @AddId" class = " @GetItemClassString()" style = " @ItemStyleString" >
50- < div class = " @ActionClassString" >
51- < span class = " upload-item-plus" >
52- < i class = " @AddIcon" >< / i >
53- < / span >
54- < / div >
49+ @< div id = " @AddId" class = " @GetItemClassString(" upload - item - plus upload - drop - body btn - browser " )" style = " @ItemStyleString" >
50+ < i class = " @AddIcon" >< / i >
5551 < / div > ;
5652}
Original file line number Diff line number Diff line change @@ -91,7 +91,8 @@ public partial class AvatarUpload<TValue>
9191 . AddClassFromAttributes ( AdditionalAttributes )
9292 . Build ( ) ;
9393
94- private string ? GetItemClassString ( ) => CssBuilder . Default ( "upload-item" )
94+ private string ? GetItemClassString ( string ? classString = null ) => CssBuilder . Default ( "upload-item" )
95+ . AddClass ( classString )
9596 . AddClass ( "is-circle" , IsCircle )
9697 . AddClass ( "disabled" , IsDisabled )
9798 . Build ( ) ;
@@ -106,10 +107,6 @@ public partial class AvatarUpload<TValue>
106107 . AddClass ( $ "--bb-upload-item-border-radius: { BorderRadius } ;", IsCircle && ! string . IsNullOrEmpty ( BorderRadius ) )
107108 . Build ( ) ;
108109
109- private string ? ActionClassString => CssBuilder . Default ( "upload-item-actions" )
110- . AddClass ( "btn-browser" , IsDisabled == false )
111- . Build ( ) ;
112-
113110 private string ? ValidStatusIconString => CssBuilder . Default ( "valid-icon valid" )
114111 . AddClass ( ValidStatusIcon )
115112 . Build ( ) ;
Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ public partial class ButtonUpload<TValue>
8888 . AddClassFromAttributes ( AdditionalAttributes )
8989 . Build ( ) ;
9090
91- private string ? BrowserButtonClassString => CssBuilder . Default ( "btn-browser" )
91+ private string ? BrowserButtonClassString => CssBuilder . Default ( "btn-browser upload-drop-body " )
9292 . AddClass ( BrowserButtonClass , ! string . IsNullOrEmpty ( BrowserButtonClass ) )
9393 . Build ( ) ;
9494
Original file line number Diff line number Diff line change 44
55@if (IsShowLabel )
66{
7- <BootstrapLabel required =" @Required" ShowLabelTooltip =" ShowLabelTooltip" Value =" @DisplayText" / >
7+ <BootstrapLabel required =" @Required" ShowLabelTooltip =" ShowLabelTooltip" Value =" @DisplayText" ></ BootstrapLabel >
88}
99<div @attributes =" @AdditionalAttributes" class =" @ClassString" id =" @Id" data-bb-previewer-id =" @PreviewerId" >
1010 <div class =" @BodyClassString" >
2626 }
2727 else
2828 {
29- <FileIcon Extension =" @item.GetExtension()" / >
29+ <FileIcon Extension =" @item.GetExtension()" ></ FileIcon >
3030 }
3131 </div >
3232 <div class =" upload-item-size" ><span >@item.GetFileName() </span > (@item .Size .ToFileSizeString ())</div >
7777 </div >
7878 @if (ShowPreviewList )
7979 {
80- <ImagePreviewer Id =" @PreviewerId" PreviewList =" PreviewList" / >
80+ <ImagePreviewer Id =" @PreviewerId" PreviewList =" PreviewList" ></ ImagePreviewer >
8181 }
82- <InputFile AdditionalAttributes =" @GetUploadAdditionalAttributes()" OnChange =" OnFileChange" / >
82+ <InputFile AdditionalAttributes =" @GetUploadAdditionalAttributes()" OnChange =" OnFileChange" ></ InputFile >
8383</div >
8484
8585@code {
8686 RenderFragment RenderAdd =>
8787 @< div class = " @CardItemClass" >
88- < div class = " @ActionClassString" >
89- < span class = " upload-item-plus" >
90- < i class = " @AddIcon" >< / i >
91- < / span >
92- < / div >
88+ < i class = " @AddIcon" >< / i >
9389 < / div > ;
9490}
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public partial class CardUpload<TValue>
3434
3535 private string ? GetDeleteButtonDisabledString ( UploadFile item ) => ( ! IsDisabled && item . Uploaded ) ? null : "disabled" ;
3636
37- private string ? CardItemClass => CssBuilder . Default ( "upload-item" )
37+ private string ? CardItemClass => CssBuilder . Default ( "upload-item upload-item-plus btn-browser upload-drop-body " )
3838 . AddClass ( "disabled" , IsDisabled )
3939 . Build ( ) ;
4040
@@ -116,10 +116,6 @@ public partial class CardUpload<TValue>
116116 [ Parameter ]
117117 public List < string > ? AllowExtensions { get ; set ; }
118118
119- private string ? ActionClassString => CssBuilder . Default ( "upload-item-actions" )
120- . AddClass ( "btn-browser" , IsDisabled == false )
121- . Build ( ) ;
122-
123119 /// <summary>
124120 /// <inheritdoc/>
125121 /// </summary>
Original file line number Diff line number Diff line change 77 <BootstrapLabel required =" @Required" for =" @Id" ShowLabelTooltip =" ShowLabelTooltip" Value =" @DisplayText" />
88}
99<div @attributes =" @AdditionalAttributes" class =" @ClassString" id =" @Id" >
10- <div class =" input-group" >
10+ <div class =" input-group upload-drop-body " >
1111 <input type =" text" class =" @InputValueClassString" disabled =" @Disabled" readonly
1212 placeholder =" @PlaceHolder" value =" @CurrentValueAsString" />
1313 @if (ShowDeleteButton )
Original file line number Diff line number Diff line change 9393 display : flex ;
9494 flex-wrap : wrap ;
9595 gap : 1rem ;
96+ position : relative ;
9697}
9798
9899.upload .upload-body.is-avatar .upload-item {
135136}
136137
137138.upload .upload-body.is-avatar .upload-item .upload-item-actions ,
138- .upload .upload-body.is-card .upload-item .upload-item-actions > .upload-item-plus {
139- position : absolute ;
140- top : 0 ;
141- left : 0 ;
142- right : 0 ;
143- bottom : 0 ;
139+ .upload .upload-body.is-avatar .upload-item-plus ,
140+ .upload .upload-body.is-card .upload-item-plus {
144141 display : flex ;
145142 align-items : center ;
146143 justify-content : center ;
147144}
148145
146+ .upload .upload-body.is-avatar .upload-item .upload-item-actions {
147+ position : absolute ;
148+ inset : 0 ;
149+ }
150+
149151.upload .upload-body.is-avatar .upload-item .upload-item-actions i {
150152 font-size : 1rem ;
151153}
Original file line number Diff line number Diff line change @@ -48,7 +48,8 @@ export function init(id) {
4848 inputFile . files = fileList
4949 const event = new Event ( 'change' , { bubbles : true } )
5050 inputFile . dispatchEvent ( event )
51- } catch ( e ) {
51+ }
52+ catch ( e ) {
5253 console . error ( e )
5354 }
5455 } )
@@ -112,9 +113,10 @@ export function dispose(id) {
112113 EventHandler . off ( document , 'dragover' , preventHandler )
113114
114115 EventHandler . off ( el , 'click' )
115- EventHandler . off ( el , 'drop' )
116116 EventHandler . off ( el , 'paste' )
117- EventHandler . off ( inputFile , 'change' )
117+
118+ EventHandler . off ( inputFile , 'change' ) ;
119+
118120 EventHandler . off ( body , 'dragleave' )
119121 EventHandler . off ( body , 'drop' )
120122 EventHandler . off ( body , 'dragenter' )
Original file line number Diff line number Diff line change @@ -80,12 +80,11 @@ await cut.InvokeAsync(() => input.Instance.OnChange.InvokeAsync(new InputFileCha
8080 var button = cut . Find ( ".upload-item-delete" ) ;
8181 await cut . InvokeAsync ( ( ) => button . Click ( ) ) ;
8282
83- cut . Contains ( "upload-item-actions btn-browser" ) ;
83+ cut . Contains ( "btn-browser" ) ;
8484 cut . SetParametersAndRender ( pb =>
8585 {
8686 pb . Add ( a => a . IsDisabled , true ) ;
8787 } ) ;
88- cut . Contains ( "upload-item-actions" ) ;
8988
9089 // IsUploadButtonAtFirst
9190 cut . SetParametersAndRender ( pb =>
You can’t perform that action at this time.
0 commit comments