Merge pull request #3181 from sbwalker/dev
reverse InputList Dictionary usage
This commit is contained in:
commit
ee21536742
|
@ -1,12 +1,18 @@
|
|||
@namespace Oqtane.Modules.Controls
|
||||
@using System.Linq.Expressions;
|
||||
@inherits LocalizableComponent
|
||||
|
||||
<input type="text" value="@Value" list="@_id" class="form-select" @onchange="(e => OnChange(e))" />
|
||||
<input type="text" value="@Value" list="@_id" class="form-control" @onchange="(e => OnChange(e))" />
|
||||
<datalist id="@_id" value="@Value">
|
||||
@foreach(var kvp in DataList)
|
||||
{
|
||||
<option value="@kvp.Value">@Localize(kvp.Key, kvp.Key)</option>
|
||||
if (!string.IsNullOrEmpty(kvp.Value))
|
||||
{
|
||||
<option value="@kvp.Key">@Localize(kvp.Value, kvp.Value)</option>
|
||||
}
|
||||
else
|
||||
{
|
||||
<option value="@kvp.Key">@Localize(kvp.Key, kvp.Key)</option>
|
||||
}
|
||||
}
|
||||
</datalist>
|
||||
|
||||
|
@ -32,11 +38,13 @@
|
|||
|
||||
protected void OnChange(ChangeEventArgs e)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(e.Value.ToString())) { return; }
|
||||
Value = e.Value.ToString();
|
||||
if (ValueChanged.HasDelegate)
|
||||
if (!string.IsNullOrEmpty(e.Value.ToString()))
|
||||
{
|
||||
ValueChanged.InvokeAsync(Value);
|
||||
Value = e.Value.ToString();
|
||||
if (ValueChanged.HasDelegate)
|
||||
{
|
||||
ValueChanged.InvokeAsync(Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -117,6 +117,9 @@
|
|||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="Icon.AccountLogin" xml:space="preserve">
|
||||
<value>Account Login</value>
|
||||
</data>
|
||||
<data name="Icon.Home" xml:space="preserve">
|
||||
<value>Home</value>
|
||||
</data>
|
||||
|
|
|
@ -106,17 +106,7 @@ namespace Oqtane.Controllers
|
|||
{
|
||||
if (field.FieldType == typeof(string))
|
||||
{
|
||||
// add spacing between words based on capitalization
|
||||
var name = "";
|
||||
for (int index = 0; index < field.Name.Length; index++)
|
||||
{
|
||||
name += ((index > 0 && field.Name[index] == Char.ToUpper(field.Name[index])) ? " " : "") + field.Name[index];
|
||||
}
|
||||
|
||||
string fieldName = name;
|
||||
string fieldValue = (string)field.GetValue(null);
|
||||
|
||||
icons.Add(fieldName, fieldValue);
|
||||
icons.Add((string)field.GetValue(null), field.Name); // ie. ("oi oi-home", "Home")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user