Browse Source

Upgarde to ABP 9.1.3&Antblazor 1.4.0

pull/41/head 0.9.7
liangshiwei 9 months ago
parent
commit
f21ac53fa0
  1. 2
      common.props
  2. 2
      modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorServerComponentBundleManager.cs
  3. 2
      modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Layout/AbpPageHeader.razor
  4. 2
      modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/PageToolbars/PageToolbarExtensions.cs
  5. 8
      modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/DefaultLayout.razor
  6. 4
      modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/MainMenuItem.razor
  7. 4
      modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/Pages/RoleNameComponent.razor
  8. 11
      samples/BookStore/src/BookStore.BlazorServer/yarn.lock
  9. 25
      samples/BookStore/src/BookStore.EntityFrameworkCore/Migrations/20250516090951_initial.Designer.cs
  10. 9
      samples/BookStore/src/BookStore.EntityFrameworkCore/Migrations/20250516090951_initial.cs
  11. 21
      samples/BookStore/src/BookStore.EntityFrameworkCore/Migrations/BookStoreDbContextModelSnapshot.cs
  12. 2
      src/Lsw.Abp.AntDesignUI/AntDesignUiNotificationService.cs
  13. 25
      src/Lsw.Abp.AntDesignUI/AntDesignUiObjectExtensionPropertyInfoExtensions.cs
  14. 14
      src/Lsw.Abp.AntDesignUI/Components/AbpExtensibleDataGrid.razor
  15. 2
      src/Lsw.Abp.AntDesignUI/Components/EntityAction.razor.cs
  16. 2
      src/Lsw.Abp.AntDesignUI/Components/EntityActions.razor.cs
  17. 9
      src/Lsw.Abp.AntDesignUI/Components/PageAlert.razor
  18. 2
      src/Lsw.Abp.AntDesignUI/Components/ToolbarButton.razor

2
common.props

@ -1,7 +1,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<LangVersion>latest</LangVersion> <LangVersion>latest</LangVersion>
<Version>0.9.6</Version> <Version>0.9.7</Version>
<PackageIconUrl>https://raw.githubusercontent.com/realliangshiwei/Lsw.Abp.AntDesignUI/main/icon.png</PackageIconUrl> <PackageIconUrl>https://raw.githubusercontent.com/realliangshiwei/Lsw.Abp.AntDesignUI/main/icon.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/realLiangshiwei/Lsw.Abp.AntDesignUI</PackageProjectUrl> <PackageProjectUrl>https://github.com/realLiangshiwei/Lsw.Abp.AntDesignUI</PackageProjectUrl>
<PackageLicenseExpression>MIT</PackageLicenseExpression> <PackageLicenseExpression>MIT</PackageLicenseExpression>

2
modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme/Bundling/BlazorServerComponentBundleManager.cs

@ -2,7 +2,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.Bundling; using Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme.Bundling;
using Volo.Abp.AspNetCore.Mvc.UI.Bundling; using Volo.Abp.AspNetCore.Bundling;
using Volo.Abp.DependencyInjection; using Volo.Abp.DependencyInjection;
namespace Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme.Bundling; namespace Lsw.Abp.AspnetCore.Components.Server.AntDesignTheme.Bundling;

2
modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Layout/AbpPageHeader.razor

