feat(MatDIalog): Allow specifying MatDialogConfig as part of the dialog component
- 主要言語
- TypeScript
- スター
- 25k
- フォーク
- 6.8k
- 平均マージ
- 1日 8時間
- マージ済み PR(30日)
- 91
説明
### Feature Description
Currently if there is a dialog which is meant to be used with a specific width, height, autoFocus, disableClose, etc... each and every code that opens that dialog need to specify those values. Even if extracted to a const you still need to remember to pass it.
What I wish to have is the ability to specify on the dialog component itself those configuration options or at least some of them that make sense. Allowing to actually "declare" to the one using - If you pass nothing in the `open` function config - this is the recommended and default config for this specific dialog. If you do pass a config object it overrides the recommended one.
### Use Case
When having a dialog that needs for example to have `autoFocus` as false always as it handles it inside - everyone using that dialog has to remember to declare this specific config when opening otherwise the dialog won't work as expected. Even if it was extracted to a const - the one opening the dialog still needs to know that const exists and remember to pass it.
The suggestion allows the dialog creator to specify the default config.
コントリビューションガイド
調査の方向性
まず MatDialog と MatDialogConfig の API、および既存の issue の議論を確認します。ダイアログコンポーネントがデフォルト設定をどのように宣言するか、また open に指定された値がそれをどのように上書きするかを定義します。要求された default-config の動作が仕様化され、適切なテストでカバーされていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- angular, typescript
- 領域
- frontend
- issue の種類
- 機能追加
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100