-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
107 additions
and
1 deletion.
There are no files selected for viewing
Binary file not shown.
27 changes: 27 additions & 0 deletions
27
doc-app/tests/dummy/app/controllers/docs/ember-input/select-search.js
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,27 @@ | ||
import Controller from '@ember/controller'; | ||
import { action } from '@ember/object'; | ||
import { tracked } from 'tracked-built-ins'; | ||
|
||
export default class DocsTpkSelectSearchController extends Controller { | ||
@tracked options = ['BBQ', 'Ketchup', 'Dallas', 'Mustard']; | ||
@tracked selected = ''; | ||
|
||
@action | ||
selectElement() { | ||
this.selected = 'Dallas'; | ||
} | ||
Ò; | ||
@action | ||
onChange(value) { | ||
console.log('Selected value:', value); | ||
this.selected = value; | ||
} | ||
|
||
@action | ||
onInput(e) { | ||
console.log('Input value:', e.target.value); | ||
this.options.filter((sauce) => | ||
sauce.toLowerCase.includes(e.target.value.toLowerCase), | ||
); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
@import url("radio.css"); | ||
@import url("select.css"); | ||
@import url("tpk-file.css"); | ||
@import url("select-search.css"); |
47 changes: 47 additions & 0 deletions
47
doc-app/tests/dummy/app/styles/ember-input/select-search.css
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,47 @@ | ||
.tpk-select-search-container { | ||
@apply pt-1; | ||
} | ||
|
||
/* stylelint-disable-next-line no-descending-specificity */ | ||
.tpk-select-search .tpk-select-search-input, | ||
.tpk-select-search-input { | ||
@apply text-stone-500 w-full -mt-1; | ||
} | ||
|
||
.tpk-select-search { | ||
@apply relative; | ||
} | ||
|
||
.tpk-select-search input::placeholder { | ||
@apply text-black; | ||
} | ||
|
||
.main-select-search .tpk-select-search::before { | ||
content: ""; | ||
|
||
@apply absolute rounded flex top-[6px] right-[6px] w-[34px] h-[34px] items-center justify-center z-10; | ||
} | ||
|
||
.main-select-search .tpk-select-search::after { | ||
content: ""; | ||
|
||
@apply absolute rounded flex top-[6px] right-[6px] bg-white w-[34px] h-[34px] items-center justify-center z-20; | ||
|
||
mask-image: url("/assets/icons/search.svg"); | ||
mask-repeat: no-repeat; | ||
mask-position: center; | ||
-mask-position: center; | ||
mask-size: 70%; | ||
} | ||
|
||
.tpk-select-search-options { | ||
@apply w-full z-[60] hidden absolute shadow-lg max-h-60 rounded-md py-0.5 text-stone-500 ring-1 ring-opacity-5 overflow-auto focus:outline-none mt-1; | ||
} | ||
|
||
.tpk-select-search[data-is-open="true"] .tpk-select-search-options { | ||
@apply block bg-white text-stone-500 rounded-md; | ||
} | ||
|
||
.tpk-select-search-options-option { | ||
@apply relative py-2 pl-3 text-stone-500 cursor-pointer select-none pr-9 hover:bg-blue-700 focus:outline-none focus-visible:border-blue-400/25; | ||
} |
29 changes: 29 additions & 0 deletions
29
doc-app/tests/dummy/app/templates/docs/ember-input/select-search.md
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 |
---|---|---|
@@ -1,3 +1,32 @@ | ||
# Ember input/select search | ||
|
||
Ember input/select search content | ||
|
||
<DocsDemo as |demo|> | ||
<demo.example @name="tpk-select-search.hbs"> | ||
<TpkSelectSearch | ||
@label='Select something' | ||
@options={{this.options}} | ||
@onChange={{this.selectElement}} | ||
@selected={{this.selected}} | ||
class="tpk-select-search" | ||
as |S|> | ||
<S.Label /> | ||
|
||
<div class="tpk-select-search-container"> | ||
<S.Input @onInput={{this.onInput}} /> | ||
<S.Button> | ||
<svg width="18" height="16" aria-hidden="true" focusable="false"> | ||
<polygon class="arrow" stroke-width="0" fill-opacity="0.75" fill="currentcolor" points="3,6 15,6 9,14"></polygon> | ||
</svg> | ||
</S.Button> | ||
</div> | ||
<S.Options as |Opts|> | ||
<Opts as |opt|> | ||
{{opt.option}} | ||
</Opts> | ||
</S.Options> | ||
</TpkSelectSearch> | ||
</demo.example> | ||
<demo.snippet @name="tpk-select-search.hbs"/> | ||
</DocsDemo> |
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