parent
54da322cd0
commit
125fa85d6e
@ -1,49 +1,33 @@
|
||||
@page "/"
|
||||
@using Connected.Models;
|
||||
@using Connected.Components;
|
||||
@using Connected.Models.Modal;
|
||||
@using Connected.Services;
|
||||
|
||||
@inject ModalDialogService modalDialog;
|
||||
|
||||
|
||||
<h1 style="text-align:center;">Component Sandbox</h1>
|
||||
|
||||
<Grid>
|
||||
@for (int i = 0; i < 5; i++)
|
||||
{
|
||||
int num = i;
|
||||
<GridRow>
|
||||
<GridRowContent>
|
||||
Fixed content @num.ToString()
|
||||
</GridRowContent>
|
||||
<GridRowContent Collapsable=true>
|
||||
Collapsable content @num.ToString()
|
||||
</GridRowContent>
|
||||
</GridRow>
|
||||
}
|
||||
</Grid>
|
||||
|
||||
<p>Izbran datum je: @date</p>
|
||||
|
||||
<FormWizard Id="Wizard1">
|
||||
<FormWizardStep Name="Step1">
|
||||
Step1
|
||||
</FormWizardStep>
|
||||
<FormWizardStep Name="Step2">
|
||||
Step2
|
||||
</FormWizardStep>
|
||||
<FormWizardStep Name="Step3">
|
||||
Step3
|
||||
</FormWizardStep>
|
||||
<FormWizardStep Name="Step4">
|
||||
Step4
|
||||
</FormWizardStep>
|
||||
</FormWizard>
|
||||
<DatePicker
|
||||
CloseOnDateSelect=true
|
||||
@bind-SelectedDate=@date>
|
||||
|
||||
</DatePicker>
|
||||
|
||||
<p>Selected date is @date.ToString()</p>
|
||||
|
||||
<Button OnClick="OpenValueDialog">Open dialog</Button>
|
||||
|
||||
<ReturnModal ReturnType="int" @bind-Visible=@ResultDialogShown @bind-Value=@value Title="Dialog1">
|
||||
<NumberInput @bind-Value=@value></NumberInput>
|
||||
</ReturnModal>
|
||||
|
||||
<p>Modal value @value.ToString()</p>
|
||||
|
||||
|
||||
@code {
|
||||
DateTime date = DateTime.Today;
|
||||
|
||||
int value = 0;
|
||||
bool ResultDialogShown = false;
|
||||
|
||||
|
||||
private void OpenValueDialog()
|
||||
{
|
||||
ResultDialogShown = !ResultDialogShown;
|
||||
StateHasChanged();
|
||||
}
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
@typeparam ReturnType
|
||||
|
||||
@using Connected.Models.Modal;
|
||||
@if (Visible)
|
||||
{
|
||||
<div class="modal fade show" tabindex="-1">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-dialog-centered">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h3 class="modal-title">@Title</h3>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@ChildContent
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-sm btn-core" @onclick="@(()=>CloseModal())">Zapri</button>
|
||||
<button type="button" class="btn btn-sm btn-info" @onclick="@(()=>CloseModal(true))">Ok</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
Loading…
Reference in new issue