-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
416 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@inject IBlazorStrap _blazorStrap | ||
|
||
<BSModal @ref="_modal"> | ||
<Header>You are about to do something</Header> | ||
<Content>Are you sure you want to do something?</Content> | ||
<Footer Context="modal"> | ||
<BSButton MarginStart="Margins.Auto" Color="BSColor.Secondary" @onclick="@(() => modal.HideAsync(false))">Cancel</BSButton> | ||
<BSButton Color="BSColor.Primary" @onclick="@(() => modal.HideAsync(true))">Ok</BSButton> | ||
</Footer> | ||
</BSModal> | ||
<BSButton Color="BSColor.Primary" OnClick="ShowModalAsync">Do something</BSButton> | ||
|
||
@code { | ||
|
||
BSModal _modal = null!; | ||
|
||
private async Task ShowModalAsync() | ||
{ | ||
var confirmed = await _modal.ShowAsync(true); | ||
if(confirmed) | ||
{ | ||
_blazorStrap.Toaster.Add("Modal Confirmed", o => | ||
{ | ||
o.Color = BSColor.Success; | ||
o.HasIcon = true; | ||
o.CloseAfter = 5000; | ||
}); | ||
} | ||
else | ||
{ | ||
_blazorStrap.Toaster.Add("Modal Cancelled", o => | ||
{ | ||
o.Color = BSColor.Danger; | ||
o.HasIcon = true; | ||
o.CloseAfter = 5000; | ||
}); | ||
} | ||
} | ||
} |
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,77 @@ | ||
@inject IBlazorStrap _blazorStrap | ||
<BSToaster /> | ||
<BSButton IsOutlined="true" Color="BSColor.Primary" DataId="delconfirm" OnClick="ShowAsync">Fake Delete</BSButton> | ||
<BSPopover Placement="Placement.Top" Target="delconfirm" ContentAlwaysRendered="false" @ref="_popover" NoClickEvent="true"> | ||
<Header>Delete Confirmation</Header> | ||
<Content Context="popover"> | ||
<div class="d-flex flex-column"> | ||
<div>Are you sure you want to delete this file?</div> | ||
<div class="text-center"> | ||
<BSButton Color="BSColor.Danger" OnClick="()=>popover.HideAsync(true)">Yes</BSButton> | ||
<BSButton Color="BSColor.Secondary" OnClick="()=>popover.HideAsync(false)">No</BSButton> | ||
</div> | ||
</div> | ||
</Content> | ||
</BSPopover> | ||
<BSButton IsOutlined="true" Color="BSColor.Primary" DataId="dynamicdelconfirm" OnClick="ShowDynamicAsync">Fake Delete Dynamic</BSButton> | ||
<BSPopover @ref="_dynamicPopover"> | ||
<Content Context="popover"> | ||
<div class="d-flex flex-column"> | ||
<div>Are you sure you want to delete this file?</div> | ||
<div class="text-center"> | ||
<BSButton Color="BSColor.Danger" OnClick="()=>popover.HideAsync(true)">Yes</BSButton> | ||
<BSButton Color="BSColor.Secondary" OnClick="()=>popover.HideAsync(false)">No</BSButton> | ||
</div> | ||
</div> | ||
</Content> | ||
</BSPopover> | ||
@code | ||
{ | ||
private BSPopover _popover; | ||
private BSPopover _dynamicPopover; | ||
|
||
private async Task ShowDynamicAsync() | ||
{ | ||
var result = await _dynamicPopover.ShowAsync(true, "dynamicdelconfirm", null, Placement.Top, "Delete Confirmation"); | ||
if (result) | ||
{ | ||
_blazorStrap.Toaster.Add("Fake File Deleted", o => | ||
{ | ||
o.Color = BSColor.Success; | ||
o.HasIcon = true; | ||
o.CloseAfter = 3000; | ||
}); | ||
} | ||
else | ||
{ | ||
_blazorStrap.Toaster.Add("Fake File Not Deleted", o => | ||
{ | ||
o.Color = BSColor.Danger; | ||
o.HasIcon = true; | ||
o.CloseAfter = 3000; | ||
}); | ||
} | ||
} | ||
private async Task ShowAsync() | ||
{ | ||
var result = await _popover.ShowAsync(true); | ||
if (result) | ||
{ | ||
_blazorStrap.Toaster.Add("Fake File Deleted", o => | ||
{ | ||
o.Color = BSColor.Success; | ||
o.HasIcon = true; | ||
o.CloseAfter = 3000; | ||
}); | ||
} | ||
else | ||
{ | ||
_blazorStrap.Toaster.Add("Fake File Not Deleted", o => | ||
{ | ||
o.Color = BSColor.Danger; | ||
o.HasIcon = true; | ||
o.CloseAfter = 3000; | ||
}); | ||
} | ||
} | ||
} |
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,39 @@ | ||
@inject IBlazorStrap _blazorStrap | ||
|
||
<BSModal @ref="_modal"> | ||
<Header>You are about to do something</Header> | ||
<Content>Are you sure you want to do something?</Content> | ||
<Footer Context="modal"> | ||
<BSButton MarginStart="Margins.Auto" Color="BSColor.Secondary" @onclick="@(() => modal.HideAsync(false))">Cancel</BSButton> | ||
<BSButton Color="BSColor.Primary" @onclick="@(() => modal.HideAsync(true))">Ok</BSButton> | ||
</Footer> | ||
</BSModal> | ||
<BSButton Color="BSColor.Primary" OnClick="ShowModalAsync">Do something</BSButton> | ||
|
||
@code { | ||
|
||
BSModal _modal = null!; | ||
|
||
private async Task ShowModalAsync() | ||
{ | ||
var confirmed = await _modal.ShowAsync(true); | ||
if(confirmed) | ||
{ | ||
_blazorStrap.Toaster.Add("Modal Confirmed", o => | ||
{ | ||
o.Color = BSColor.Success; | ||
o.HasIcon = true; | ||
o.CloseAfter = 5000; | ||
}); | ||
} | ||
else | ||
{ | ||
_blazorStrap.Toaster.Add("Modal Cancelled", o => | ||
{ | ||
o.Color = BSColor.Danger; | ||
o.HasIcon = true; | ||
o.CloseAfter = 5000; | ||
}); | ||
} | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
docs/VNext/docs/Samples/V5/Components/Popover/Popover3 - Copy.md
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,20 @@ | ||
<BSButton IsOutlined="true" Color="BSColor.Primary" DataId="contentpopoverLeft">Left</BSButton> | ||
<BSPopover Placement="Placement.Left" Target="contentpopoverLeft" ContentAlwaysRendered="false"> | ||
<Header>Left</Header> | ||
<Content>To the left</Content> | ||
</BSPopover> | ||
<BSButton IsOutlined="true" Color="BSColor.Primary" DataId="contentpopoverTop">Top</BSButton> | ||
<BSPopover Placement="Placement.Top" Target="contentpopoverTop" MouseOver="true" ContentAlwaysRendered="false"> | ||
<Header>Top</Header> | ||
<Content>Up top</Content> | ||
</BSPopover> | ||
<BSButton IsOutlined="true" Color="BSColor.Primary" DataId="contentpopoverBottom">Bottom</BSButton> | ||
<BSPopover Placement="Placement.Bottom" Target="contentpopoverBottom" ContentAlwaysRendered="false"> | ||
<Header>Bottom</Header> | ||
<Content>Down below</Content> | ||
</BSPopover> | ||
<BSButton IsOutlined="true" Color="BSColor.Primary" DataId="contentpopoverRight">Right</BSButton> | ||
<BSPopover Placement="Placement.Right" Target="contentpopoverRight" ContentAlwaysRendered="false"> | ||
<Header>Right</Header> | ||
<Content>To the right</Content> | ||
</BSPopover> |
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,77 @@ | ||
@inject IBlazorStrap _blazorStrap | ||
<BSToaster /> | ||
<BSButton IsOutlined="true" Color="BSColor.Primary" DataId="delconfirm" OnClick="ShowAsync">Fake Delete</BSButton> | ||
<BSPopover Placement="Placement.Top" Target="delconfirm" ContentAlwaysRendered="false" @ref="_popover" NoClickEvent="true"> | ||
<Header>Delete Confirmation</Header> | ||
<Content Context="popover"> | ||
<div class="d-flex flex-column"> | ||
<div>Are you sure you want to delete this file?</div> | ||
<div class="text-center"> | ||
<BSButton Color="BSColor.Danger" OnClick="()=>popover.HideAsync(true)">Yes</BSButton> | ||
<BSButton Color="BSColor.Secondary" OnClick="()=>popover.HideAsync(false)">No</BSButton> | ||
</div> | ||
</div> | ||
</Content> | ||
</BSPopover> | ||
<BSButton IsOutlined="true" Color="BSColor.Primary" DataId="dynamicdelconfirm" OnClick="ShowDynamicAsync">Fake Delete Dynamic</BSButton> | ||
<BSPopover @ref="_dynamicPopover"> | ||
<Content Context="popover"> | ||
<div class="d-flex flex-column"> | ||
<div>Are you sure you want to delete this file?</div> | ||
<div class="text-center"> | ||
<BSButton Color="BSColor.Danger" OnClick="()=>popover.HideAsync(true)">Yes</BSButton> | ||
<BSButton Color="BSColor.Secondary" OnClick="()=>popover.HideAsync(false)">No</BSButton> | ||
</div> | ||
</div> | ||
</Content> | ||
</BSPopover> | ||
@code | ||
{ | ||
private BSPopover _popover; | ||
private BSPopover _dynamicPopover; | ||
|
||
private async Task ShowDynamicAsync() | ||
{ | ||
var result = await _dynamicPopover.ShowAsync(true, "dynamicdelconfirm", null, Placement.Top, "Delete Confirmation"); | ||
if (result) | ||
{ | ||
_blazorStrap.Toaster.Add("Fake File Deleted", o => | ||
{ | ||
o.Color = BSColor.Success; | ||
o.HasIcon = true; | ||
o.CloseAfter = 3000; | ||
}); | ||
} | ||
else | ||
{ | ||
_blazorStrap.Toaster.Add("Fake File Not Deleted", o => | ||
{ | ||
o.Color = BSColor.Danger; | ||
o.HasIcon = true; | ||
o.CloseAfter = 3000; | ||
}); | ||
} | ||
} | ||
private async Task ShowAsync() | ||
{ | ||
var result = await _popover.ShowAsync(true); | ||
if (result) | ||
{ | ||
_blazorStrap.Toaster.Add("Fake File Deleted", o => | ||
{ | ||
o.Color = BSColor.Success; | ||
o.HasIcon = true; | ||
o.CloseAfter = 3000; | ||
}); | ||
} | ||
else | ||
{ | ||
_blazorStrap.Toaster.Add("Fake File Not Deleted", o => | ||
{ | ||
o.Color = BSColor.Danger; | ||
o.HasIcon = true; | ||
o.CloseAfter = 3000; | ||
}); | ||
} | ||
} | ||
} |
77 changes: 77 additions & 0 deletions
77
src/BlazorStrap-Docs/Samples/V4/Components/Popover/Popover4.razor
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,77 @@ | ||
@inject IBlazorStrap _blazorStrap | ||
<BSToaster /> | ||
<BSButton IsOutlined="true" Color="BSColor.Primary" DataId="delconfirm" OnClick="ShowAsync">Fake Delete</BSButton> | ||
<BSPopover Placement="Placement.Top" Target="delconfirm" ContentAlwaysRendered="false" @ref="_popover" NoClickEvent="true"> | ||
<Header>Delete Confirmation</Header> | ||
<Content Context="popover"> | ||
<div class="d-flex flex-column"> | ||
<div>Are you sure you want to delete this file?</div> | ||
<div class="text-center"> | ||
<BSButton Color="BSColor.Danger" OnClick="()=>popover.HideAsync(true)">Yes</BSButton> | ||
<BSButton Color="BSColor.Secondary" OnClick="()=>popover.HideAsync(false)">No</BSButton> | ||
</div> | ||
</div> | ||
</Content> | ||
</BSPopover> | ||
<BSButton IsOutlined="true" Color="BSColor.Primary" DataId="dynamicdelconfirm" OnClick="ShowDynamicAsync">Fake Delete Dynamic</BSButton> | ||
<BSPopover @ref="_dynamicPopover"> | ||
<Content Context="popover"> | ||
<div class="d-flex flex-column"> | ||
<div>Are you sure you want to delete this file?</div> | ||
<div class="text-center"> | ||
<BSButton Color="BSColor.Danger" OnClick="()=>popover.HideAsync(true)">Yes</BSButton> | ||
<BSButton Color="BSColor.Secondary" OnClick="()=>popover.HideAsync(false)">No</BSButton> | ||
</div> | ||
</div> | ||
</Content> | ||
</BSPopover> | ||
@code | ||
{ | ||
private BSPopover _popover; | ||
private BSPopover _dynamicPopover; | ||
|
||
private async Task ShowDynamicAsync() | ||
{ | ||
var result = await _dynamicPopover.ShowAsync(true, "dynamicdelconfirm", null, Placement.Top, "Delete Confirmation"); | ||
if (result) | ||
{ | ||
_blazorStrap.Toaster.Add("Fake File Deleted", o => | ||
{ | ||
o.Color = BSColor.Success; | ||
o.HasIcon = true; | ||
o.CloseAfter = 3000; | ||
}); | ||
} | ||
else | ||
{ | ||
_blazorStrap.Toaster.Add("Fake File Not Deleted", o => | ||
{ | ||
o.Color = BSColor.Danger; | ||
o.HasIcon = true; | ||
o.CloseAfter = 3000; | ||
}); | ||
} | ||
} | ||
private async Task ShowAsync() | ||
{ | ||
var result = await _popover.ShowAsync(true); | ||
if (result) | ||
{ | ||
_blazorStrap.Toaster.Add("Fake File Deleted", o => | ||
{ | ||
o.Color = BSColor.Success; | ||
o.HasIcon = true; | ||
o.CloseAfter = 3000; | ||
}); | ||
} | ||
else | ||
{ | ||
_blazorStrap.Toaster.Add("Fake File Not Deleted", o => | ||
{ | ||
o.Color = BSColor.Danger; | ||
o.HasIcon = true; | ||
o.CloseAfter = 3000; | ||
}); | ||
} | ||
} | ||
} |
Oops, something went wrong.