Skip to content

Commit

Permalink
Update VNext Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jbomhold3 committed Sep 6, 2024
1 parent edb03bd commit c15c2f8
Show file tree
Hide file tree
Showing 9 changed files with 416 additions and 1 deletion.
39 changes: 39 additions & 0 deletions docs/VNext/docs/Samples/V4/Components/Modal/Modal1b.md
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;
});
}
}
}
77 changes: 77 additions & 0 deletions docs/VNext/docs/Samples/V4/Components/Popover/Popover4.md
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;
});
}
}
}
39 changes: 39 additions & 0 deletions docs/VNext/docs/Samples/V5/Components/Modal/Modal1b.md
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 docs/VNext/docs/Samples/V5/Components/Popover/Popover3 - Copy.md
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>
77 changes: 77 additions & 0 deletions docs/VNext/docs/Samples/V5/Components/Popover/Popover4.md
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 src/BlazorStrap-Docs/Samples/V4/Components/Popover/Popover4.razor
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;
});
}
}
}
Loading

0 comments on commit c15c2f8

Please sign in to comment.