Skip to content

Commit b4d7732

Browse files
committed
Merge branch 'master' of https://github.com/angular-ui/ui-select into placeholder_bug
2 parents 4b4e8b5 + 2d1422d commit b4d7732

20 files changed

+480
-36
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ui-select",
3-
"version": "0.11.2",
3+
"version": "0.12.0",
44
"homepage": "https://github.com/angular-ui/ui-select",
55
"authors": [
66
"AngularUI"

dist/select.css

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* ui-select
33
* http://github.com/angular-ui/ui-select
4-
* Version: 0.11.2 - 2015-03-17T04:08:46.478Z
4+
* Version: 0.12.0 - 2015-05-28T07:44:11.364Z
55
* License: MIT
66
*/
77

@@ -48,6 +48,31 @@ body > .select2-container.open {
4848
z-index: 9999; /* The z-index Select2 applies to the select2-drop */
4949
}
5050

51+
/* Handle up direction Select2 */
52+
.ui-select-container[theme="select2"].direction-up .ui-select-match {
53+
border-radius: 4px; /* FIXME hardcoded value :-/ */
54+
border-top-left-radius: 0;
55+
border-top-right-radius: 0;
56+
}
57+
.ui-select-container[theme="select2"].direction-up .ui-select-dropdown {
58+
border-radius: 4px; /* FIXME hardcoded value :-/ */
59+
border-bottom-left-radius: 0;
60+
border-bottom-right-radius: 0;
61+
62+
border-top-width: 1px; /* FIXME hardcoded value :-/ */
63+
border-top-style: solid;
64+
65+
box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25);
66+
67+
margin-top: -4px; /* FIXME hardcoded value :-/ */
68+
}
69+
.ui-select-container[theme="select2"].direction-up .ui-select-dropdown .select2-search {
70+
margin-top: 4px; /* FIXME hardcoded value :-/ */
71+
}
72+
.ui-select-container[theme="select2"].direction-up.select2-dropdown-open .ui-select-match {
73+
border-bottom-color: #5897fb;
74+
}
75+
5176
/* Selectize theme */
5277

5378
/* Helper class to show styles when focus */
@@ -70,6 +95,12 @@ body > .select2-container.open {
7095
border-color: #D44950;
7196
}
7297

98+
/* Handle up direction Selectize */
99+
.ui-select-container[theme="selectize"].direction-up .ui-select-dropdown {
100+
box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25);
101+
102+
margin-top: -2px; /* FIXME hardcoded value :-/ */
103+
}
73104

74105
/* Bootstrap theme */
75106

@@ -107,6 +138,11 @@ body > .select2-container.open {
107138
border-top-right-radius: 0;
108139
border-bottom-right-radius: 0;
109140
}
141+
.input-group > .ui-select-bootstrap > input.ui-select-search.form-control.direction-up {
142+
border-radius: 4px !important; /* FIXME hardcoded value :-/ */
143+
border-top-right-radius: 0 !important;
144+
border-bottom-right-radius: 0 !important;
145+
}
110146

111147
.ui-select-bootstrap > .ui-select-match > .btn{
112148
/* Instead of center because of .btn */
@@ -218,4 +254,9 @@ body > .ui-select-bootstrap.open {
218254
/* Mark invalid Bootstrap */
219255
.ui-select-bootstrap.ng-dirty.ng-invalid > button.btn.ui-select-match {
220256
border-color: #D44950;
221-
}
257+
}
258+
259+
/* Handle up direction Bootstrap */
260+
.ui-select-container[theme="bootstrap"].direction-up .ui-select-dropdown {
261+
box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25);
262+
}

dist/select.js

Lines changed: 81 additions & 11 deletions
Large diffs are not rendered by default.

dist/select.min.css

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/select.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/bootstrap.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
</script>
1919
<![endif]-->
2020

21-
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.js"></script>
22-
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular-sanitize.js"></script>
21+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.28/angular.js"></script>
22+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.28/angular-sanitize.js"></script>
2323
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.css">
2424

2525
<!-- ui-select files -->

