-
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Restructure of markup and overhaul of styling (#410)
* Initial rework of HTML with the addition of modal sizing * Fixed broken test and added new ones for Size feature * Fix for bubbling click events * Moved to isolated CSS. Renamed CSS classes. Simplified animations. * Fixed broken tests
- Loading branch information
1 parent
6d6a6e7
commit e1ee116
Showing
36 changed files
with
1,172 additions
and
429 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
@page "/size" | ||
|
||
<h1>Sizing the modal</h1> | ||
|
||
<hr class="mb-5" /> | ||
|
||
<p> | ||
The modal has a default width. However, this can be changed by setting the <code>Size</code> option. | ||
</p> | ||
<p> | ||
There are 5 different sizes available: | ||
<ul> | ||
<li>Small - 300px</li> | ||
<li>Medium - 500px (default)</li> | ||
<li>Large - 800px</li> | ||
<li>Extra Large - 1140px</li> | ||
<li>Custom - Provide your own class, via the <code>SizeCustomClass</code> parameter, which sets the width</li> | ||
</ul> | ||
</p> | ||
|
||
<div class="card mb-4"> | ||
<h5 class="card-header">Setting on a per modal basis</h5> | ||
<div class="card-body"> | ||
<p class="card-text"> | ||
<code> | ||
@("var options = new ModalOptions() { Size = ModalSize.Large };") | ||
<br /> | ||
@("Modal.Show<Confirm>(\"Size: Large\", options);") | ||
</code> | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div class="card mb-4"> | ||
<h5 class="card-header">Setting globally for all modals</h5> | ||
<div class="card-body"> | ||
<p class="card-text"> | ||
<code> | ||
@("<CascadingBlazoredModal Size=\"ModalSize.Large\" />") | ||
</code> | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<button @onclick="@(() => SetSize(ModalSize.Small))" class="btn btn-secondary">Small</button> | ||
<button @onclick="DefaultSize" class="btn btn-primary">Medium (default)</button> | ||
<button @onclick="@(() => SetSize(ModalSize.Large))" class="btn btn-secondary">Large</button> | ||
<button @onclick="@(() => SetSize(ModalSize.ExtraLarge))" class="btn btn-secondary">Extra Large</button> | ||
<button @onclick="@(() => SetSize(ModalSize.Custom))" class="btn btn-secondary">Custom</button> | ||
|
||
@code { | ||
|
||
[CascadingParameter] public IModalService Modal { get; set; } = default!; | ||
|
||
void DefaultSize() | ||
{ | ||
Modal.Show<Confirm>("Size: Medium (Default)"); | ||
} | ||
|
||
void SetSize(ModalSize size) | ||
{ | ||
var options = new ModalOptions { Size = size }; | ||
|
||
if (size == ModalSize.Custom) | ||
options.SizeCustomClass = "my-custom-size"; | ||
|
||
Modal.Show<Confirm>($"Size: {size}", options); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.