FEATURE: replaces tag-chooser/tag-group-chooser with select-kit component

These component were also the last using select2. As a consequence select2 is removed from Discourse in this commit.
This commit is contained in:
Joffrey JAFFEUX
2018-02-26 11:42:57 +01:00
committed by GitHub
parent a9699da672
commit ac701696b3
53 changed files with 637 additions and 4970 deletions

View File

@@ -0,0 +1,50 @@
{{#component headerComponent
tabindex=tabindex
isFocused=isFocused
isExpanded=isExpanded
computedContent=headerComputedContent
deselect=(action "deselect")
toggle=(action "toggle")
clearSelection=(action "clearSelection")
options=headerComponentOptions
}}
{{component filterComponent
icon=filterIcon
placeholder=filterPlaceholder
filter=filter
hasSelection=hasSelection
isLoading=isLoading
shouldDisplayFilter=shouldDisplayFilter
isFocused=isFocused
filterComputedContent=(action "filterComputedContent")
}}
{{/component}}
<div class="select-kit-body">
{{#if renderedBodyOnce}}
{{component collectionComponent
collectionHeaderComputedContent=collectionHeaderComputedContent
hasSelection=hasSelection
noneRowComputedContent=noneRowComputedContent
createRowComputedContent=createRowComputedContent
collectionComputedContent=collectionComputedContent
rowComponent=rowComponent
noneRowComponent=noneRowComponent
createRowComponent=createRowComponent
templateForRow=templateForRow
templateForNoneRow=templateForNoneRow
templateForCreateRow=templateForCreateRow
clearSelection=(action "clearSelection")
select=(action "select")
highlight=(action "highlight")
create=(action "create")
highlightedValue=highlightedValue
computedValue=computedValue
rowComponentOptions=rowComponentOptions
noContentRow=noContentRow
maxContentRow=maxContentRow
}}
{{/if}}
</div>
<div class="select-kit-wrapper"></div>

View File

@@ -5,11 +5,6 @@
computedContent=selectedComputedContent}}
{{/each}}
<span class="filter choice" tabindex="-1">
{{component "select-kit/select-kit-filter"
filterComputedContent=filterComputedContent
shouldDisplayFilter=shouldDisplayFilter
isFocused=isFocused
filter=filter
}}
{{yield}}
</span>
</div>

View File

@@ -1,7 +1,3 @@
<div class="body">
<span class="delete-icon" {{action deselect computedContent bubbles=false}}>
{{d-icon "times"}}
</span>
{{badge}}
</div>

View File

@@ -1,16 +1,6 @@
{{#if headerContent}}<div class="header">{{headerContent}}</div>{{/if}}
<div class="body">
{{#if isLocked}}
<span class="delete-icon">
{{d-icon "lock"}}
</span>
{{else}}
<span class="locked-icon" {{action deselect computedContent bubbles=false}}>
{{d-icon "times"}}
</span>
{{/if}}
<span class="name">
{{{label}}}
</span>

View File

@@ -40,7 +40,7 @@
{{noContentRow}}
</li>
{{else}}
{{#each filteredComputedContent as |computedContent|}}
{{#each collectionComputedContent as |computedContent|}}
{{component rowComponent
computedContent=computedContent
highlightedValue=highlightedValue

View File

@@ -1,7 +1,7 @@
{{input
tabindex=-1
class="filter-input"
placeholder=placeholder
placeholder=computedPlaceholder
key-up=filterComputedContent
autocomplete="off"
autocorrect="off"

View File

@@ -1,13 +1,10 @@
{{component headerComponent
tabindex=tabindex
shouldDisplayFilter=shouldDisplayFilter
isFocused=isFocused
isExpanded=isExpanded
computedContent=headerComputedContent
deselect=(action "deselect")
toggle=(action "toggle")
isLoading=isLoading
filterComputedContent=(action "filterComputedContent")
clearSelection=(action "clearSelection")
options=headerComponentOptions
}}
@@ -17,8 +14,9 @@
filter=filter
isLoading=isLoading
icon=filterIcon
hasSelection=hasSelection
shouldDisplayFilter=shouldDisplayFilter
placeholder=(i18n filterPlaceholder)
placeholder=filterPlaceholder
isFocused=isFocused
filterComputedContent=(action "filterComputedContent")
}}
@@ -29,7 +27,7 @@
hasSelection=hasSelection
noneRowComputedContent=noneRowComputedContent
createRowComputedContent=createRowComputedContent
filteredComputedContent=filteredComputedContent
collectionComputedContent=collectionComputedContent
rowComponent=rowComponent
noneRowComponent=noneRowComponent
createRowComponent=createRowComponent