feat(COMPONENT): Add matNoDataNode Directive to <mat-tree> for Handling Empty States
- 主要言語
- TypeScript
- スター
- 25k
- フォーク
- 6.8k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 91
説明
### Feature Description
Currently, Angular Material's component does not provide a built-in way to handle empty states (e.g., when the data source has no nodes). Developers must manually add conditional logic in their templates to display a "No records found" or similar message.
This feature request proposes adding a `matNoDataNode `directive to , similar to the `matNoDataRow `directive available for tables. The `matNoDataNode `directive would allow developers to define a template that is displayed when the tree's data source is empty.
Proposed Implementation:
- A new directive, `matNoDataNode`, that conditionally renders a template when the tree's data source is empty.
- Seamless integration with the existing mat-tree API, ensuring consistency with other Angular Material components.
### Use Case
he `matNoDataNode `directive would enable the following use cases:
1. Displaying a "No Records Found" Message
When a tree has no data, developers can use `matNoDataNode `to display a user-friendly message, such as "No records found" or "No data available."
Example:
```
{{ node.name }}
```
2. Custom Empty-State Templates
Developers can define custom templates for empty states, including icons, buttons, or additional instructions.
Example:
```
```
コントリビューションガイド
調査の方向性
まず、既存の mat-tree の実装とテーブルで使用されている matNoDataRow ディレクティブを探し、それらのテストで空のデータソースがどのようにカバーされているかを確認します。空および空でないデータに対するツリーの動作を定義し、ディレクティブとそのテストを追加して、ツリーにノードがない場合にのみテンプレートがレンダリングされることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular, typescript
- 領域
- frontend
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 30/100