This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<configuration>
|
<configuration>
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
|
<add key="liara" value="https://package-mirror.liara.ir/repository/nuget/index.json" />
|
||||||
<add key="nuget.sabp.ir" value="https://nuget.sabp.ir/v3/index.json" />
|
<add key="nuget.sabp.ir" value="https://nuget.sabp.ir/v3/index.json" />
|
||||||
</packageSources>
|
</packageSources>
|
||||||
</configuration>
|
</configuration>
|
||||||
|
|||||||
@@ -1014,10 +1014,10 @@
|
|||||||
"Demo:ErrorHandlingNetworkErrorDesc": "HttpRequestException → UserExceptionInformer. يعرض \"خطأ الشبكة\" المترجم.",
|
"Demo:ErrorHandlingNetworkErrorDesc": "HttpRequestException → UserExceptionInformer. يعرض \"خطأ الشبكة\" المترجم.",
|
||||||
"Demo:ErrorHandlingSimulateNetwork": "محاكاة خطأ الشبكة",
|
"Demo:ErrorHandlingSimulateNetwork": "محاكاة خطأ الشبكة",
|
||||||
"Demo:ErrorHandlingShow404": "عرض الصفحة 404",
|
"Demo:ErrorHandlingShow404": "عرض الصفحة 404",
|
||||||
"Demo:ErrorHandlingShow404Desc": "التوجيه إلى مسار غير موجود → SpErrorPage (404). صفحة خطأ رسمية مع العودة للصفحة الرئيسية.",
|
"Demo:ErrorHandlingShow404Desc": "التوجيه إلى مسار غير موجود → SufiAbpErrorPage (404). صفحة خطأ رسمية مع العودة للصفحة الرئيسية.",
|
||||||
"Demo:ErrorHandlingShow404Button": "عرض الصفحة 404",
|
"Demo:ErrorHandlingShow404Button": "عرض الصفحة 404",
|
||||||
"Demo:ErrorHandlingShow403": "عرض الصفحة 403",
|
"Demo:ErrorHandlingShow403": "عرض الصفحة 403",
|
||||||
"Demo:ErrorHandlingShow403Desc": "التوجيه إلى مسار ممنوع → SpErrorPage (403). يتطلب دورًا لا يملكه أحد.",
|
"Demo:ErrorHandlingShow403Desc": "التوجيه إلى مسار ممنوع → SufiAbpErrorPage (403). يتطلب دورًا لا يملكه أحد.",
|
||||||
"Demo:ErrorHandlingShow403Button": "عرض الصفحة 403",
|
"Demo:ErrorHandlingShow403Button": "عرض الصفحة 403",
|
||||||
"Demo:ForbiddenDemoMessage": "إذا رأيت هذا، فلديك دور ForbiddenDemoRole (غير متوقع)."
|
"Demo:ForbiddenDemoMessage": "إذا رأيت هذا، فلديك دور ForbiddenDemoRole (غير متوقع)."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1013,10 +1013,10 @@
|
|||||||
"Demo:ErrorHandlingNetworkErrorDesc": "HttpRequestException → UserExceptionInformer. Shows localized \"Network error\".",
|
"Demo:ErrorHandlingNetworkErrorDesc": "HttpRequestException → UserExceptionInformer. Shows localized \"Network error\".",
|
||||||
"Demo:ErrorHandlingSimulateNetwork": "Simulate network error",
|
"Demo:ErrorHandlingSimulateNetwork": "Simulate network error",
|
||||||
"Demo:ErrorHandlingShow404": "Show 404 page",
|
"Demo:ErrorHandlingShow404": "Show 404 page",
|
||||||
"Demo:ErrorHandlingShow404Desc": "Navigate to non-existent route → SpErrorPage (404). Formal error page with Back to home, Go back.",
|
"Demo:ErrorHandlingShow404Desc": "Navigate to non-existent route → SufiAbpErrorPage (404). Formal error page with Back to home, Go back.",
|
||||||
"Demo:ErrorHandlingShow404Button": "Show 404 page",
|
"Demo:ErrorHandlingShow404Button": "Show 404 page",
|
||||||
"Demo:ErrorHandlingShow403": "Show 403 page",
|
"Demo:ErrorHandlingShow403": "Show 403 page",
|
||||||
"Demo:ErrorHandlingShow403Desc": "Navigate to forbidden route → SpErrorPage (403). Requires a role nobody has.",
|
"Demo:ErrorHandlingShow403Desc": "Navigate to forbidden route → SufiAbpErrorPage (403). Requires a role nobody has.",
|
||||||
"Demo:ErrorHandlingShow403Button": "Show 403 page",
|
"Demo:ErrorHandlingShow403Button": "Show 403 page",
|
||||||
"Demo:ForbiddenDemoMessage": "If you see this, you have the ForbiddenDemoRole (unexpected)."
|
"Demo:ForbiddenDemoMessage": "If you see this, you have the ForbiddenDemoRole (unexpected)."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1013,10 +1013,10 @@
|
|||||||
"Demo:ErrorHandlingNetworkErrorDesc": "HttpRequestException → UserExceptionInformer. «خطای شبکه» localized را نشان میدهد.",
|
"Demo:ErrorHandlingNetworkErrorDesc": "HttpRequestException → UserExceptionInformer. «خطای شبکه» localized را نشان میدهد.",
|
||||||
"Demo:ErrorHandlingSimulateNetwork": "شبیهسازی خطای شبکه",
|
"Demo:ErrorHandlingSimulateNetwork": "شبیهسازی خطای شبکه",
|
||||||
"Demo:ErrorHandlingShow404": "نمایش صفحه 404",
|
"Demo:ErrorHandlingShow404": "نمایش صفحه 404",
|
||||||
"Demo:ErrorHandlingShow404Desc": "مسیریابی به مسیر ناموجود → SpErrorPage (404). صفحه خطای رسمی با بازگشت به خانه، بازگشت.",
|
"Demo:ErrorHandlingShow404Desc": "مسیریابی به مسیر ناموجود → SufiAbpErrorPage (404). صفحه خطای رسمی با بازگشت به خانه، بازگشت.",
|
||||||
"Demo:ErrorHandlingShow404Button": "نمایش صفحه 404",
|
"Demo:ErrorHandlingShow404Button": "نمایش صفحه 404",
|
||||||
"Demo:ErrorHandlingShow403": "نمایش صفحه 403",
|
"Demo:ErrorHandlingShow403": "نمایش صفحه 403",
|
||||||
"Demo:ErrorHandlingShow403Desc": "مسیریابی به مسیر ممنوع → SpErrorPage (403). نیاز به نقشی دارد که هیچکس ندارد.",
|
"Demo:ErrorHandlingShow403Desc": "مسیریابی به مسیر ممنوع → SufiAbpErrorPage (403). نیاز به نقشی دارد که هیچکس ندارد.",
|
||||||
"Demo:ErrorHandlingShow403Button": "نمایش صفحه 403",
|
"Demo:ErrorHandlingShow403Button": "نمایش صفحه 403",
|
||||||
"Demo:ForbiddenDemoMessage": "اگر این را میبینید، نقش ForbiddenDemoRole را دارید (غیرمنتظره)."
|
"Demo:ForbiddenDemoMessage": "اگر این را میبینید، نقش ForbiddenDemoRole را دارید (غیرمنتظره)."
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,8 +36,16 @@
|
|||||||
|
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
// Register once when the option is first created
|
RegisterWithContext();
|
||||||
// The parent SbSimpleSelect maintains options without clearing them
|
}
|
||||||
|
|
||||||
|
protected override void OnParametersSet()
|
||||||
|
{
|
||||||
|
RegisterWithContext();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RegisterWithContext()
|
||||||
|
{
|
||||||
Context?.RegisterOption(new SbSelectOptionInfo<TValue>
|
Context?.RegisterOption(new SbSelectOptionInfo<TValue>
|
||||||
{
|
{
|
||||||
Value = Value,
|
Value = Value,
|
||||||
|
|||||||
@@ -196,7 +196,23 @@
|
|||||||
[Parameter]
|
[Parameter]
|
||||||
public string? Style { get; set; }
|
public string? Style { get; set; }
|
||||||
|
|
||||||
private bool HasValue => Value != null && !EqualityComparer<TValue>.Default.Equals(Value, default);
|
private bool HasValue
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (Value is null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof(TValue).IsEnum)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return !EqualityComparer<TValue>.Default.Equals(Value, default);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string IconClass => $"sb-select-trigger__icon{(_isOpen ? " sb-select-trigger__icon--open" : "")}";
|
private string IconClass => $"sb-select-trigger__icon{(_isOpen ? " sb-select-trigger__icon--open" : "")}";
|
||||||
|
|
||||||
@@ -204,13 +220,17 @@
|
|||||||
|
|
||||||
void ISbSelectOptionContext<TValue>.RegisterOption(SbSelectOptionInfo<TValue> option)
|
void ISbSelectOptionContext<TValue>.RegisterOption(SbSelectOptionInfo<TValue> option)
|
||||||
{
|
{
|
||||||
// Avoid duplicate registrations - options register once and stay registered
|
|
||||||
if (!_options.Any(o => EqualityComparer<TValue>.Default.Equals(o.Value, option.Value)))
|
if (!_options.Any(o => EqualityComparer<TValue>.Default.Equals(o.Value, option.Value)))
|
||||||
{
|
{
|
||||||
_options.Add(option);
|
_options.Add(option);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void OnParametersSet()
|
||||||
|
{
|
||||||
|
_options.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
private IEnumerable<SbSelectOptionInfo<TValue>> FilteredOptions
|
private IEnumerable<SbSelectOptionInfo<TValue>> FilteredOptions
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
|
|||||||
@@ -467,6 +467,8 @@ public static class SufiIcons
|
|||||||
$"<svg {SvgOutlineAttrs}><rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\"/><path d=\"M16 2v4M8 2v4M3 10h18\"/><path d=\"M9 16l2 2 4-4\"/></svg>"),
|
$"<svg {SvgOutlineAttrs}><rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\"/><path d=\"M16 2v4M8 2v4M3 10h18\"/><path d=\"M9 16l2 2 4-4\"/></svg>"),
|
||||||
["calendar-x"] = new("calendar-x", SiIconCategory.Time, "Calendar with cancel",
|
["calendar-x"] = new("calendar-x", SiIconCategory.Time, "Calendar with cancel",
|
||||||
$"<svg {SvgOutlineAttrs}><rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\"/><path d=\"M16 2v4M8 2v4M3 10h18\"/><path d=\"M10 14l4 4M14 14l-4 4\"/></svg>"),
|
$"<svg {SvgOutlineAttrs}><rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\"/><path d=\"M16 2v4M8 2v4M3 10h18\"/><path d=\"M10 14l4 4M14 14l-4 4\"/></svg>"),
|
||||||
|
["calendar-days"] = new("calendar-days", SiIconCategory.Time, "Calendar with day grid",
|
||||||
|
$"<svg {SvgOutlineAttrs}><path d=\"M8 2v4M16 2v4\"/><rect x=\"3\" y=\"4\" width=\"18\" height=\"18\" rx=\"2\"/><path d=\"M3 10h18\"/><path d=\"M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01M16 18h.01\"/></svg>"),
|
||||||
["repeat"] = new("repeat", SiIconCategory.Time, "Repeat or loop",
|
["repeat"] = new("repeat", SiIconCategory.Time, "Repeat or loop",
|
||||||
$"<svg {SvgOutlineAttrs}><polyline points=\"17 1 21 5 17 9\"/><path d=\"M3 11V9a4 4 0 014-4h14\"/><polyline points=\"7 23 3 19 7 15\"/><path d=\"M21 13v2a4 4 0 01-4 4H3\"/></svg>"),
|
$"<svg {SvgOutlineAttrs}><polyline points=\"17 1 21 5 17 9\"/><path d=\"M3 11V9a4 4 0 014-4h14\"/><polyline points=\"7 23 3 19 7 15\"/><path d=\"M21 13v2a4 4 0 01-4 4H3\"/></svg>"),
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user