Skip to content

Commit c19e42f

Browse files
committed
PDFileModal: Added configurable Height, OpenButtonIconCssClass, and SaveButtonIconCssClass parameters. Fixed file explorer not filling available space when toolbar is hidden.
1 parent 6d95a27 commit c19e42f

4 files changed

Lines changed: 29 additions & 15 deletions

File tree

PanoramicData.Blazor/PDFileModal.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
HideOnBackgroundClick="HideOnBackgroundClick"
77
Size="Size">
88

9-
<div class="pdfilemodalexplorer">
9+
<div class="pdfilemodalexplorer" style="height: @Height">
1010
<PDFileExplorer @ref="FileExplorer"
1111
DataProvider="DataProvider"
1212
AllowDrag="false"

PanoramicData.Blazor/PDFileModal.razor.cs

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@ public partial class PDFileModal
3434
/// </summary>
3535
[Parameter] public string[] ExcludedPaths { get; set; } = [];
3636

37+
/// <summary>
38+
/// Gets or sets the CSS height of the file explorer area.
39+
/// </summary>
40+
[Parameter] public string Height { get; set; } = "400px";
41+
3742
/// <summary>
3843
/// A function to get the CSS class for a given file explorer item.
3944
/// </summary>
@@ -44,11 +49,21 @@ public partial class PDFileModal
4449
/// </summary>
4550
[Parameter] public string OpenButtonText { get; set; } = "Open";
4651

52+
/// <summary>
53+
/// Gets or sets the icon CSS class for the 'Open' button.
54+
/// </summary>
55+
[Parameter] public string OpenButtonIconCssClass { get; set; } = "fas fa-fw fa-folder-open";
56+
4757
/// <summary>
4858
/// Gets or sets the text for the 'Save' button.
4959
/// </summary>
5060
[Parameter] public string SaveButtonText { get; set; } = "Save";
5161

62+
/// <summary>
63+
/// Gets or sets the icon CSS class for the 'Save' button.
64+
/// </summary>
65+
[Parameter] public string SaveButtonIconCssClass { get; set; } = "fas fa-fw fa-save";
66+
5267
/// <summary>
5368
/// Gets or sets whether to show the context menu in the file explorer.
5469
/// </summary>
@@ -147,9 +162,9 @@ public async Task ShowOpenAsync(bool folderSelect = false, string filenamePatter
147162
_okButton.Text = OpenButtonText;
148163
}
149164

150-
if (_okButton.IconCssClass != "fas fa-fw fa-folder-open")
165+
if (_okButton.IconCssClass != OpenButtonIconCssClass)
151166
{
152-
_okButton.IconCssClass = "fas fa-fw fa-folder-open";
167+
_okButton.IconCssClass = OpenButtonIconCssClass;
153168
}
154169

155170
StateHasChanged();
@@ -190,9 +205,9 @@ public async Task<string> ShowOpenAndWaitResultAsync(bool folderSelect = false,
190205
_okButton.Text = OpenButtonText;
191206
}
192207

193-
if (_okButton.IconCssClass != "fas fa-fw fa-folder-open")
208+
if (_okButton.IconCssClass != OpenButtonIconCssClass)
194209
{
195-
_okButton.IconCssClass = "fas fa-fw fa-folder-open";
210+
_okButton.IconCssClass = OpenButtonIconCssClass;
196211
}
197212

198213
StateHasChanged();
@@ -237,9 +252,9 @@ public async Task ShowSaveAsAsync(string initialFilename = "", string filenamePa
237252
_okButton.Text = SaveButtonText;
238253
}
239254

240-
if (_okButton.IconCssClass != "fas fa-fw fa-save")
255+
if (_okButton.IconCssClass != SaveButtonIconCssClass)
241256
{
242-
_okButton.IconCssClass = "fas fa-fw fa-save";
257+
_okButton.IconCssClass = SaveButtonIconCssClass;
243258
}
244259

245260
StateHasChanged();
@@ -282,9 +297,9 @@ public async Task<string> ShowSaveAsAndWaitResultAsync(string initialFilename =
282297
_okButton.Text = SaveButtonText;
283298
}
284299

285-
if (_okButton.IconCssClass != "fas fa-fw fa-save")
300+
if (_okButton.IconCssClass != SaveButtonIconCssClass)
286301
{
287-
_okButton.IconCssClass = "fas fa-fw fa-save";
302+
_okButton.IconCssClass = SaveButtonIconCssClass;
288303
}
289304

290305
StateHasChanged();
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
.pdfilemodalexplorer
1+
.pdfilemodalexplorer .pdfileexplorer
22
{
3-
height: 400px;
3+
height: 100%;
44
}
55

6-
.pdfilemodalexplorer .pdfileexplorer
6+
.pdfilemodalexplorer .pdfileexplorer ::deep .pdsplitter
77
{
8-
height: 100%;
8+
flex-grow: 1;
99
}

PanoramicData.Blazor/PanoramicData.Blazor.csproj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
2828
<PackageReadmeFile>README.md</PackageReadmeFile>
2929
<PackageReleaseNotes>
30-
PDDashboard: optional name row above tabs; display-mode header with dashboard/tab name and rotation controls (pause/resume, prev/next); properties editor in settings dialog; view-mode per-session property overrides (AllowViewModePropertyEdit); fix EffectiveProperties cascade.
31-
PDSplitterDocumentation: fix example to use PDSplitPanel children; correct parameters table.
30+
- PDFileModal: Added configurable Height, OpenButtonIconCssClass, and SaveButtonIconCssClass parameters. Fixed file explorer not filling available space when toolbar is hidden.
3231
</PackageReleaseNotes>
3332
</PropertyGroup>
3433

0 commit comments

Comments
 (0)