@ -29,7 +29,7 @@
<Col Span="12"> <Col Span="12">
@if (Options.Value.RenderToolbar) @if (Options.Value.RenderToolbar)
{ {
<Row justify="end"> <Row Justify="RowJustify.End">
@if (Toolbar == null) @if (Toolbar == null)
{ {
@ChildContent @ChildContent

2
modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/PageToolbars/PageToolbarExtensions.cs

@ -46,7 +46,7 @@ public static class PageToolbarExtensions
string text, string text,
Func<Task> clicked, Func<Task> clicked,
object icon = null, object icon = null,
string color = ButtonType.Primary, ButtonType color = ButtonType.Primary,
bool disabled = false, bool disabled = false,
int order = 0, int order = 0,
string requiredPolicyName = null) string requiredPolicyName = null)

8
modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/DefaultLayout.razor

@ -10,7 +10,7 @@
<Header Class="@HeaderClass"> <Header Class="@HeaderClass">
<Branding/> <Branding/>
<MainMenu Placement="@MenuPlacement" Theme="@MenuTheme" Collapsed="@Collapsed"/> <MainMenu Placement="@MenuPlacement" Theme="@MenuTheme" Collapsed="@Collapsed"/>
<Row Justify="end"> <Row Justify="RowJustify.End">
<NavToolbar/> <NavToolbar/>
</Row> </Row>
</Header> </Header>
@ -42,15 +42,15 @@ else
<div style="float: left"> <div style="float: left">
@if (Collapsed) @if (Collapsed)
{ {
<Icon Type="menu-unfold" Theme="outline" Class="trigger" OnClick="OnCollapse"/> <Icon Type="menu-unfold" Theme="IconThemeType.Outline" Class="trigger" OnClick="OnCollapse"/>
} }
else else
{ {
<Icon Type="menu-fold" Theme="outline" Class="trigger" OnClick="OnCollapse"/> <Icon Type="menu-fold" Theme="IconThemeType.Outline" Class="trigger" OnClick="OnCollapse"/>
} }
</div> </div>
<Row Justify="end"> <Row Justify="RowJustify.End">
<NavToolbar/> <NavToolbar/>
</Row> </Row>

4
modules/AntDesignTheme/Lsw.Abp.AspnetCore.Components.Web.AntDesignTheme/Themes/AntDesignTheme/MainMenuItem.razor

@ -10,7 +10,7 @@
<MenuItem Key="@elementId" RouterLink="@url" Disabled="@Menu.IsDisabled"> <MenuItem Key="@elementId" RouterLink="@url" Disabled="@Menu.IsDisabled">
@if (!Menu.Icon.IsNullOrWhiteSpace()) @if (!Menu.Icon.IsNullOrWhiteSpace())
{ {
<Icon Type="@Menu.Icon" Theme="outline"></Icon> <Icon Type="@Menu.Icon" Theme="IconThemeType.Outline"></Icon>
} }
<span>@Menu.DisplayName</span> <span>@Menu.DisplayName</span>
</MenuItem> </MenuItem>
@ -33,7 +33,7 @@
return @<span> return @<span>
@if (!Menu.Icon.IsNullOrWhiteSpace()) @if (!Menu.Icon.IsNullOrWhiteSpace())
{ {
<Icon Type="@Menu.Icon" Theme="outline"></Icon> <Icon Type="@Menu.Icon" Theme="IconThemeType.Outline"></Icon>
} }
<span>@menu.DisplayName</span> <span>@menu.DisplayName</span>
</span>; </span>;

4
modules/IdentityManagement/Lsw.Abp.IdentityManagement.Blazor.AntDesignUI/Pages/RoleNameComponent.razor

@ -9,14 +9,14 @@
@if (Data.As<IdentityRoleDto>().IsDefault) @if (Data.As<IdentityRoleDto>().IsDefault)
{ {
<Badge Dot="true" <Badge Dot="true"
Status="success" Status="BadgeStatus.Success"
Style="margin-left: 0.25rem" Style="margin-left: 0.25rem"
Text="@L["DisplayName:IsDefault"]"/> Text="@L["DisplayName:IsDefault"]"/>
} }
@if (Data.As<IdentityRoleDto>().IsPublic) @if (Data.As<IdentityRoleDto>().IsPublic)
{ {
<Badge Dot="true" <Badge Dot="true"
Status="processing" Status="BadgeStatus.Processing"
Style="margin-left: 0.25rem" Style="margin-left: 0.25rem"
Text="@L["DisplayName:IsPublic"]"/> Text="@L["DisplayName:IsPublic"]"/>
} }

11
samples/BookStore/src/BookStore.BlazorServer/yarn.lock

@ -213,11 +213,6 @@
resolved "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.7.1.tgz" resolved "https://registry.npmjs.org/@fortawesome/fontawesome-free/-/fontawesome-free-6.7.1.tgz"
integrity sha512-ALIk/MOh5gYe1TG/ieS5mVUsk7VUIJTJKPMK9rFFqOgfp0Q3d5QiBXbcOMwUvs37fyZVCz46YjOE6IFeOAXCHA== integrity sha512-ALIk/MOh5gYe1TG/ieS5mVUsk7VUIJTJKPMK9rFFqOgfp0Q3d5QiBXbcOMwUvs37fyZVCz46YjOE6IFeOAXCHA==
"@popperjs/core@^2.11.8":
version "2.11.8"
resolved "https://registry.npmjs.org/@popperjs/core/-/core-2.11.8.tgz"
integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A==
ansi-colors@^4.1.3: ansi-colors@^4.1.3:
version "4.1.3" version "4.1.3"
resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz" resolved "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz"
@ -251,7 +246,7 @@ datatables.net-bs5@^2.1.8:
datatables.net "2.1.8" datatables.net "2.1.8"
jquery ">=1.7" jquery ">=1.7"
datatables.net@^2.1.8, datatables.net@2.1.8: datatables.net@2.1.8, datatables.net@^2.1.8:
version "2.1.8" version "2.1.8"
resolved "https://registry.npmjs.org/datatables.net/-/datatables.net-2.1.8.tgz" resolved "https://registry.npmjs.org/datatables.net/-/datatables.net-2.1.8.tgz"
integrity sha512-47ULt+U4bcjbuGTpTlT6SnCuSFVRBxxdWa6X3NfvTObBJ2BZU0o+JUIl05wQ6cABNIavjbAV51gpgvFsMHL9zA== integrity sha512-47ULt+U4bcjbuGTpTlT6SnCuSFVRBxxdWa6X3NfvTObBJ2BZU0o+JUIl05wQ6cABNIavjbAV51gpgvFsMHL9zA==
@ -278,12 +273,12 @@ jquery-validation-unobtrusive@^4.0.0:
jquery "^3.6.0" jquery "^3.6.0"
jquery-validation ">=1.19" jquery-validation ">=1.19"
jquery-validation@^1.21.0, jquery-validation@>=1.19: jquery-validation@>=1.19, jquery-validation@^1.21.0:
version "1.21.0" version "1.21.0"
resolved "https://registry.npmjs.org/jquery-validation/-/jquery-validation-1.21.0.tgz" resolved "https://registry.npmjs.org/jquery-validation/-/jquery-validation-1.21.0.tgz"
integrity sha512-xNot0rlUIgu7duMcQ5qb6MGkGL/Z1PQaRJQoZAURW9+a/2PGOUxY36o/WyNeP2T9R6jvWB8Z9lUVvvQWI/Zs5w== integrity sha512-xNot0rlUIgu7duMcQ5qb6MGkGL/Z1PQaRJQoZAURW9+a/2PGOUxY36o/WyNeP2T9R6jvWB8Z9lUVvvQWI/Zs5w==
"jquery@^1.7 || ^2.0 || ^3.1", jquery@^3.6.0, jquery@>=1.10, jquery@>=1.12.0, "jquery@>=1.5.0 <4.0", jquery@>=1.7, jquery@>=1.7.2, "jquery@>=3.4.0 <4.0.0", jquery@~3.7.1: jquery@>=1.10, jquery@>=1.12.0, "jquery@>=1.5.0 <4.0", jquery@>=1.7, jquery@>=1.7.2, "jquery@>=3.4.0 <4.0.0", jquery@^3.6.0, jquery@~3.7.1:
version "3.7.1" version "3.7.1"
resolved "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz" resolved "https://registry.npmjs.org/jquery/-/jquery-3.7.1.tgz"
integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg== integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg==

25
samples/BookStore/src/BookStore.EntityFrameworkCore/Migrations/20240706082705_Initial.Designer.cs → samples/BookStore/src/BookStore.EntityFrameworkCore/Migrations/20250516090951_initial.Designer.cs

@ -13,8 +13,8 @@ using Volo.Abp.EntityFrameworkCore;
namespace BookStore.Migrations namespace BookStore.Migrations
{ {
[DbContext(typeof(BookStoreDbContext))] [DbContext(typeof(BookStoreDbContext))]
[Migration("20240706082705_Initial")] [Migration("20250516090951_initial")]
partial class Initial partial class initial
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -22,7 +22,7 @@ namespace BookStore.Migrations
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("ProductVersion", "8.0.4") .HasAnnotation("ProductVersion", "9.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 128); .HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
@ -484,6 +484,10 @@ namespace BookStore.Migrations
.HasColumnType("nvarchar(40)") .HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp"); .HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<string>("Description") b.Property<string>("Description")
.HasMaxLength(256) .HasMaxLength(256)
.HasColumnType("nvarchar(256)"); .HasColumnType("nvarchar(256)");
@ -558,6 +562,10 @@ namespace BookStore.Migrations
.HasColumnType("nvarchar(40)") .HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp"); .HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<int>("EntityVersion") b.Property<int>("EntityVersion")
.HasColumnType("int"); .HasColumnType("int");
@ -721,9 +729,13 @@ namespace BookStore.Migrations
.HasMaxLength(64) .HasMaxLength(64)
.HasColumnType("nvarchar(64)"); .HasColumnType("nvarchar(64)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("IpAddresses") b.Property<string>("IpAddresses")
.HasMaxLength(256) .HasMaxLength(2048)
.HasColumnType("nvarchar(256)"); .HasColumnType("nvarchar(2048)");
b.Property<DateTime?>("LastAccessed") b.Property<DateTime?>("LastAccessed")
.HasColumnType("datetime2"); .HasColumnType("datetime2");
@ -1807,8 +1819,7 @@ namespace BookStore.Migrations
.HasMaxLength(200) .HasMaxLength(200)
.HasColumnType("nvarchar(200)"); .HasColumnType("nvarchar(200)");
b.Property<DateTime?>("Expiration") b.Property<DateTime>("Expiration")
.IsRequired()
.HasColumnType("datetime2"); .HasColumnType("datetime2");
b.Property<string>("ExtraProperties") b.Property<string>("ExtraProperties")

9
samples/BookStore/src/BookStore.EntityFrameworkCore/Migrations/20240706082705_Initial.cs → samples/BookStore/src/BookStore.EntityFrameworkCore/Migrations/20250516090951_initial.cs

@ -6,7 +6,7 @@ using Microsoft.EntityFrameworkCore.Migrations;
namespace BookStore.Migrations namespace BookStore.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class Initial : Migration public partial class initial : Migration
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)
@ -78,6 +78,7 @@ namespace BookStore.Migrations
RegexDescription = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true), RegexDescription = table.Column<string>(type: "nvarchar(128)", maxLength: 128, nullable: true),
Description = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), Description = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true),
ValueType = table.Column<int>(type: "int", nullable: false), ValueType = table.Column<int>(type: "int", nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false), ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false) ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false)
}, },
@ -243,6 +244,7 @@ namespace BookStore.Migrations
IsStatic = table.Column<bool>(type: "bit", nullable: false), IsStatic = table.Column<bool>(type: "bit", nullable: false),
IsPublic = table.Column<bool>(type: "bit", nullable: false), IsPublic = table.Column<bool>(type: "bit", nullable: false),
EntityVersion = table.Column<int>(type: "int", nullable: false), EntityVersion = table.Column<int>(type: "int", nullable: false),
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false), ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: false),
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false) ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: false)
}, },
@ -287,9 +289,10 @@ namespace BookStore.Migrations
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true),
UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false), UserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
ClientId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), ClientId = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true),
IpAddresses = table.Column<string>(type: "nvarchar(256)", maxLength: 256, nullable: true), IpAddresses = table.Column<string>(type: "nvarchar(2048)", maxLength: 2048, nullable: true),
SignedIn = table.Column<DateTime>(type: "datetime2", nullable: false), SignedIn = table.Column<DateTime>(type: "datetime2", nullable: false),
LastAccessed = table.Column<DateTime>(type: "datetime2", nullable: true) LastAccessed = table.Column<DateTime>(type: "datetime2", nullable: true),
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true)
}, },
constraints: table => constraints: table =>
{ {

21
samples/BookStore/src/BookStore.EntityFrameworkCore/Migrations/BookStoreDbContextModelSnapshot.cs

@ -19,7 +19,7 @@ namespace BookStore.Migrations
#pragma warning disable 612, 618 #pragma warning disable 612, 618
modelBuilder modelBuilder
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer) .HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.SqlServer)
.HasAnnotation("ProductVersion", "8.0.4") .HasAnnotation("ProductVersion", "9.0.5")
.HasAnnotation("Relational:MaxIdentifierLength", 128); .HasAnnotation("Relational:MaxIdentifierLength", 128);
SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder); SqlServerModelBuilderExtensions.UseIdentityColumns(modelBuilder);
@ -481,6 +481,10 @@ namespace BookStore.Migrations
.HasColumnType("nvarchar(40)") .HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp"); .HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<string>("Description") b.Property<string>("Description")
.HasMaxLength(256) .HasMaxLength(256)
.HasColumnType("nvarchar(256)"); .HasColumnType("nvarchar(256)");
@ -555,6 +559,10 @@ namespace BookStore.Migrations
.HasColumnType("nvarchar(40)") .HasColumnType("nvarchar(40)")
.HasColumnName("ConcurrencyStamp"); .HasColumnName("ConcurrencyStamp");
b.Property<DateTime>("CreationTime")
.HasColumnType("datetime2")
.HasColumnName("CreationTime");
b.Property<int>("EntityVersion") b.Property<int>("EntityVersion")
.HasColumnType("int"); .HasColumnType("int");
@ -718,9 +726,13 @@ namespace BookStore.Migrations
.HasMaxLength(64) .HasMaxLength(64)
.HasColumnType("nvarchar(64)"); .HasColumnType("nvarchar(64)");
b.Property<string>("ExtraProperties")
.HasColumnType("nvarchar(max)")
.HasColumnName("ExtraProperties");
b.Property<string>("IpAddresses") b.Property<string>("IpAddresses")
.HasMaxLength(256) .HasMaxLength(2048)
.HasColumnType("nvarchar(256)"); .HasColumnType("nvarchar(2048)");
b.Property<DateTime?>("LastAccessed") b.Property<DateTime?>("LastAccessed")
.HasColumnType("datetime2"); .HasColumnType("datetime2");
@ -1804,8 +1816,7 @@ namespace BookStore.Migrations
.HasMaxLength(200) .HasMaxLength(200)
.HasColumnType("nvarchar(200)"); .HasColumnType("nvarchar(200)");
b.Property<DateTime?>("Expiration") b.Property<DateTime>("Expiration")
.IsRequired()
.HasColumnType("datetime2"); .HasColumnType("datetime2");
b.Property<string>("ExtraProperties") b.Property<string>("ExtraProperties")

