angular / angular/components

[Table] Responsive stacking support

オープン
#8,494 コメント 35 件 リアクション 251 件 担当者 0 名 GitHub で見る
area: material/table feature needs: discussion P4
主要言語
TypeScript
スター
25k
フォーク
6.8k
平均マージ
1日 8時間
マージ済み PR(30日)
91

説明

#### Bug, feature request, or proposal:
feature request

#### What is the expected behavior?
I would like to be able to convert a CDK table into a stacked list. I want to do this through CSS media queries (i.e. when window size is narrow), and I also want to be able to do it through JavaScript (e.g., when the user clicks a button). The header cell contents should be displayed on each line instead of just at the top. E.g.,
```
Header 1 Header 2 Header 3 Header 4
1.1 1.2 1.3 1.4
2.1 2.2 2.3 2.4
```
becomes
```
Header 1 1.1
Header 2 1.2
Header 3 1.3
Header 4 1.4

Header 1 2.1
Header 2 2.2
Header 3 2.3
Header 4 2.4
```
and even
```
Header 1
1.1
Header 2
1.2
Header 3
1.3
Header 4
1.4

Header 1
2.1
Header 2
2.2
Header 3
2.3
Header 4
2.4
```
If this is already facilitated by the CDK, I would like to see an example of this feature in the docs.

#### What is the current behavior?
The two docs pages I am looking at (https://material.angular.io/guide/cdk-table and the link below) do not mention 'responsive' or 'stack', and there are no demonstrations of tables that stack.

From https://material.angular.io/components/table/overview
![image](https://user-images.githubusercontent.com/3712209/32919968-d78590e2-cae4-11e7-8699-1f0f6c7c481b.png)

#### What are the steps to reproduce?
Go to https://material.angular.io/components/table/overview on a small mobile browser or, with a desktop browser, resize the window to be narrow (e.g., 760px wide).

#### What is the use-case or motivation for changing an existing behavior?
1) There are groups where I work, and no doubt at many other organizations, that do not want to use a table library that does not offer this feature.
2) The need for this feature is evidenced by its existence in other solutions, such as PrimeNG datatable https://www.primefaces.org/primeng/#/datatable/responsive and https://css-tricks.com/responsive-data-tables/

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
N/A

#### Is there anything else we should know?
This is a restatement of https://github.com/angular/material2/issues/6608, trying to follow the advice of @jelbourn.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Issue にリンクされている CDK table guide と Material table overview から始め、要求されている CSS および JavaScript で制御されるスタック型レイアウトを、既存のテーブル動作と比較します。完了条件には、レスポンシブなスタック表示、ヘッダーセルの内容の繰り返し、そしてその機能がすでに存在する場合のドキュメントまたはデモンストレーションが含まれます。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
angular, typescript
領域
frontend
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。