DrawerContainer - Clipping fix
This commit is contained in:
		
							parent
							
								
									b01b4e42df
								
							
						
					
					
						commit
						9f1214fd9f
					
				| @ -152,7 +152,7 @@ public partial class Drawer : UIComponent, IDisposable, INavigationEventReceiver | ||||
| 	#region Styling properties | ||||
| 
 | ||||
| 	//old | ||||
| 	private CssBuilder CompiledClassList | ||||
| 	public CssBuilder CompiledClassList | ||||
| 	{ | ||||
| 		get | ||||
| 		{ | ||||
|  | ||||
| @ -24,10 +24,12 @@ public partial class DrawerContainer : UIComponent | ||||
| 
 | ||||
| 	private string GetDrawerClass(Drawer drawer) | ||||
| 	{ | ||||
| 		 | ||||
| 		if (drawer == null) | ||||
| 			return string.Empty; | ||||
| 	   else return drawer.CompiledClassList.Build(); | ||||
| 
 | ||||
| 		var className = $"drawer-{(drawer.Open ? "open" : "close")}-{drawer.Variant.ToDescription()}"; | ||||
| 		/*var className = $"drawer-{(drawer.Open ? "open" : "close")}-{drawer.Variant.ToDescription()}"; | ||||
| 		if (drawer.Variant is DrawerVariant.Responsive or DrawerVariant.Mini) | ||||
| 		{ | ||||
| 			className += $"-{drawer.Breakpoint.ToDescription()}"; | ||||
| @ -36,7 +38,7 @@ public partial class DrawerContainer : UIComponent | ||||
| 
 | ||||
| 		className += $"drawer-{drawer.GetPosition()}-clipped-{drawer.ClipMode.ToDescription()}"; | ||||
| 
 | ||||
| 		return className; | ||||
| 		return className;*/ | ||||
| 	} | ||||
| 
 | ||||
| 	private Drawer FindLeftDrawer() | ||||
|  | ||||
| @ -1,4 +1,4 @@ | ||||
| @namespace Connected.Components | ||||
| @inherits UIComponent | ||||
| 
 | ||||
| <img @attributes="CustomAttributes" src="@Src" alt="@Alt" class="@Classname" width="@Width" height="@Height"> | ||||
| <img @attributes="CustomAttributes" src="@Src" alt="@Alt" class="@CompiledClassList.Build()" width="@Width" height="@Height"> | ||||
| @ -11,68 +11,71 @@ namespace Connected.Components; | ||||
| 
 | ||||
| public partial class Image : UIComponent | ||||
| { | ||||
|    protected string Classname => | ||||
|       new CssBuilder("image") | ||||
| 
 | ||||
| 	private CssBuilder CompiledClassList | ||||
| 	{ | ||||
| 		get | ||||
| 		{ | ||||
| 			return new CssBuilder("image") | ||||
| 			.AddClass("fluid", Fluid) | ||||
| 			.AddClass($"object-{ObjectFit.ToDescription()}") | ||||
| 			.AddClass($"object-{ObjectPosition.ToDescription()}") | ||||
| 			.AddClass($"elevation-{Elevation}", Elevation > 0) | ||||
|          .AddClass(AdditionalClassList) | ||||
|          .Build(); | ||||
| 			.AddClass(ClassList); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
|    /// <summary> | ||||
|    /// Applies the fluid class so the image scales with the parent width. | ||||
|    /// </summary> | ||||
|    [Parameter] | ||||
|    [Category(CategoryTypes.Image.Behavior)] | ||||
|    public bool Fluid { get; set; } | ||||
| 
 | ||||
|    /// <summary> | ||||
|    /// Specifies the path to the image. | ||||
|    /// </summary> | ||||
|    [Parameter] | ||||
|    [Category(CategoryTypes.Image.Behavior)] | ||||
|    public string Src { get; set; } | ||||
| 
 | ||||
|    /// <summary> | ||||
|    /// Specifies an alternate text for the image. | ||||
|    /// </summary> | ||||
|    [Parameter] | ||||
|    [Category(CategoryTypes.Image.Behavior)] | ||||
|    public string Alt { get; set; } | ||||
| 
 | ||||
|    /// <summary> | ||||
|    /// Specifies the height of the image in px. | ||||
|    /// </summary> | ||||
|    [Parameter] | ||||
|    [Category(CategoryTypes.Image.Appearance)] | ||||
|    public int? Height { get; set; } | ||||
| 
 | ||||
|    /// <summary> | ||||
|    /// Specifies the width of the image in px. | ||||
|    /// </summary> | ||||
|    [Parameter] | ||||
|    [Category(CategoryTypes.Image.Appearance)] | ||||
|    public int? Width { get; set; } | ||||
| 
 | ||||
|    /// <summary> | ||||
|    /// The higher the number, the heavier the drop-shadow. | ||||
|    /// </summary> | ||||
|    [Parameter] | ||||
|    [Category(CategoryTypes.Image.Appearance)] | ||||
|    public int Elevation { set; get; } | ||||
| 
 | ||||
|    /// <summary> | ||||
|    /// Controls how the image should be resized. | ||||
|    /// </summary> | ||||
|    [Parameter] | ||||
|    [Category(CategoryTypes.Image.Appearance)] | ||||
|    public ObjectFit ObjectFit { set; get; } = ObjectFit.Fill; | ||||
| 
 | ||||
|    /// <summary> | ||||
|    /// Controls how the image should positioned within its container. | ||||
|    /// </summary> | ||||
|    [Parameter] | ||||
|    [Category(CategoryTypes.Image.Appearance)] | ||||
|    public Position ObjectPosition { set; get; } = Position.Center; | ||||
| 
 | ||||
| 	/// <summary> | ||||
| 	/// A space separated list of class names, added on top of the default class list. | ||||
| 	/// </summary> | ||||
| 	[Parameter] | ||||
| 	public string? ClassList { get; set; } | ||||
| } | ||||
|  | ||||
| @ -12,6 +12,7 @@ public partial class MainContent | ||||
| 				 .AddClass(ClassList); | ||||
| 		} | ||||
| 	} | ||||
| 
 | ||||
| 	[Parameter] | ||||
| 	public RenderFragment ChildContent { get; set; } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 stm
						stm