2
src/Lsw.Abp.AntDesignUI/AntDesignUiNotificationService.cs

@ -57,7 +57,7 @@ public class AntDesignUiNotificationService: IUiNotificationService, IScopedDepe
protected virtual async Task Notify(string title, string message, MessageType messageType) protected virtual async Task Notify(string title, string message, MessageType messageType)
{ {
await MessageService.Open(new MessageConfig await MessageService.OpenAsync(new MessageConfig
{ {
Content = message, Content = message,
Type = messageType Type = messageType

25
src/Lsw.Abp.AntDesignUI/AntDesignUiObjectExtensionPropertyInfoExtensions.cs

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.Linq; using System.Linq;
using AntDesign;
using Lsw.Abp.AntDesignUI.Components.ObjectExtending; using Lsw.Abp.AntDesignUI.Components.ObjectExtending;
using Volo.Abp.ObjectExtending; using Volo.Abp.ObjectExtending;
using Volo.Abp.Reflection; using Volo.Abp.Reflection;
@ -83,22 +84,22 @@ public static class AntDesignUiObjectExtensionPropertyInfoExtensions
return (T)value; return (T)value;
} }
public static string GetTextInputMode(this ObjectExtensionPropertyInfo propertyInfo) public static InputType GetTextInputMode(this ObjectExtensionPropertyInfo propertyInfo)
{ {
foreach (var attribute in propertyInfo.Attributes) foreach (var attribute in propertyInfo.Attributes)
{ {
var textRoleByAttribute = GetTextInputModeFromAttributeOrNull(attribute); var textRoleByAttribute = GetTextInputModeFromAttributeOrNull(attribute);
if (textRoleByAttribute != null) if (textRoleByAttribute != null)
{ {
return textRoleByAttribute; return textRoleByAttribute.Value;
} }
} }
return GetTextInputModeFromTypeOrNull(propertyInfo.Type) return GetTextInputModeFromTypeOrNull(propertyInfo.Type)
?? "text"; //default ?? InputType.Text; //default
} }
private static string GetTextInputModeFromTypeOrNull(Type type) private static InputType? GetTextInputModeFromTypeOrNull(Type type)
{ {
// if (TypeHelper.IsFloatingType(type)) // if (TypeHelper.IsFloatingType(type))
// { // {
@ -107,28 +108,28 @@ public static class AntDesignUiObjectExtensionPropertyInfoExtensions
if (NumberTypes.Contains(type)) if (NumberTypes.Contains(type))
{ {
return "number"; return InputType.Number;
} }
return null; return null;
} }
private static string GetTextInputModeFromAttributeOrNull(Attribute attribute) private static InputType? GetTextInputModeFromAttributeOrNull(Attribute attribute)
{ {
if (attribute is EmailAddressAttribute) if (attribute is EmailAddressAttribute)
{ {
return "email"; return InputType.Email;
} }
if (attribute is UrlAttribute) if (attribute is UrlAttribute)
{ {
return "url"; return InputType.Url;
} }
if (attribute is PhoneAttribute) if (attribute is PhoneAttribute)
{ {
return "tel"; return InputType.Tel;
} }
if (attribute is DataTypeAttribute dataTypeAttribute) if (attribute is DataTypeAttribute dataTypeAttribute)
@ -136,11 +137,11 @@ public static class AntDesignUiObjectExtensionPropertyInfoExtensions
switch (dataTypeAttribute.DataType) switch (dataTypeAttribute.DataType)
{ {
case DataType.EmailAddress: case DataType.EmailAddress:
return "email"; return InputType.Email;
case DataType.Url: case DataType.Url:
return "url"; return InputType.Url;
case DataType.PhoneNumber: case DataType.PhoneNumber:
return "tel"; return InputType.Tel;
} }
} }

14
src/Lsw.Abp.AntDesignUI/Components/AbpExtensibleDataGrid.razor

@ -20,14 +20,14 @@
{ {
if (column.Actions.Any()) if (column.Actions.Any())
{ {
<Column TData="object" Title="@column.Title" Fixed="right"> <Column TData="object" Title="@column.Title" Fixed="ColumnFixPlacement.Right">
<EntityActions TItem="TItem"> <EntityActions TItem="TItem">
@foreach (var action in column.Actions) @foreach (var action in column.Actions)
{ {
if (action.ConfirmationMessage != null) if (action.ConfirmationMessage != null)
{ {
<EntityAction TItem="TItem" <EntityAction TItem="TItem"
Color="@(action.Color != null ? action.Color.ToString() : ButtonType.Primary)" Color="@(action.Color != null ? (ButtonType)action.Color : ButtonType.Primary)"
Icon="@action.Icon" Icon="@action.Icon"
Clicked="async () => await action.Clicked(context)" Clicked="async () => await action.Clicked(context)"
ConfirmationMessage="() => action.ConfirmationMessage.Invoke(context)" ConfirmationMessage="() => action.ConfirmationMessage.Invoke(context)"
@ -40,7 +40,7 @@
{ {
<EntityAction TItem="TItem" <EntityAction TItem="TItem"
Clicked="async () => await action.Clicked(context)" Clicked="async () => await action.Clicked(context)"
Color="@(action.Color != null ? action.Color.ToString() : ButtonType.Default)" Color="@(action.Color != null ? (ButtonType)action.Color : ButtonType.Default)"
Icon="@action.Icon" Icon="@action.Icon"
Visible="@(action.Visible?.Invoke(context) ?? true)" Visible="@(action.Visible?.Invoke(context) ?? true)"
Text="@action.Text" Text="@action.Text"
@ -83,15 +83,15 @@
var entity = context as IHasExtraProperties; var entity = context as IHasExtraProperties;
var propertyName = ExtensionPropertiesRegex.Match(column.Data).Groups[1].Value; var propertyName = ExtensionPropertiesRegex.Match(column.Data).Groups[1].Value;
var propertyValue = entity.GetProperty(propertyName); var propertyValue = entity.GetProperty(propertyName);
if (propertyValue is bool) if (propertyValue is bool value)
{ {
if ((bool) propertyValue) if (value)
{ {
<Icon Type="check" Theme="outline"/> <Icon Type="check" Theme="IconThemeType.Outline"/>
} }
else else
{ {
<Icon Type="close" Theme="outline"/> <Icon Type="close" Theme="IconThemeType.Outline"/>
} }
} }
else else

2
src/Lsw.Abp.AntDesignUI/Components/EntityAction.razor.cs

@ -24,7 +24,7 @@ public partial class EntityAction<TItem> : ComponentBase
public string Icon { get; set; } public string Icon { get; set; }
[Parameter] [Parameter]
public string Color { get; set; } = ButtonType.Default; public ButtonType Color { get; set; } = ButtonType.Default;
[Parameter] [Parameter]
public bool Primary { get; set; } public bool Primary { get; set; }

2
src/Lsw.Abp.AntDesignUI/Components/EntityActions.razor.cs

@ -23,7 +23,7 @@ public partial class EntityActions<TItem> : ComponentBase
public bool Disabled { get; set; } = false; public bool Disabled { get; set; } = false;
[Parameter] [Parameter]
public string ToggleColor { get; set; } = ButtonType.Primary; public ButtonType ToggleColor { get; set; } = ButtonType.Primary;
[Parameter] [Parameter]
public string ToggleText { get; set; } public string ToggleText { get; set; }

9
src/Lsw.Abp.AntDesignUI/Components/PageAlert.razor

@ -1,10 +1,11 @@
@using Volo.Abp.AspNetCore.Components.Alerts @using Volo.Abp.AspNetCore.Components.Alerts
@using System.Collections.Specialized @using System.Collections.Specialized
@using Microsoft.AspNetCore.Components.Routing @using Microsoft.AspNetCore.Components.Routing
@using AlertType = AntDesign.AlertType
@foreach (var message in _messages) @foreach (var message in _messages)
{ {
<Alert Type="@message.Type.ToString().ToLower()" <Alert Type="@GetAlertType(message)"
Message="@message.Title" Message="@message.Title"
Description="@message.Text" Description="@message.Text"
ShowIcon="true" ShowIcon="true"
@ -47,5 +48,9 @@
} }
InvokeAsync(StateHasChanged); InvokeAsync(StateHasChanged);
} }
private AlertType GetAlertType(AlertMessage message)
{
return Enum.Parse<AlertType>(message.Type.ToString());
}
} }

2
src/Lsw.Abp.AntDesignUI/Components/ToolbarButton.razor

@ -9,7 +9,7 @@
@code { @code {
[Parameter] [Parameter]
public string Color { get; set; } = ButtonType.Default; public ButtonType Color { get; set; } = ButtonType.Default;
[Parameter] [Parameter]
public string Icon { get; set; } public string Icon { get; set; }

Loading…
Cancel
Save