-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add
showSearchClear
option to clear search input (#147)
- Loading branch information
1 parent
8731387
commit 32de6f2
Showing
8 changed files
with
335 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,214 @@ | ||
<div class="row mb-2"> | ||
<div class="col-md-12 title-desc"> | ||
<h2 class="bd-title"> | ||
Show Search Clear | ||
<span class="float-end links"> | ||
Code <span class="fa fa-link"></span> | ||
<span class="small"> | ||
<a | ||
target="_blank" | ||
href="https://github.com/ghiscoding/multiple-select-vanilla/blob/main/demo/src/options/options34.html" | ||
>html</a | ||
> | ||
| | ||
<a target="_blank" href="https://github.com/ghiscoding/multiple-select-vanilla/blob/main/demo/src/options/options34.ts" | ||
>ts</a | ||
> | ||
</span> | ||
</span> | ||
</h2> | ||
<div class="demo-subtitle">Use <code>showSearchClear</code> to show the clear icon to empty the search filter input.</div> | ||
</div> | ||
</div> | ||
|
||
<div> | ||
<div class="mb-3 row"> | ||
<label class="col-sm-2"> Single Select </label> | ||
|
||
<div class="col-sm-10"> | ||
<select class="full-width" data-test="select1"> | ||
<option value="1">abc</option> | ||
<option value="2">bcd</option> | ||
<option value="3">cde</option> | ||
<option value="4">def</option> | ||
<option value="5">efg</option> | ||
<option value="6">fgh</option> | ||
<option value="7">ghi</option> | ||
<option value="8">hij</option> | ||
<option value="9">ijk</option> | ||
<option value="10">jkl</option> | ||
<option value="11">klm</option> | ||
<option value="12">lmn</option> | ||
<option value="13">mno</option> | ||
<option value="14">nop</option> | ||
<option value="15">opq</option> | ||
<option value="16">pqr</option> | ||
<option value="17">qrs</option> | ||
<option value="18">rst</option> | ||
<option value="19">stu</option> | ||
<option value="20">tuv</option> | ||
<option value="21">uvw</option> | ||
<option value="22">vwx</option> | ||
<option value="23">wxy</option> | ||
<option value="24">xyz</option> | ||
<option value="25">123</option> | ||
<option value="26">234</option> | ||
<option value="27">345</option> | ||
<option value="28">456</option> | ||
<option value="29">567</option> | ||
<option value="30">678</option> | ||
<option value="31">789</option> | ||
</select> | ||
</div> | ||
</div> | ||
|
||
<div class="mb-3 row"> | ||
<label class="col-sm-2"> Single Group </label> | ||
|
||
<div class="col-sm-10"> | ||
<select class="full-width" data-test="select2"> | ||
<optgroup label="Group 10"> | ||
<option value="1">000</option> | ||
<option value="2">111</option> | ||
<option value="3">222</option> | ||
</optgroup> | ||
<optgroup label="Group 11"> | ||
<option value="4">333</option> | ||
<option value="5">444</option> | ||
<option value="6">555</option> | ||
</optgroup> | ||
<optgroup label="Group 12"> | ||
<option value="7">666</option> | ||
<option value="8">777</option> | ||
<option value="9">888</option> | ||
<option value="10">999</option> | ||
</optgroup> | ||
<optgroup label="Group 20"> | ||
<option value="11">210</option> | ||
<option value="12">321</option> | ||
<option value="13">432</option> | ||
</optgroup> | ||
<optgroup label="Group 21"> | ||
<option value="14">543</option> | ||
<option value="15">654</option> | ||
<option value="16">765</option> | ||
</optgroup> | ||
<optgroup label="Group 22"> | ||
<option value="17">876</option> | ||
<option value="18">987</option> | ||
<option value="19">098</option> | ||
</optgroup> | ||
<optgroup label="Group 30"> | ||
<option value="20">012</option> | ||
<option value="21">123</option> | ||
<option value="22">234</option> | ||
</optgroup> | ||
<optgroup label="Group 31"> | ||
<option value="23">345</option> | ||
<option value="24">456</option> | ||
<option value="25">567</option> | ||
</optgroup> | ||
<optgroup label="Group 32"> | ||
<option value="26">678</option> | ||
<option value="27">789</option> | ||
<option value="28">890</option> | ||
</optgroup> | ||
</select> | ||
</div> | ||
</div> | ||
|
||
<div class="mb-3 row"> | ||
<label class="col-sm-2"> Basic Select </label> | ||
|
||
<div class="col-sm-10"> | ||
<select multiple="multiple" class="full-width" data-test="select3"> | ||
<option value="1">abc</option> | ||
<option value="2">bcd</option> | ||
<option value="3">cde</option> | ||
<option value="4">def</option> | ||
<option value="5">efg</option> | ||
<option value="6">fgh</option> | ||
<option value="7">ghi</option> | ||
<option value="8">hij</option> | ||
<option value="9">ijk</option> | ||
<option value="10">jkl</option> | ||
<option value="11">klm</option> | ||
<option value="12">lmn</option> | ||
<option value="13">mno</option> | ||
<option value="14">nop</option> | ||
<option value="15">opq</option> | ||
<option value="16">pqr</option> | ||
<option value="17">qrs</option> | ||
<option value="18">rst</option> | ||
<option value="19">stu</option> | ||
<option value="20">tuv</option> | ||
<option value="21">uvw</option> | ||
<option value="22">vwx</option> | ||
<option value="23">wxy</option> | ||
<option value="24">xyz</option> | ||
<option value="25">123</option> | ||
<option value="26">234</option> | ||
<option value="27">345</option> | ||
<option value="28">456</option> | ||
<option value="29">567</option> | ||
<option value="30">678</option> | ||
<option value="31">789</option> | ||
</select> | ||
</div> | ||
</div> | ||
|
||
<div class="mb-3 row"> | ||
<label class="col-sm-2"> Group Select </label> | ||
|
||
<div class="col-sm-10"> | ||
<select multiple="multiple" class="full-width" data-test="select4"> | ||
<optgroup label="Group 10"> | ||
<option value="1">000</option> | ||
<option value="2">111</option> | ||
<option value="3">222</option> | ||
</optgroup> | ||
<optgroup label="Group 11"> | ||
<option value="4">333</option> | ||
<option value="5">444</option> | ||
<option value="6">555</option> | ||
</optgroup> | ||
<optgroup label="Group 12"> | ||
<option value="7">666</option> | ||
<option value="8">777</option> | ||
<option value="9">888</option> | ||
<option value="10">999</option> | ||
</optgroup> | ||
<optgroup label="Group 20"> | ||
<option value="11">210</option> | ||
<option value="12">321</option> | ||
<option value="13">432</option> | ||
</optgroup> | ||
<optgroup label="Group 21"> | ||
<option value="14">543</option> | ||
<option value="15">654</option> | ||
<option value="16">765</option> | ||
</optgroup> | ||
<optgroup label="Group 22"> | ||
<option value="17">876</option> | ||
<option value="18">987</option> | ||
<option value="19">098</option> | ||
</optgroup> | ||
<optgroup label="Group 30"> | ||
<option value="20">012</option> | ||
<option value="21">123</option> | ||
<option value="22">234</option> | ||
</optgroup> | ||
<optgroup label="Group 31"> | ||
<option value="23">345</option> | ||
<option value="24">456</option> | ||
<option value="25">567</option> | ||
</optgroup> | ||
<optgroup label="Group 32"> | ||
<option value="26">678</option> | ||
<option value="27">789</option> | ||
<option value="28">890</option> | ||
</optgroup> | ||
</select> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { multipleSelect, MultipleSelectInstance } from 'multiple-select-vanilla'; | ||
|
||
export default class Example { | ||
ms: MultipleSelectInstance[] = []; | ||
|
||
mount() { | ||
this.ms = multipleSelect('select', { | ||
filter: true, | ||
showSearchClear: true, | ||
}) as MultipleSelectInstance[]; | ||
} | ||
|
||
unmount() { | ||
// destroy ms instance(s) to avoid DOM leaks | ||
this.ms.forEach((m) => m.destroy()); | ||
this.ms = []; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.