mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-22 10:30:34 +03:00
Added support for themes. Default vue-select to 'default' theme. Added 'cyan' theme.
This commit is contained in:
Vendored
+4
-4
File diff suppressed because one or more lines are too long
+9
-13
@@ -32,17 +32,6 @@
|
|||||||
color: #404040;
|
color: #404040;
|
||||||
}
|
}
|
||||||
|
|
||||||
#v-select .highlight a,
|
|
||||||
#v-select li:hover a {
|
|
||||||
background: #4CC3D9;
|
|
||||||
color: #fff;
|
|
||||||
}
|
|
||||||
|
|
||||||
#v-select.open .dropdown-toggle,
|
|
||||||
#v-select.open .dropdown-menu {
|
|
||||||
border-color: #4CC3D9;
|
|
||||||
}
|
|
||||||
|
|
||||||
#output {
|
#output {
|
||||||
height: 200px;
|
height: 200px;
|
||||||
border: none;
|
border: none;
|
||||||
@@ -193,7 +182,7 @@
|
|||||||
<code>searchable</code> Toggle filtering of options
|
<code>searchable</code> Toggle filtering of options
|
||||||
<ul>
|
<ul>
|
||||||
<li>type: Boolean</li>
|
<li>type: Boolean</li>
|
||||||
<li>default: true </li>
|
<li>default: true</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
@@ -220,6 +209,14 @@
|
|||||||
<li>default: true</li>
|
<li>default: true</li>
|
||||||
</ul>
|
</ul>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<code>theme</code> Theme option to style the component. Available options: 'default', 'cyan'.
|
||||||
|
<ul>
|
||||||
|
<li>type: String</li>
|
||||||
|
<li>default: 'default'</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -258,7 +255,6 @@ export default {
|
|||||||
advanced: require('./countries.js'),
|
advanced: require('./countries.js'),
|
||||||
simple: require('./simpleCountries.js'),
|
simple: require('./simpleCountries.js'),
|
||||||
simpler: [{label: 'This is Foo', value: 'foo'}, {label: 'This is Bar', value: 'bar'}, {label: 'This is Baz', value: 'baz'}]
|
simpler: [{label: 'This is Foo', value: 'foo'}, {label: 'This is Bar', value: 'bar'}, {label: 'This is Baz', value: 'baz'}]
|
||||||
|
|
||||||
},
|
},
|
||||||
optionType: 'advanced'
|
optionType: 'advanced'
|
||||||
}
|
}
|
||||||
|
|||||||
+53
-10
@@ -31,8 +31,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.open .dropdown-toggle {
|
.open .dropdown-toggle {
|
||||||
/*background: none;*/
|
|
||||||
/*border-color: #337ab7;*/
|
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
border-bottom-left-radius: 0;
|
border-bottom-left-radius: 0;
|
||||||
border-bottom-right-radius: 0;
|
border-bottom-right-radius: 0;
|
||||||
@@ -43,7 +41,6 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
border-top: none;
|
border-top: none;
|
||||||
/*border-color: #337ab7;*/
|
|
||||||
border-top-left-radius: 0;
|
border-top-left-radius: 0;
|
||||||
border-top-right-radius: 0;
|
border-top-right-radius: 0;
|
||||||
}
|
}
|
||||||
@@ -85,26 +82,61 @@
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.active a {
|
/* Default theme */
|
||||||
|
.theme-default .alert {
|
||||||
|
color: #333;
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
border-color: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-default.dropdown.open .dropdown-toggle,
|
||||||
|
.theme-default.dropdown.open .dropdown-menu {
|
||||||
|
border-color: rgba(60,60,60,.26);
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-default .active a {
|
||||||
background: rgba(50,50,50,.1);
|
background: rgba(50,50,50,.1);
|
||||||
color: #333;
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.highlight a,
|
.theme-default .highlight a,
|
||||||
li:hover a {
|
.theme-default li:hover a {
|
||||||
background: #337ab7;
|
background: #f0f0f0;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Cyan theme */
|
||||||
|
.theme-cyan .alert {
|
||||||
|
color: #147688;
|
||||||
|
background-color: #d7f3f9;
|
||||||
|
border-color: #91ddec;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-cyan.dropdown.open .dropdown-toggle,
|
||||||
|
.theme-cyan.dropdown.open .dropdown-menu {
|
||||||
|
border-color: #4CC3D9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-cyan .active a {
|
||||||
|
background: rgba(50,50,50,.1);
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-cyan.dropdown .highlight a,
|
||||||
|
.theme-cyan.dropdown li:hover a {
|
||||||
|
background: #4CC3D9;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="dropdown" :class="{open: open, searchable: searchable}">
|
<div class="dropdown" :class="cssClasses">
|
||||||
<div v-el:toggle @mousedown.prevent="toggleDropdown" class="dropdown-toggle clearfix" type="button">
|
<div v-el:toggle @mousedown.prevent="toggleDropdown" class="dropdown-toggle clearfix" type="button">
|
||||||
<span class="form-control" v-if="!searchable && isValueEmpty">
|
<span class="form-control" v-if="!searchable && isValueEmpty">
|
||||||
{{ placeholder }}
|
{{ placeholder }}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span class="alert alert-info" v-for="option in valueAsArray">
|
<span class="alert" v-for="option in valueAsArray">
|
||||||
{{ getOptionLabel(option) }}
|
{{ getOptionLabel(option) }}
|
||||||
<button v-if="multiple" @click="select(option)" type="button" class="close">
|
<button v-if="multiple" @click="select(option)" type="button" class="close">
|
||||||
<span aria-hidden="true">×</span>
|
<span aria-hidden="true">×</span>
|
||||||
@@ -144,7 +176,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
props: {
|
props: {
|
||||||
value: {
|
value: {
|
||||||
twoway: true,
|
twoway: true,
|
||||||
@@ -154,6 +185,10 @@
|
|||||||
type: Array,
|
type: Array,
|
||||||
default() { return [] },
|
default() { return [] },
|
||||||
},
|
},
|
||||||
|
theme: {
|
||||||
|
type: String,
|
||||||
|
default: 'default'
|
||||||
|
},
|
||||||
maxHeight: {
|
maxHeight: {
|
||||||
type: String,
|
type: String,
|
||||||
default: '400px'
|
default: '400px'
|
||||||
@@ -295,6 +330,14 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
|
cssClasses() {
|
||||||
|
return {
|
||||||
|
open: this.open,
|
||||||
|
searchable: this.searchable,
|
||||||
|
[this.theme]: this.theme
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
searchPlaceholder() {
|
searchPlaceholder() {
|
||||||
if( this.isValueEmpty && this.placeholder ) {
|
if( this.isValueEmpty && this.placeholder ) {
|
||||||
return this.placeholder;
|
return this.placeholder;
|
||||||
|
|||||||
Reference in New Issue
Block a user