0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Added grouped and custom option support to <GhTokenInput>

no issue

- `<GhTokenInput>` is based around `<PowerSelect>` but using Power Select's grouped options feature didn't work because we weren't falling back to it's built-in group component
- updated the `<GhTokenInput>` template to use a supplied block as the option display rather than only displaying the option's label (allows for counts etc to be shown alongside dropdown options)
This commit is contained in:
Kevin Ansfield 2021-04-26 08:17:50 +01:00
parent 23428f3d01
commit a08c2dfe12

View file

@ -16,7 +16,7 @@
@disabled={{@disabled}}
@dropdownClass={{@dropdownClass}}
@extra={{@extra}}
@groupComponent={{@groupComponent}}
@groupComponent={{or @groupComponent "power-select/power-select-group"}}
@horizontalPosition={{@horizontalPosition}}
@initiallyOpened={{@initiallyOpened}}
@loadingMessage={{@loadingMessage}}
@ -59,6 +59,10 @@
{{#if option.__isSuggestion__}}
<GhTokenInput::SuggestedOption @option={{option}} />
{{else}}
{{get option this.labelField}}
{{#if (has-block)}}
{{yield option}}
{{else}}
{{get option this.labelField}}
{{/if}}
{{/if}}
</GhTokenInput::SelectMultiple>