| 1 |
// Form - autocompleter |
| 2 |
// |
| 3 |
// Located in `wyrm_core/_autocompleter.sass`. Autocompleters traditionally have three states, empty, |
| 4 |
// single item and multi-item addition. Examples for all three are shown below. |
| 5 |
// |
| 6 |
// Markup: |
| 7 |
// <div class="wy-control-group"> |
| 8 |
// <label for="right-label" >Empty state</label> |
| 9 |
// <div class="wy-control"> |
| 10 |
// <div class="wy-tag-input-group"> |
| 11 |
// <div class="wy-autocomplete-group"> |
| 12 |
// <label class="fa fa-search" for="search-example-1"></label> <input type="text" id="search-example-1" placeholder="Search users"> |
| 13 |
// </div> |
| 14 |
// </div> |
| 15 |
// <span class="wy-form-message">Example help text</span> |
| 16 |
// </div> |
| 17 |
// </div> |
| 18 |
// <div class="wy-control-group"> |
| 19 |
// <label for="right-label" >One item allowed</label> |
| 20 |
// <div class="wy-control"> |
| 21 |
// <div class="wy-tag-input-group"> |
| 22 |
// <span class="wy-tag">Network<a href="" class="wy-tag-remove"></a></span> |
| 23 |
// </div> |
| 24 |
// <span class="wy-form-message">User needs to close the above item before choosing a replacement.</span> |
| 25 |
// </div> |
| 26 |
// </div> |
| 27 |
// <div class="wy-control-group"> |
| 28 |
// <label for="right-label" >Multiple items allowed</label> |
| 29 |
// <div class="wy-control"> |
| 30 |
// <div class="wy-tag-input-group"> |
| 31 |
// <span class="wy-tag">Network<a href="" class="wy-tag-remove"></a></span> |
| 32 |
// <span class="wy-tag">Rollerball<a href="" class="wy-tag-remove"></a></span> |
| 33 |
// <span class="wy-tag on">Being There<a href="" class="wy-tag-remove"></a></span> |
| 34 |
// <div class="wy-autocomplete-group"> |
| 35 |
// <label class="fa fa-search" for="search-example-2"></label> <input type="text" id="search-example-2" placeholder="Search users"> |
| 36 |
// <div class="wy-autocomplete-dropdown"> |
| 37 |
// <ul> |
| 38 |
// <li class="on"> |
| 39 |
// Network |
| 40 |
// </li> |
| 41 |
// <li> |
| 42 |
// Rollerball |
| 43 |
// </li> |
| 44 |
// <li> |
| 45 |
// Being There |
| 46 |
// </li> |
| 47 |
// <li class="add"> |
| 48 |
// <span class="fa fa-plus-circle"></span> Add new entry |
| 49 |
// </li> |
| 50 |
// </ul> |
| 51 |
// </div> |
| 52 |
// </div> |
| 53 |
// </div> |
| 54 |
// <span class="wy-form-message">Infinite autocomplete.</span> |
| 55 |
// </div> |
| 56 |
// </div> |
| 57 |
// |
| 58 |
// Styleguide 9 |
| 59 |
|
| 60 |
.wy-autocomplete-group |
| 61 |
display: inline-block |
| 62 |
position: relative |
| 63 |
background: $input-background-color |
| 64 |
|
| 65 |
.wy-autocomplete-dropdown |
| 66 |
position: absolute |
| 67 |
top: 100% |
| 68 |
left: 0 |
| 69 |
float: left |
| 70 |
min-width: 100% |
| 71 |
background: $dropdown-color |
| 72 |
z-index: $z-index-dropdown |
| 73 |
border: solid 1px $dropdown-border-color |
| 74 |
box-shadow: 0 5px 5px 0 rgba(0,0,0,.1) |
| 75 |
ul |
| 76 |
list-style: none !important |
| 77 |
margin: 0 !important |
| 78 |
li |
| 79 |
line-height: 1.5 |
| 80 |
padding: $base-font-size / 2 |
| 81 |
cursor: pointer |
| 82 |
list-style: none !important |
| 83 |
margin: 0 !important |
| 84 |
border-bottom: solid 1px $table-border-color |
| 85 |
&:last-child |
| 86 |
border-bottom: none |
| 87 |
&.on, &:hover |
| 88 |
background: $link-color |
| 89 |
border-color: transparent |
| 90 |
color: $white |
| 91 |
&.add |
| 92 |
background: lighten($green, 50%) |
| 93 |
&:hover.add, &.add.on |
| 94 |
background: $green |
| 95 |
img |
| 96 |
width: 16px |
| 97 |
height: 16px |
| 98 |
margin-right: $base-font-size / 2 |
| 99 |
|
| 100 |
.wy-tag-input-group |
| 101 |
.wy-autocomplete-dropdown |
| 102 |
margin-top: -4px |
| 103 |
|
| 104 |
// Form - Autocompleter, many items. |
| 105 |
// |
| 106 |
// For when there are lots of items in a tag group. |
| 107 |
// |
| 108 |
// Markup: |
| 109 |
// <div class="wy-control-group wy-control-group-relation"> |
| 110 |
// <label>Lots of items</label> |
| 111 |
// <div class="wy-control"> |
| 112 |
// <div class="wy-tag-input-group wy-tag-input-group-many"> |
| 113 |
// <ol> |
| 114 |
// <li><span class="fa fa-ellipsis-v">Network <a class="fa fa-times-circle"></a></span></li> |
| 115 |
// <li><span class="fa fa-ellipsis-v">Rollerball <a class="fa fa-times-circle"></a></span></li> |
| 116 |
// <li><span class="fa fa-ellipsis-v">The Godfather <a class="fa fa-times-circle"></a></span></li> |
| 117 |
// <li><span class="fa fa-ellipsis-v">The Godfather Part II<a class="fa fa-times-circle"></a></span></li> |
| 118 |
// <li><span class="fa fa-ellipsis-v">The Big Lebowski <a class="fa fa-times-circle"></a></span></li> |
| 119 |
// <li><span class="fa fa-ellipsis-v">Fargo <a class="fa fa-times-circle"></a></span></li> |
| 120 |
// <li><span class="fa fa-ellipsis-v">Bad Santa <a class="fa fa-times-circle"></a></span></li> |
| 121 |
// </ol> |
| 122 |
// <div class="wy-autocomplete-group"> |
| 123 |
// <label class="fa fa-search"></label> |
| 124 |
// <input placeholder="Add item" type="text"> |
| 125 |
// </div> |
| 126 |
// </div> |
| 127 |
// </div> |
| 128 |
// |
| 129 |
// Styleguide 9.2 |
| 130 |
|
| 131 |
.wy-tag-input-group.wy-tag-input-group-many |
| 132 |
border: none |
| 133 |
box-shadow: none |
| 134 |
padding: 0 |
| 135 |
display: block |
| 136 |
background: transparent |
| 137 |
.wy-autocomplete-group |
| 138 |
display: inline-block |
| 139 |
border: solid 1px $table-border-color |
| 140 |
width: 50% |
| 141 |
margin-bottom: $base-line-height / 4 |
| 142 |
padding: 0 $base-line-height / 4 |
| 143 |
label |
| 144 |
margin-left: 0 |
| 145 |
input |
| 146 |
margin-bottom: 0 |
| 147 |
.wy-spinner |
| 148 |
float: right |
| 149 |
margin-top: $base-line-height / 4 |
| 150 |
margin-bottom: $base-line-height / 4 |
| 151 |
|
| 152 |
.wy-tag-input-group.wy-tag-input-group-many ol |
| 153 |
margin-bottom: 0 |
| 154 |
|
| 155 |
.wy-tag-input-group.wy-tag-input-group-many ol li |
| 156 |
cursor: move |
| 157 |
margin-left: 0 |
| 158 |
span |
| 159 |
padding: $base-line-height / 4 $base-line-height / 2 |
| 160 |
margin-bottom: $base-line-height / 4 |
| 161 |
background: rgba(0,0,0,.1) |
| 162 |
position: relative |
| 163 |
+truncate(50%) |
| 164 |
+transition(background .5s ease-in-out) |
| 165 |
&.active span |
| 166 |
background: rgba(0,0,0,.2) |
| 167 |
|
| 168 |
span:hover |
| 169 |
.#{$icon-prefix}-#{$icon-remove} |
| 170 |
opacity: 1 |
| 171 |
span:before |
| 172 |
color: $gray-light |
| 173 |
margin-right: $base-line-height / 4 |
| 174 |
|
| 175 |
.#{$icon-prefix}-#{$icon-remove} |
| 176 |
position: absolute |
| 177 |
right: $base-line-height / 4 |
| 178 |
top: $base-line-height / 4 |
| 179 |
color: $red |
| 180 |
opacity: 0 |
| 181 |
|
| 182 |
.wy-tag-input-group.wy-tag-input-group-many li |
| 183 |
cursor: auto |
| 184 |
|
| 185 |
+media($mobile) |
| 186 |
.wy-tag-input-group.wy-tag-input-group-many ol li span |
| 187 |
width: 100% |
| 188 |
|