angular / angular/components

feat(mat-selection-list): add slide toggle as alternative for checkbox

未关闭
#9,739 12 条评论 20 个 reaction 已指派 0 人 在 GitHub 查看
area: material/list feature P5
主要语言
TypeScript
星标
25k
派生
6.8k
平均合并
1 天 8 小时
30 天内合并 PR
91

描述

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

#### What is the expected behavior?
Option lists can have slide toggles instead of checkboxes, as you can see on Android OS.

#### What is the current behavior?
Option lists are only for checkboxes and if you want to create something that has the same look but has a slide toggle instead, you will have to implement by yourself.

#### What is the use-case or motivation for changing an existing behavior?
Its a very common option list format, very used on Android 5~6.

#### Which versions of Angular, Material, OS, TypeScript, browsers are affected?
Material 5.1

#### Is there anything else we should know?
You can find it in Material's guidelines:
![image](https://user-images.githubusercontent.com/3942006/35696636-21d3e79a-076f-11e8-80c3-59abdf6d00fd.png)
*(switches are very cute btw)*

Cute sidebar example:
![image](https://user-images.githubusercontent.com/3942006/35740701-c7f2f7d0-081c-11e8-8010-d2dd8838f66a.png)
*(inspired by Twitter's PWA, achieved with slide-toggle, mat-list and `::ng-deep`, that's a lot more than I expect to write)*

贡献指南

打开贡献指南

调研方向

首先检查 mat-selection-list 和 slide-toggle 组件,以及当前 option-list checkbox 行为的暴露方式。当 option lists 支持将 slide toggles 作为一种替代呈现方式,同时保留预期的选择行为,并为新选项提供覆盖时,这项工作就完成了。

由索引模型根据 Issue 内容生成。

评估

技术栈
angular, typescript
领域
frontend
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。