|
3 | 3 | minver: 0.4.0 |
4 | 4 | also: |
5 | 5 | elements/hx-search: <hx-search> |
| 6 | + elements/hx-search-assistance: <hx-search-assistance> |
6 | 7 | --- |
7 | 8 | {% extends 'component.njk' %} |
8 | 9 | {% block content %} |
9 | 10 | <section> |
10 | 11 | <h2 id="demos">Demos</h2> |
11 | 12 | <div id="vue-searchDemo" class="hxRow" v-cloak> |
12 | | - <div class="hxCol hxSpan-12-xs hxSpan-9-lg"> |
13 | | - <h3>Basic Search Box</h3> |
14 | | - <div class="demo"> |
15 | | - <hx-search |
16 | | - :disabled="isDisabled" |
17 | | - :invalid="isInvalid" |
18 | | - :placeholder="placeholder" |
19 | | - :value="searchValue" |
20 | | - @input="onSearchUpdate" |
21 | | - @clear="onSearchUpdate" |
22 | | - ></hx-search> |
23 | | - </div> |
24 | | - |
25 | | - <pre><code>{% raw %}{{snippet}}{% endraw %}</code></pre> |
26 | | - </div> |
27 | | - <div class="hxCol hxSpan-12-xs hxSpan-3-lg"> |
| 13 | + <div class="hxCol hxSpan-12-xs hxSpan-3-lg hxOrder-2-lg"> |
28 | 14 | <h3>Options</h3> |
29 | 15 | <p> |
30 | 16 | <b>Placeholder:</b><br /> |
@@ -59,6 +45,65 @@ <h3>Options</h3> |
59 | 45 | <label>Invalid</label> |
60 | 46 | </p> |
61 | 47 | </div> |
| 48 | + <div class="hxCol hxSpan-12-xs hxSpan-9-lg hxOrder-1-lg"> |
| 49 | + <h3>Basic Search Box</h3> |
| 50 | + <div class="demo"> |
| 51 | + <hx-search |
| 52 | + :disabled="isDisabled" |
| 53 | + :invalid="isInvalid" |
| 54 | + :placeholder="placeholder" |
| 55 | + :value="searchValue" |
| 56 | + @clear="onSearchUpdate" |
| 57 | + @input="onSearchUpdate" |
| 58 | + ></hx-search> |
| 59 | + </div> |
| 60 | + <pre><code>{% raw %}{{snippet}}{% endraw %}</code></pre> |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + </section> |
| 64 | + |
| 65 | + <section> |
| 66 | + <div id="vue-searchAssistanceDemo"> |
| 67 | + <h3>Search Assistance</h3> |
| 68 | + <div class="demo"> |
| 69 | + <hx-search |
| 70 | + id="assisted-hx-search" |
| 71 | + :value="searchValue" |
| 72 | + @blur="onBlur" |
| 73 | + @clear="onUpdate" |
| 74 | + @focus="onFocus" |
| 75 | + @input="onUpdate" |
| 76 | + ></hx-search> |
| 77 | + <hx-search-assistance relative-to="assisted-hx-search" ref="search"> |
| 78 | + <header>Search for "<span v-text="searchValue"></span>"</header> |
| 79 | + <section v-if="hasValue"> |
| 80 | + <header>Category Header</header> |
| 81 | + <button class="hxSearchSuggestion">Here is a possible <b v-text="searchValue"></b></button> |
| 82 | + <button class="hxSearchSuggestion">Here is a possible <b v-text="searchValue"></b></button> |
| 83 | + <button class="hxSearchSuggestion">Here is a possible <b v-text="searchValue"></b></button> |
| 84 | + </section> |
| 85 | + </hx-search-assistance> |
| 86 | + </div> |
| 87 | + <small> |
| 88 | + *Behavior to show/hide search assistance may differ in your app. |
| 89 | + </small> |
| 90 | + {% code 'html' %} |
| 91 | + <hx-search |
| 92 | + id="assisted-search" |
| 93 | + onblur="hideAssistance()" |
| 94 | + onfocus="showAssistance()" |
| 95 | + value="item" |
| 96 | + ></hx-search> |
| 97 | + <hx-search-assistance relative-to="assisted-search"> |
| 98 | + <header>Search for "item"</header> |
| 99 | + <section> |
| 100 | + <header>Category Header</header> |
| 101 | + <button class="hxSearchSuggestion">Here is a possible <b>item</b></button> |
| 102 | + <button class="hxSearchSuggestion">Here is a possible <b>item</b></button> |
| 103 | + <button class="hxSearchSuggestion">Here is a possible <b>item</b></button> |
| 104 | + </section> |
| 105 | + </hx-search-assistance> |
| 106 | + {% endcode %} |
62 | 107 | </div> |
63 | 108 | </section> |
64 | 109 |
|
|
0 commit comments