diff options
Diffstat (limited to 'Pages/Component/Dialog.razor')
| -rw-r--r-- | Pages/Component/Dialog.razor | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/Pages/Component/Dialog.razor b/Pages/Component/Dialog.razor index 8e8ddca..ac05515 100644 --- a/Pages/Component/Dialog.razor +++ b/Pages/Component/Dialog.razor @@ -30,6 +30,14 @@ public int HeightPixels { set => height = $"{value}px"; } [Parameter] public int HeightPercent { set => height = $"{value}%"; } + [Parameter] + public int MinHeightPixels { set => minHeight = $"{value}px"; } + [Parameter] + public int MinHeightPercent { set => minHeight = $"{value}%"; } + [Parameter] + public int MaxHeightPixels { set => maxHeight = $"{value}px"; } + [Parameter] + public int MaxHeightPercent { set => maxHeight = $"{value}%"; } public bool Visible { get => visible; @@ -45,6 +53,8 @@ private string? width; private string? height; + private string? minHeight; + private string? maxHeight; private ElementReference dialogDiv; @@ -68,11 +78,19 @@ } } - private string sizeStyle => widthStyle + heightStyle; + private string sizeStyle => string.Join("", new[] { + widthStyle, heightStyle, minHeightStyle, maxHeightStyle + }); private string widthStyle => $"{(width is null ? "" : $"width:{width};")}"; private string heightStyle => - $"{(height is null ? "" : $"max-height:{height};")}"; + $"{(height is null ? "" : $"height:{height};")}"; + + private string minHeightStyle => + $"{(minHeight is null ? "" : $"min-height:{minHeight};")}"; + + private string maxHeightStyle => + $"{(maxHeight is null ? "" : $"max-height:{maxHeight};")}"; } |
