-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored components code behind, added observable models concept
- Loading branch information
Showing
21 changed files
with
462 additions
and
309 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,80 @@ | ||
@using FormBuilder.Models | ||
|
||
@if (Field is not null) | ||
{ | ||
<RadzenStack class="@ContainerClass" Orientation="Orientation.Vertical"> | ||
<RadzenFormField Text="ID"> | ||
<RadzenTextBox @bind-Value="Field.Name" Disabled="true"/> | ||
<RadzenStack class="@ContainerClass" Orientation="Orientation.Vertical"> | ||
<RadzenFormField Text="ID"> | ||
<RadzenTextBox Value="@Field.Name" Disabled="true"/> | ||
</RadzenFormField> | ||
<RadzenFormField Text="Input Type"> | ||
<RadzenDropDown | ||
TValue="FieldType" | ||
@bind-Value="InputType" | ||
Data="_inputTypes" | ||
TextProperty="Text" | ||
ValueProperty="Value"> | ||
</RadzenDropDown> | ||
</RadzenFormField> | ||
<RadzenFormField Text="Label"> | ||
<RadzenTextBox @bind-Value="@Field.Label"/> | ||
</RadzenFormField> | ||
<RadzenFormField Text="Placeholder" AllowFloatingLabel="false"> | ||
<RadzenTextBox @bind-Value="@Field.Placeholder"/> | ||
</RadzenFormField> | ||
<RadzenFormField Text="Hint" AllowFloatingLabel="false"> | ||
<RadzenTextBox @bind-Value="@Field.Hint"/> | ||
</RadzenFormField> | ||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem" AlignItems="AlignItems.Center"> | ||
<RadzenLabel Text="Read only" Component="ReadOnlyInput"/> | ||
<RadzenSwitch Name="ReadOnlyInput" @bind-Value="Field.ReadOnly"/> | ||
</RadzenStack> | ||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem" AlignItems="AlignItems.Center"> | ||
<RadzenLabel Text="Disabled" Component="DisabledInput"/> | ||
<RadzenSwitch Name="DisabledInput" @bind-Value="@Field.Disabled"/> | ||
</RadzenStack> | ||
|
||
@if (Field is NumericField<int> numericIntField) | ||
{ | ||
<NumericFieldEditor Field="numericIntField"/> | ||
} | ||
@if (Field is NumericField<decimal> numericDecimalField) | ||
{ | ||
<NumericFieldEditor Field="numericDecimalField"/> | ||
} | ||
|
||
@if (Field is DateField dateField) | ||
{ | ||
<RadzenFormField Text="Date Format"> | ||
<RadzenTextBox @bind-Value="@dateField.DateFormat"/> | ||
</RadzenFormField> | ||
<RadzenFormField Text="Input Type"> | ||
} | ||
|
||
@if (Field is SelectField selectField) | ||
{ | ||
<RadzenFormField Text="List ID"> | ||
<RadzenDropDown | ||
TValue="FieldType" | ||
@bind-Value="InputType" | ||
Data="_inputTypes" | ||
TextProperty="Text" | ||
ValueProperty="Value"> | ||
TValue="int?" | ||
@bind-Value="SelectedListId" | ||
Data="_listIds" | ||
Count="@_listIdCount" | ||
LoadData="LoadListIdValuesAsync" | ||
AllowVirtualization="true" | ||
AllowFiltering="true" | ||
AllowClear="true"> | ||
</RadzenDropDown> | ||
</RadzenFormField> | ||
<RadzenFormField Text="Label"> | ||
<RadzenTextBox @bind-Value="Label"/> | ||
</RadzenFormField> | ||
<RadzenFormField Text="Placeholder" AllowFloatingLabel="false"> | ||
<RadzenTextBox @bind-Value="Placeholder"/> | ||
</RadzenFormField> | ||
<RadzenFormField Text="Hint" AllowFloatingLabel="false"> | ||
<RadzenTextBox @bind-Value="Field.Hint"/> | ||
</RadzenFormField> | ||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem" AlignItems="AlignItems.Center"> | ||
<RadzenLabel Text="Read only" Component="ReadOnlyInput"/> | ||
<RadzenSwitch Name="ReadOnlyInput" @bind-Value="@ReadOnly"/> | ||
</RadzenStack> | ||
<RadzenStack Orientation="Orientation.Horizontal" Gap="1rem" AlignItems="AlignItems.Center"> | ||
<RadzenLabel Text="Disabled" Component="DisabledInput"/> | ||
<RadzenSwitch Name="DisabledInput" @bind-Value="@Disabled"/> | ||
</RadzenStack> | ||
|
||
@if (Field is NumericField<int> numericIntField) | ||
{ | ||
<NumericFieldEditor Field="numericIntField"/> | ||
} | ||
@if (Field is NumericField<decimal> numericDecimalField) | ||
{ | ||
<NumericFieldEditor Field="numericDecimalField"/> | ||
} | ||
|
||
@if (Field is DateField dateField) | ||
{ | ||
<RadzenFormField Text="Date Format"> | ||
<RadzenTextBox @bind-Value="dateField.DateFormat"></RadzenTextBox> | ||
</RadzenFormField> | ||
} | ||
|
||
@if (Field is SelectField) | ||
@if (selectField.ListId is not null) | ||
{ | ||
<RadzenFormField Text="List ID"> | ||
<RadzenFormField Text="List Values"> | ||
<RadzenDropDown | ||
@bind-Value="SelectedListId" | ||
Data="_listIds" | ||
Count="@_listIdCount" | ||
LoadData="LoadListIdValuesAsync" | ||
AllowVirtualization="true" | ||
TValue="string" | ||
Data="_listValues" | ||
Disabled="ListValuesLoading" | ||
AllowFiltering="true" | ||
AllowClear="true"> | ||
</RadzenDropDown> | ||
</RadzenFormField> | ||
|
||
@if (SelectedListId is not null) | ||
{ | ||
<RadzenFormField Text="List Values"> | ||
<RadzenDropDown | ||
TValue="string" | ||
Data="_listValues" | ||
Disabled="ListValuesLoading" | ||
AllowFiltering="true" | ||
AllowClear="true"> | ||
</RadzenDropDown> | ||
</RadzenFormField> | ||
} | ||
} | ||
} | ||
|
||
<FieldValidatorsEditor @bind-Field="Field"/> | ||
</RadzenStack> | ||
} | ||
<FieldValidatorsEditor Field="Field"/> | ||
</RadzenStack> |
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.