|
2 | 2 | .v-select {
|
3 | 3 | position: relative;
|
4 | 4 | }
|
5 |
| -
|
| 5 | + .v-select, |
| 6 | + .v-select * { |
| 7 | + -webkit-box-sizing: border-box; |
| 8 | + -moz-box-sizing: border-box; |
| 9 | + box-sizing: border-box; |
| 10 | + font-family: sans-serif; |
| 11 | + } |
| 12 | + /* Open Indicator */ |
6 | 13 | .v-select .open-indicator {
|
7 | 14 | position: absolute;
|
8 | 15 | bottom: 6px;
|
|
14 | 21 | transition-timing-function: cubic-bezier(1.000, -0.115, 0.975, 0.855);
|
15 | 22 | opacity: 1;
|
16 | 23 | transition: opacity .1s;
|
| 24 | + height: 20px; width: 10px; |
17 | 25 | }
|
18 |
| -
|
19 |
| - .v-select.loading .open-indicator { |
20 |
| - opacity: 0; |
21 |
| - } |
22 |
| -
|
23 | 26 | .v-select .open-indicator:before {
|
24 | 27 | border-color: rgba(60, 60, 60, .5);
|
25 | 28 | border-style: solid;
|
26 |
| - border-width: 0.25em 0.25em 0 0; |
| 29 | + border-width: 3px 3px 0 0; |
27 | 30 | content: '';
|
28 | 31 | display: inline-block;
|
29 | 32 | height: 10px;
|
|
32 | 35 | transform: rotate(133deg);
|
33 | 36 | transition: all 150ms cubic-bezier(1.000, -0.115, 0.975, 0.855);
|
34 | 37 | transition-timing-function: cubic-bezier(1.000, -0.115, 0.975, 0.855);
|
| 38 | + box-sizing: inherit; |
| 39 | + } |
| 40 | + /* Open Indicator States */ |
| 41 | + .v-select.open .open-indicator:before { |
| 42 | + transform: rotate(315deg); |
| 43 | + } |
| 44 | + .v-select.loading .open-indicator { |
| 45 | + opacity: 0; |
35 | 46 | }
|
36 |
| -
|
37 | 47 | .v-select.open .open-indicator {
|
38 | 48 | bottom: 1px;
|
39 | 49 | }
|
40 |
| -
|
41 |
| - .v-select.open .open-indicator:before { |
42 |
| - transform: rotate(315deg); |
| 50 | + /* Dropdown Toggle */ |
| 51 | + .v-select .dropdown-toggle { |
| 52 | + -webkit-appearance: none; |
| 53 | + -moz-appearance: none; |
| 54 | + appearance: none; |
43 | 55 | }
|
44 |
| -
|
45 | 56 | .v-select .dropdown-toggle {
|
46 | 57 | display: block;
|
47 | 58 | padding: 0;
|
|
50 | 61 | border-radius: 4px;
|
51 | 62 | white-space: normal;
|
52 | 63 | }
|
53 |
| -
|
| 64 | + .v-select .dropdown-toggle:after { |
| 65 | + visibility: hidden; |
| 66 | + display: block; |
| 67 | + font-size: 0; |
| 68 | + content: " "; |
| 69 | + clear: both; |
| 70 | + height: 0; |
| 71 | + } |
| 72 | + /* Dropdown Toggle States */ |
54 | 73 | .v-select.searchable .dropdown-toggle {
|
55 | 74 | cursor: text;
|
56 | 75 | }
|
57 |
| -
|
| 76 | + .v-select.unsearchable .dropdown-toggle { |
| 77 | + cursor: pointer; |
| 78 | + } |
58 | 79 | .v-select.open .dropdown-toggle {
|
59 |
| - border-bottom: none; |
| 80 | + border-bottom-color: transparent; |
60 | 81 | border-bottom-left-radius: 0;
|
61 | 82 | border-bottom-right-radius: 0;
|
62 | 83 | }
|
63 |
| -
|
64 |
| - .v-select > .dropdown-menu { |
| 84 | + /* Dropdown Menu */ |
| 85 | + .v-select .dropdown-menu { |
| 86 | + position: absolute; |
| 87 | + top: 100%; |
| 88 | + left: 0; |
| 89 | + z-index: 1000; |
| 90 | + /*float: left;*/ |
| 91 | + min-width: 160px; |
| 92 | + padding: 5px 0; |
65 | 93 | margin: 0;
|
66 | 94 | width: 100%;
|
67 | 95 | overflow-y: scroll;
|
| 96 | + border: 1px solid #ccc; |
| 97 | + border: 1px solid rgba(0, 0, 0, .15); |
68 | 98 | border-top: none;
|
| 99 | + border-radius: 4px; |
69 | 100 | border-top-left-radius: 0;
|
70 | 101 | border-top-right-radius: 0;
|
| 102 | + /*font-size: 14px;*/ |
| 103 | + text-align: left; |
| 104 | + list-style: none; |
| 105 | + background-color: #fff; |
| 106 | + background-clip: padding-box; |
| 107 | + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, .175); |
| 108 | + box-shadow: 0 6px 12px rgba(0, 0, 0, .175); |
71 | 109 | }
|
72 |
| -
|
| 110 | + .v-select .dropdown-menu .divider { |
| 111 | + height: 1px; |
| 112 | + margin: 7px 0; |
| 113 | + overflow: hidden; |
| 114 | + background-color: #e5e5e5; |
| 115 | + } |
| 116 | + .v-select .no-options { |
| 117 | + text-align: center; |
| 118 | + padding-bottom: 2px; |
| 119 | + } |
| 120 | + /* Selected Tags */ |
73 | 121 | .v-select .selected-tag {
|
74 | 122 | color: #333;
|
75 | 123 | background-color: #f0f0f0;
|
|
79 | 127 | margin: 4px 1px 0px 3px;
|
80 | 128 | padding: 0 0.25em;
|
81 | 129 | float: left;
|
82 |
| - line-height: 1.7em; |
| 130 | + line-height: 24px; |
83 | 131 | }
|
84 |
| -
|
85 | 132 | .v-select .selected-tag .close {
|
86 | 133 | float: none;
|
87 | 134 | margin-right: 0;
|
88 | 135 | font-size: 20px;
|
| 136 | + appearance: none; |
| 137 | + padding: 0; |
| 138 | + cursor: pointer; |
| 139 | + background: 0 0; |
| 140 | + border: 0; |
| 141 | + font-weight: 700; |
| 142 | + line-height: 1; |
| 143 | + color: #000; |
| 144 | + text-shadow: 0 1px 0 #fff; |
| 145 | + filter: alpha(opacity=20); |
| 146 | + opacity: .2; |
| 147 | + } |
| 148 | + /* Search Input */ |
| 149 | + .v-select input[type="search"]::-webkit-search-decoration, |
| 150 | + .v-select input[type="search"]::-webkit-search-cancel-button, |
| 151 | + .v-select input[type="search"]::-webkit-search-results-button, |
| 152 | + .v-select input[type="search"]::-webkit-search-results-decoration { |
| 153 | + display: none; |
89 | 154 | }
|
90 |
| -
|
91 | 155 | .v-select input[type=search],
|
92 | 156 | .v-select input[type=search]:focus {
|
| 157 | + appearance: none; |
| 158 | + line-height: 1.42857143; |
| 159 | + /*color: #555;*/ |
| 160 | + border-radius: 4px; |
| 161 | + height: 34px; |
| 162 | + transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; |
93 | 163 | display: inline-block;
|
94 | 164 | border: none;
|
95 | 165 | outline: none;
|
|
103 | 173 | float: left;
|
104 | 174 | clear: none;
|
105 | 175 | }
|
106 |
| -
|
107 |
| - .v-select input[type=search]:disabled { |
108 |
| - cursor: pointer; |
| 176 | + /* Search Input States */ |
| 177 | + .v-select.unsearchable input[type=search] { |
| 178 | + max-width: 1px; |
109 | 179 | }
|
110 |
| -
|
111 |
| - .v-select li a { |
| 180 | + /* List Items */ |
| 181 | + .v-select li > a { |
| 182 | + display: block; |
| 183 | + padding: 3px 20px; |
| 184 | + clear: both; |
| 185 | + line-height: 1.42857143; /* Normalize line height */ |
| 186 | + color: #333; /* Overrides most CSS frameworks */ |
| 187 | + white-space: nowrap; |
| 188 | + } |
| 189 | + .v-select li:hover { |
112 | 190 | cursor: pointer;
|
113 | 191 | }
|
114 |
| -
|
115 |
| - .v-select .active a { |
116 |
| - background: rgba(50, 50, 50, .1); |
| 192 | + .v-select .dropdown-menu .active > a { |
117 | 193 | color: #333;
|
| 194 | + background: rgba(50, 50, 50, .1); |
118 | 195 | }
|
119 |
| -
|
120 |
| - .v-select .highlight a, |
121 |
| - .v-select li:hover > a, |
122 |
| - .v-select .active > a:hover { |
| 196 | + .v-select .dropdown-menu > .highlight > a { |
| 197 | + /* |
| 198 | + * required to override bootstrap 3's |
| 199 | + * .dropdown-menu > li > a:hover {} styles |
| 200 | + */ |
123 | 201 | background: #5897fb;
|
124 | 202 | color: #fff;
|
125 | 203 | }
|
126 |
| -
|
| 204 | + .v-select .highlight:not(:last-child) { |
| 205 | + margin-bottom: 0; /* Fixes Bulma Margin */ |
| 206 | + } |
| 207 | + /* Loading Spinner */ |
127 | 208 | .v-select .spinner {
|
128 | 209 | opacity: 0;
|
129 | 210 | position: absolute;
|
|
140 | 221 | animation: vSelectSpinner 1.1s infinite linear;
|
141 | 222 | transition: opacity .1s;
|
142 | 223 | }
|
143 |
| -
|
144 |
| - .v-select.loading .spinner { |
145 |
| - opacity: 1; |
146 |
| - } |
147 |
| -
|
148 | 224 | .v-select .spinner,
|
149 | 225 | .v-select .spinner:after {
|
150 | 226 | border-radius: 50%;
|
151 | 227 | width: 5em;
|
152 | 228 | height: 5em;
|
153 | 229 | }
|
154 |
| -
|
| 230 | + /* Loading Spinner States */ |
| 231 | + .v-select.loading .spinner { |
| 232 | + opacity: 1; |
| 233 | + } |
| 234 | + /* KeyFrames */ |
155 | 235 | @-webkit-keyframes vSelectSpinner {
|
156 | 236 | 0% {
|
157 | 237 | transform: rotate(0deg);
|
|
160 | 240 | transform: rotate(360deg);
|
161 | 241 | }
|
162 | 242 | }
|
163 |
| -
|
164 | 243 | @keyframes vSelectSpinner {
|
165 | 244 | 0% {
|
166 | 245 | transform: rotate(0deg);
|
|
173 | 252 |
|
174 | 253 | <template>
|
175 | 254 | <div class="dropdown v-select" :class="dropdownClasses">
|
176 |
| - <div ref="toggle" @mousedown.prevent="toggleDropdown" class="dropdown-toggle clearfix" type="button"> |
| 255 | + <div ref="toggle" @mousedown.prevent="toggleDropdown" class="dropdown-toggle" type="button"> |
177 | 256 |
|
178 | 257 | <span class="selected-tag" v-for="option in valueAsArray" v-bind:key="option.index">
|
179 | 258 | {{ getOptionLabel(option) }}
|
|
217 | 296 | <li v-if="!filteredOptions.length" class="divider"></li>
|
218 | 297 | </transition>
|
219 | 298 | <transition name="fade">
|
220 |
| - <li v-if="!filteredOptions.length" class="text-center"> |
| 299 | + <li v-if="!filteredOptions.length" class="no-options"> |
221 | 300 | <slot name="no-options">Sorry, no matching options.</slot>
|
222 | 301 | </li>
|
223 | 302 | </transition>
|
224 | 303 | </ul>
|
225 | 304 | </div>
|
226 | 305 | </template>
|
227 | 306 |
|
228 |
| - |
229 | 307 | <script type="text/babel">
|
230 | 308 | import pointerScroll from '../mixins/pointerScroll'
|
231 | 309 | import typeAheadPointer from '../mixins/typeAheadPointer'
|
|
681 | 759 | return {
|
682 | 760 | open: this.dropdownOpen,
|
683 | 761 | searchable: this.searchable,
|
| 762 | + unsearchable: !this.searchable, |
684 | 763 | loading: this.mutableLoading
|
685 | 764 | }
|
686 | 765 | },
|
|
0 commit comments