mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-26 01:04:55 +08:00
Implement a new component called `d-multi-select` which allows to select multiple items.
It has the following features:
- accepts a `loadFn` to load data
- yield result to customise results
- yield selection to customise selection
Usage:
```gjs
<DMultiSelect
@loadFn={{this.loadData}}
@onChange={{this.onChange}}
@selection={{this.selection}}
>
<:selection as |item|>{{item.name}}</:selection>
<:result as |result|>{{result.name}}</:result>
</DMultiSelect>
```gjs
<ChatChannelMultiSelect
@onChange={{fn (mut this.selectedChannels)}}
@initialIds={{array 2}}
@selection={{this.selectedChannels}}
>
<:selection as |item|>{{item.name}}</:selection>
<:result as |result|>{{result.name}}</:result>
</ChatChannelMultiSelect>
|
||
|---|---|---|
| .. | ||
| images | ||
| javascripts | ||
| stylesheets | ||