Skip to content

Commit b8bcd8a

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 6d6baac + 3843e0d commit b8bcd8a

27 files changed

+1545
-340
lines changed

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/node_modules
33
/.idea
44
/.tmp
5+
.DS_Store

Diff for: README.md

+6-127
Original file line numberDiff line numberDiff line change
@@ -4,144 +4,23 @@ AngularJS-native version of [Select2](http://ivaynberg.github.io/select2/) and [
44

55
- [Demo](http://plnkr.co/edit/a3KlK8dKH3wwiiksDSn2?p=preview)
66
- [Demo Multiselect](http://plnkr.co/edit/juqoNOt1z1Gb349XabQ2?p=preview)
7-
- [Bootstrap theme](http://plnkr.co/edit/QCwSM75ilH2Vh6D9aMA4?p=preview)
7+
- [Examples](https://github.com/angular-ui/ui-select/blob/master/examples)
8+
- [Documentation](https://github.com/angular-ui/ui-select/wiki)
89

9-
Check [examples](https://github.com/angular-ui/ui-select/blob/master/examples).
1010

1111
## Features
1212

13-
- Search and select
14-
- Available themes: Bootstrap, Select2 and Selectize
13+
- Search, Select, and Multi-select
14+
- Themes: Bootstrap, Select2 and Selectize
1515
- Keyboard support
1616
- jQuery not required (except for old browsers)
17-
- Small code base: 400 lines of JavaScript vs 20 KB for select2.min.js
17+
- Small code base: 4.57KB min/gzipped vs 20KB for select2
1818

1919
For the roadmap, check [issue #3](https://github.com/angular-ui/ui-select/issues/3) and the [Wiki page](https://github.com/angular-ui/ui-select/wiki/Roadmap).
2020

21-
## Browser compatibility
22-
23-
Starting from Internet Explorer 8 and Firefox 3.6 included.
24-
25-
## Installation using [Bower](http://bower.io/)
26-
27-
28-
- `bower install angular-ui-select`
29-
- Inside your HTML add
30-
- select.js: `<script src="bower_components/angular-ui-select/dist/select.min.js"></script>`
31-
- select.css: `<link rel="stylesheet" href="bower_components/angular-ui-select/dist/select.min.css">`
32-
- Add the `ui.select` module as a dependency: `angular.module("myApp", ["ui.select"]);`
33-
34-
### Bootstrap theme
35-
36-
If you already use Bootstrap, this theme will save you a lot of CSS code compared to the Select2 and Selectize themes.
37-
38-
Bower:
39-
- `bower install bootstrap`
40-
- `<link rel="stylesheet" href="bower_components/bootstrap/dist/css/bootstrap.css">`
41-
- Or the [LESS](http://lesscss.org/) version: `@import "bower_components/bootstrap/less/bootstrap.less";`
42-
43-
[Bootstrap CDN](http://www.bootstrapcdn.com/):
44-
- `<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.css">`
45-
46-
Configuration:
47-
```JavaScript
48-
app.config(function(uiSelectConfig) {
49-
uiSelectConfig.theme = 'bootstrap';
50-
});
51-
```
52-
53-
### Select2 theme
54-
55-
Bower:
56-
- `bower install select2#~3.4.5`
57-
- `<link rel="stylesheet" href="bower_components/select2/select2.css">`
58-
59-
[cdnjs](http://cdnjs.com/):
60-
- `<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/select2/3.4.5/select2.css">`
61-
62-
Configuration:
63-
```JavaScript
64-
app.config(function(uiSelectConfig) {
65-
uiSelectConfig.theme = 'select2';
66-
});
67-
```
68-
69-
### Selectize theme
70-
71-
Bower:
72-
- `bower install selectize#~0.8.5`
73-
- `<link rel="stylesheet" href="bower_components/selectize/dist/css/selectize.default.css">`
74-
- Or the [LESS](http://lesscss.org/) version: `@import "bower_components/selectize/dist/less/selectize.default.less";`
75-
76-
[cdnjs](http://cdnjs.com/):
77-
- `<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/selectize.js/0.8.5/css/selectize.default.css">`
78-
79-
Configuration:
80-
```JavaScript
81-
app.config(function(uiSelectConfig) {
82-
uiSelectConfig.theme = 'selectize';
83-
});
84-
```
85-
86-
## FAQ
87-
88-
### ng-model not working with a simple variable on $scope
89-
90-
You cannot write:
91-
```HTML
92-
<ui-select ng-model="item"> <!-- Wrong -->
93-
[...]
94-
</ui-select>
95-
```
96-
97-
You need to write:
98-
```HTML
99-
<ui-select ng-model="item.selected"> <!-- Correct -->
100-
[...]
101-
</ui-select>
102-
```
103-
104-
Or:
105-
```HTML
106-
<ui-select ng-model="$parent.item"> <!-- Hack -->
107-
[...]
108-
</ui-select>
109-
```
110-
111-
For more explanations, check [ui-select #18](https://github.com/angular-ui/ui-select/issues/18) and [angular.js #6199](https://github.com/angular/angular.js/issues/6199).
112-
113-
### ng-bind-html gives me "Error: [$sce:unsafe] Attempting to use an unsafe value in a safe context"
114-
115-
You need to use module [ngSanitize](http://docs.angularjs.org/api/ngSanitize) (recommended) or [$sce](http://docs.angularjs.org/api/ng/service/$sce):
116-
117-
```JavaScript
118-
$scope.trustAsHtml = function(value) {
119-
return $sce.trustAsHtml(value);
120-
};
121-
```
122-
123-
```HTML
124-
<div ng-bind-html="trustAsHtml((item | highlight: $select.search))"></div>
125-
```
126-
127-
### I get "TypeError: Object [...] has no method 'indexOf' at htmlParser"
128-
129-
You are using ng-bind-html with a number:
130-
```HTML
131-
<div ng-bind-html="person.age | highlight: $select.search"></div>
132-
```
133-
134-
You should write instead:
135-
```HTML
136-
<div ng-bind-html="''+person.age | highlight: $select.search"></div>
137-
```
138-
139-
Or:
140-
```HTML
141-
<div ng-bind-html="person.age.toString() | highlight: $select.search"></div>
142-
```
14321

14422
## Development
23+
14524
### Prepare your environment
14625
* Install [Node.js](http://nodejs.org/) and NPM (should come with)
14726
* Install global dev dependencies: `npm install -g bower gulp`

Diff for: bower.json

+8-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ui-select",
3-
"version": "0.7.0",
3+
"version": "0.9.5",
44
"homepage": "https://github.com/angular-ui/ui-select",
55
"authors": [
66
"AngularUI"
@@ -13,14 +13,17 @@
1313
"node_modules",
1414
"bower_components",
1515
"src",
16-
"test"
16+
"test",
17+
"gulpfile.js",
18+
"karma.conf.js",
19+
"examples"
1720
],
1821
"dependencies": {
19-
"angular": "~1.2"
22+
"angular": ">=1.2.18"
2023
},
2124
"devDependencies": {
2225
"jquery": "~1.11",
23-
"angular-sanitize": "~1.2",
24-
"angular-mocks": "~1.2"
26+
"angular-sanitize": ">=1.2.18",
27+
"angular-mocks": ">=1.2.18"
2528
}
2629
}

Diff for: dist/select.css

+20-1
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.7.0 - 2014-09-09T01:02:43.612Z
4+
* Version: 0.9.5 - 2014-12-12T16:07:20.859Z
55
* License: MIT
66
*/
77

@@ -36,6 +36,14 @@
3636
padding-left: 0;
3737
}
3838

39+
.select2-locked > .select2-search-choice-close{
40+
display:none;
41+
}
42+
43+
.select-locked > .ui-select-match-close{
44+
display:none;
45+
}
46+
3947
/* Selectize theme */
4048

4149
/* Helper class to show styles when focus */
@@ -121,6 +129,10 @@
121129
line-height: 0.75;
122130
}
123131

132+
.ui-select-multiple.ui-select-bootstrap .ui-select-match-item{
133+
outline: 0;
134+
}
135+
124136
.ui-select-bootstrap .ui-select-choices-row>a {
125137
display: block;
126138
padding: 3px 20px;
@@ -144,6 +156,13 @@
144156
background-color: #428bca;
145157
}
146158

159+
.ui-select-bootstrap .ui-select-choices-row.disabled>a,
160+
.ui-select-bootstrap .ui-select-choices-row.active.disabled>a {
161+
color: #777;
162+
cursor: not-allowed;
163+
background-color: #fff;
164+
}
165+
147166
/* fix hide/show angular animation */
148167
.ui-select-match.ng-hide-add,
149168
.ui-select-search.ng-hide-add {

0 commit comments

Comments
 (0)