akveo / akveo/nebular

Replace 'multiple' property with 'isShowCheckbox' in NbOptionComponent to control it outside

未关闭
#1,965 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
enhancement module:components needs triage
主要语言
TypeScript
星标
8.1k
派生
1.5k
PR 合并指标
30 天内没有已合并 PR

描述

### Issue type

**I'm submitting a ...** (check one with "x")

* [ ] bug report
* [x] feature request

### Issue description

**Current behavior:**

NbOptionComponent has _multiple_ property, which determines whether option should be with checkbox (multiple select).
After adding new _autocomplete component_ (https://github.com/akveo/nebular/pull/1947) _parent_ property may not be set, because NbOptionComponent can be used in NbAutocompleteComponent, which doesn't have _multiple_ property. So now we have check on _multiple_ property getter.

**Expected behavior:**

Control of multiple select mode outside component via _isShowCheckbox_.

**Related code:**

```
get multiple() {
// We check parent existing because parent can be NbSelectComponent or
// NbAutocomplete and `miltiple` property exists only in NbSelectComponent
return this.parent ? (>this.parent).multiple : false;
}
```

**Angular, Nebular**
```
Angular: 8.0.0
Nebular 4.2.1
```

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

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