examples/demo-groupfilter.html

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
<!DOCTYPE html>
2+
<html lang="en" ng-app="demo">
3+
<head>
4+
<meta charset="utf-8">
5+
<title>AngularJS ui-select</title>
6+
7+
<!--
8+
IE8 support, see AngularJS Internet Explorer Compatibility http://docs.angularjs.org/guide/ie
9+
For Firefox 3.6, you will also need to include jQuery and ECMAScript 5 shim
10+
-->
11+
<!--[if lt IE 9]>
12+
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.js"></script>
13+
<script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-shim.js"></script>
14+
<script>
15+
document.createElement('ui-select');
16+
document.createElement('ui-select-match');
17+
document.createElement('ui-select-choices');
18+
</script>
19+
<![endif]-->
20+
21+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular.js"></script>
22+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.18/angular-sanitize.js"></script>
23+
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.css">
24+
25+
<!-- ui-select files -->
26+
<script src="../dist/select.js"></script>
27+
<link rel="stylesheet" href="../dist/select.css">
28+
29+
<script src="demo.js"></script>
30+
31+
<!-- Select2 theme -->
32+
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/select2/3.4.5/select2.css">
33+
34+
<!--
35+
Selectize theme
36+
Less versions are available at https://github.com/brianreavis/selectize.js/tree/master/dist/less
37+
-->
38+
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.8.5/css/selectize.default.css">
39+
<!-- <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.8.5/css/selectize.bootstrap2.css"> -->
40+
<!-- <link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.8.5/css/selectize.bootstrap3.css"> -->
41+
42+
<style>
43+
body {
44+
padding: 15px;
45+
}
46+
47+
.select2 > .select2-choice.ui-select-match {
48+
/* Because of the inclusion of Bootstrap */
49+
height: 29px;
50+
}
51+
52+
.selectize-control > .selectize-dropdown {
53+
top: 36px;
54+
}
55+
</style>
56+
</head>
57+
58+
<body ng-controller="DemoCtrl">
59+
<script src="demo.js"></script>
60+
61+
<button class="btn btn-default btn-xs" ng-click="enable()">Enable ui-select</button>
62+
<button class="btn btn-default btn-xs" ng-click="disable()">Disable ui-select</button>
63+
<button class="btn btn-default btn-xs" ng-click="clear()">Clear ng-model</button>
64+
65+
<h3>Select2 theme</h3>
66+
<p>Selected: {{country.selected}}</p>
67+
68+
69+
<h2> Filter groups by array (group-filter="['Z','B','C']")</h2>
70+
<ui-select ng-model="country.selected" theme="select2" ng-disabled="disabled" style="width: 300px;" title="Choose a country">
71+
<ui-select-match placeholder="Select or search a country in the list...">{{$select.selected.name}}</ui-select-match>
72+
<ui-select-choices group-by="firstLetterGroupFn" group-filter="['Z','B','C']" repeat="country in countries | filter: $select.search">
73+
<span ng-bind-html="country.name | highlight: $select.search"></span>
74+
<small ng-bind-html="country.code | highlight: $select.search"></small>
75+
</ui-select-choices>
76+
</ui-select>
77+
78+
<h2> Filter groups using a function (group-filter="reverseOrderFilterFn")</h2>
79+
<ui-select ng-model="country.selected" theme="select2" ng-disabled="disabled" style="width: 300px;" title="Choose a country">
80+
<ui-select-match placeholder="Select or search a country in the list...">{{$select.selected.name}}</ui-select-match>
81+
<ui-select-choices group-by="firstLetterGroupFn" group-filter="reverseOrderFilterFn" repeat="country in countries | filter: $select.search">
82+
<span ng-bind-html="country.name | highlight: $select.search"></span>
83+
<small ng-bind-html="country.code | highlight: $select.search"></small>
84+
</ui-select-choices>
85+
</ui-select>
86+
87+
88+
</body>
89+
</html>

