Codeer.LowCode.Blazor の拡張 Field ライブラリ。標準の Bootstrap ベースコンポーネントを Microsoft Fluent UI Blazor コンポーネントに置き換える。
- Version: 0.7.0
- Target: .NET 8.0
- Base Library: Codeer.LowCode.Blazor (現在 v1.2.49)
- UI Library: Microsoft.FluentUI.AspNetCore.Components (現在 v4.14.0)
- Standard Library Source (参照用):
C:\tfs\codeer\Codeer.LowCode.Blazor
Designs/FluentXxxFieldDesign.cs → 標準の XxxFieldDesign を継承
Components/FluentXxxFieldComponent.razor → FluentFieldComponentBase<TField, TDesign> を継承
Search/FluentXxxComponent.razor → 検索用コンポーネント (該当する型のみ)
[IgnoreBaseProperties(nameof(Variant), nameof(Icon))] // Fluent で不要なプロパティを隠す
public class FluentXxxFieldDesign : XxxFieldDesign
{
public FluentXxxFieldDesign() => TypeFullName = typeof(FluentXxxFieldDesign).FullName!;
public override string GetWebComponentTypeFullName() => typeof(FluentXxxFieldComponent).FullName!;
public override string GetSearchWebComponentTypeFullName() => typeof(FluentXxxComponent).FullName!;
[Designer] // Fluent 固有プロパティ
public Appearance Appearance { get; set; }
}@inherits FluentFieldComponentBase<XxxField, FluentXxxFieldDesign>
@if (IsViewMode) {
<FluentLabel>@ViewOnlyValue</FluentLabel>
} else {
<FluentTextField @bind-Value:get="@Value" @bind-Value:set="@OnValueChanged" ... />
}
@code {
private bool IsDisabled => Field.IsEnabled == false;
private bool IsViewMode => Field.IsViewOnly;
// Field.Services.AppInfoService.Localize() でローカライズ
// Field.Services.AppInfoService.IsDesignMode でデザインモード判定
}// NG: Field.Localize() は internal - 外部アセンブリからアクセス不可
// OK:
Field.Services.AppInfoService.Localize(text)以下は Codeer.LowCode.Blazor の internal メソッドなので直接呼べない:
Field.Localize()→Field.Services.AppInfoService.Localize()を使うField.GetRowCount()→Field.Design.Rows ?? 3を使うLabelField.IsRequired()→ 関連フィールドを自前で確認するロジックを実装
FluentUI v4.11 以降、Icons は別名前空間。_Imports.razor に以下が必要:
@using Icons = Microsoft.FluentUI.AspNetCore.Components.IconsFluentSlider<TValue> は nullable 型を受け付けない (INumber<T> 制約)。
decimal? → decimal に変換してバインドする必要がある。
# ソリューション全体ビルド
dotnet build Codeer.LowCode.Bindings.Fluent.Blazor.sln
# メインライブラリのみ
dotnet build Codeer.LowCode.Bindings.Fluent.Blazor/Codeer.LowCode.Bindings.Fluent.Blazor.csprojNuGet パッケージはビルド時に自動生成 (GeneratePackageOnBuild: True)。
- NuGet 更新:
Codeer.LowCode.Blazorのバージョンを上げる - 標準コンポーネントとの差分確認: 各フィールドの標準実装を読み、変更点を特定
- 標準コンポーネント:
C:\tfs\codeer\Codeer.LowCode.Blazor\Source\Codeer.LowCode.Blazor\Components\Fields\ - 標準検索コンポーネント:
C:\tfs\codeer\Codeer.LowCode.Blazor\Source\Codeer.LowCode.Blazor\Components\Search\
- 標準コンポーネント:
- Design クラスの確認: 新しいプロパティが追加された場合、
[IgnoreBaseProperties]の更新要否を確認 - ビルド検証: 全プロジェクトでビルドエラーがないことを確認
- Example プロジェクト: 標準の Example (
C:\tfs\codeer\...\Source\App\) と差分確認
MaintenanceDocs/ フォルダに詳細情報あり:
ComponentMapping.md- 全コンポーネントの対応表と実装状況StandardDifferences.md- 標準との既知の差異・制約事項ProjectStructure.md- ファイル構成の詳細
Codeer.LowCode.Bindings.Fluent.Blazor/
├── _Imports.razor # グローバル using
├── Components/ # 15 フィールドコンポーネント
├── Designs/ # 15 デザインクラス
├── Search/ # 8 検索コンポーネント
├── Infrastructure/ # FluentFieldComponentBase.cs (基底クラス)
├── Internal/ # DateTimeHelper.cs, InternalFluentToggleButton
├── Extensions/ # FieldDesignExtension.cs, StringExtension.cs
├── Installer/ # FluentInstaller.razor
└── Properties/ # Resource.resx, Resource.ja-JP.resx
- C# インデント: 4スペース
- Razor/JSON: 2スペース
- 改行: CRLF
- Nullable: enable
- ImplicitUsings: enable
- コンポーネント内のコードは
@code {}に記述 (コードビハインド不使用)