examples/demo.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ app.controller('DemoCtrl', function($scope, $http, $timeout, $interval) {
7979

8080
};
8181

82+
$scope.firstLetterGroupFn = function (item){
83+
return item.name[0];
84+
};
85+
86+
$scope.reverseOrderFilterFn = function(groups) {
87+
return groups.reverse();
88+
};
89+
8290
$scope.personAsync = {selected : "[email protected]"};
8391
$scope.peopleAsync = [];
8492

examples/select2-bootstrap3.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
</script>
1919
<![endif]-->
2020

21-
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.js"></script>
22-
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular-sanitize.js"></script>
21+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.28/angular.js"></script>
22+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.28/angular-sanitize.js"></script>
2323
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.css">
2424

2525
<!--

examples/selectize-bootstrap3.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
</script>
1919
<![endif]-->
2020

21-
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.js"></script>
22-
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular-sanitize.js"></script>
21+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.28/angular.js"></script>
22+
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.2.28/angular-sanitize.js"></script>
2323
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.css">
2424

2525
<!--

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"repository": {
77
"url": "git://github.com/angular-ui/ui-select.git"
88
},
9-
"version": "0.11.2",
9+
"version": "0.12.0",
1010
"devDependencies": {
1111
"bower": "~1.3",
1212
"del": "~0.1.1",

src/bootstrap/choices.tpl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<ul class="ui-select-choices ui-select-choices-content dropdown-menu"
1+
<ul class="ui-select-choices ui-select-choices-content ui-select-dropdown dropdown-menu"
22
role="listbox"
33
ng-show="$select.items.length > 0">
44
<li class="ui-select-choices-group" id="ui-select-choices-{{ $select.generatedId }}" >

src/common.css

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,31 @@ body > .select2-container.open {
4040
z-index: 9999; /* The z-index Select2 applies to the select2-drop */
4141
}
4242

43+
/* Handle up direction Select2 */
44+
.ui-select-container[theme="select2"].direction-up .ui-select-match {
45+
border-radius: 4px; /* FIXME hardcoded value :-/ */
46+
border-top-left-radius: 0;
47+
border-top-right-radius: 0;
48+
}
49+
.ui-select-container[theme="select2"].direction-up .ui-select-dropdown {
50+
border-radius: 4px; /* FIXME hardcoded value :-/ */
51+
border-bottom-left-radius: 0;
52+
border-bottom-right-radius: 0;
53+
54+
border-top-width: 1px; /* FIXME hardcoded value :-/ */
55+
border-top-style: solid;
56+
57+
box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25);
58+
59+
margin-top: -4px; /* FIXME hardcoded value :-/ */
60+
}
61+
.ui-select-container[theme="select2"].direction-up .ui-select-dropdown .select2-search {
62+
margin-top: 4px; /* FIXME hardcoded value :-/ */
63+
}
64+
.ui-select-container[theme="select2"].direction-up.select2-dropdown-open .ui-select-match {
65+
border-bottom-color: #5897fb;
66+
}
67+
4368
/* Selectize theme */
4469

4570
/* Helper class to show styles when focus */
@@ -62,6 +87,12 @@ body > .select2-container.open {
6287
border-color: #D44950;
6388
}
6489

90+
/* Handle up direction Selectize */
91+
.ui-select-container[theme="selectize"].direction-up .ui-select-dropdown {
92+
box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25);
93+
94+
margin-top: -2px; /* FIXME hardcoded value :-/ */
95+
}
6596

6697
/* Bootstrap theme */
6798

@@ -99,6 +130,11 @@ body > .select2-container.open {
99130
border-top-right-radius: 0;
100131
border-bottom-right-radius: 0;
101132
}
133+
.input-group > .ui-select-bootstrap > input.ui-select-search.form-control.direction-up {
134+
border-radius: 4px !important; /* FIXME hardcoded value :-/ */
135+
border-top-right-radius: 0 !important;
136+
border-bottom-right-radius: 0 !important;
137+
}
102138

103139
.ui-select-bootstrap > .ui-select-match > .btn{
104140
/* Instead of center because of .btn */
@@ -210,4 +246,9 @@ body > .ui-select-bootstrap.open {
210246
/* Mark invalid Bootstrap */
211247
.ui-select-bootstrap.ng-dirty.ng-invalid > button.btn.ui-select-match {
212248
border-color: #D44950;
213-
}
249+
}
250+
251+
/* Handle up direction Bootstrap */
252+
.ui-select-container[theme="bootstrap"].direction-up .ui-select-dropdown {
253+
box-shadow: 0 -4px 8px rgba(0, 0, 0, 0.25);
254+
}

src/select2/select-multiple.tpl.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
ondrop="return false;">
2626
</li>
2727
</ul>
28-
<div class="select2-drop select2-with-searchbox select2-drop-active"
28+
<div class="ui-select-dropdown select2-drop select2-with-searchbox select2-drop-active"
2929
ng-class="{'select2-display-none': !$select.open}">
3030
<div class="ui-select-choices"></div>
3131
</div>
32-
</div>
32+
</div>

src/select2/select.tpl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
'select2-container-active': $select.focus,
55
'select2-allowclear': $select.allowClear && !$select.isEmpty()}">
66
<div class="ui-select-match"></div>
7-
<div class="select2-drop select2-with-searchbox select2-drop-active"
7+
<div class="ui-select-dropdown select2-drop select2-with-searchbox select2-drop-active"
88
ng-class="{'select2-display-none': !$select.open}">
99
<div class="select2-search" ng-show="$select.searchEnabled">
1010
<input type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"

src/selectize/choices.tpl.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div ng-show="$select.open" class="ui-select-choices selectize-dropdown single">
1+
<div ng-show="$select.open" class="ui-select-choices ui-select-dropdown selectize-dropdown single">
22
<div class="ui-select-choices-content selectize-dropdown-content">
33
<div class="ui-select-choices-group optgroup" role="listbox">
44
<div ng-show="$select.isGrouped" class="ui-select-choices-group-label optgroup-header" ng-bind="$group.name"></div>

0 commit comments

Comments
 (0)