Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Refactor branch #1134

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
33f4d9f
refresh on active
abudel Feb 2, 2015
453294f
add onBeforeSelect callback
jnelson Jul 8, 2015
a62af5b
remove unused on-select attribute
jnelson Jul 8, 2015
326dd7f
remove duration
jnelson Jul 9, 2015
bb8bfd0
use typical promise-handling convention
jnelson Jul 9, 2015
284dc83
add test for promise resolve success
jnelson Jul 9, 2015
cb0f415
Don't hide select when SearchEnable is false
cdjackson Jul 26, 2015
bac9618
Merge branch 'master' of https://github.com/angular-ui/ui-select into…
cdjackson Jul 28, 2015
7e05796
Protect against empty selection causing exception when getting placeh…
cdjackson May 25, 2015
bd76b87
Fix styling for bootstrap placeholder
cdjackson Apr 22, 2015
69a1604
Fix width calculation to allow for different padding
cdjackson Apr 22, 2015
5c370c3
Don't hide select when SearchEnable is false
cdjackson Jul 26, 2015
f58fe8a
Limit the number of selections allowed in multiple mode
cdjackson Jul 26, 2015
58edeb7
Merge branch 'feat-beforeselect' of https://github.com/jnelson/ui-sel…
cdjackson Jul 28, 2015
4eaf47d
Update examples to add search-enabled example
cdjackson Jul 28, 2015
fe95479
Remove watches on static options
cdjackson Jul 28, 2015
84f4a7c
Merge branch 'master' of https://github.com/angular-ui/ui-select into…
cdjackson Aug 1, 2015
86c2ab0
Update to move search box off screen
cdjackson Aug 1, 2015
1d9a673
Fix test to check against ui-select-offscreen class, not ng-hide
cdjackson Aug 1, 2015
1a17265
Merge branch 'master' of https://github.com/angular-ui/ui-select into…
cdjackson Aug 1, 2015
aa23bf7
Merge branch 'fix_issue_453' into refactor_v1
cdjackson Aug 1, 2015
00c5301
Merge branch 'limit_multi_select' into refactor_v1
cdjackson Aug 1, 2015
af50d36
Remove watch on refreshDelay
cdjackson Aug 2, 2015
24975b5
Merge branch 'master' of https://github.com/abudel/ui-select into ref…
cdjackson Aug 2, 2015
287febf
Update search disabled example to remove search attributes
cdjackson Aug 2, 2015
e0ba3f3
Initial refactoring to remove tagging and add lifecycle calls (+1 squ…
cdjackson Aug 2, 2015
b768308
Refactor
cdjackson Aug 4, 2015
a717820
Update callback handlers
cdjackson Aug 5, 2015
5b3bf5c
Remove tagging tests
cdjackson Aug 5, 2015
59ec205
Add sort directive and update tests
cdjackson Aug 6, 2015
4e85291
Remove keymap as not used
cdjackson Aug 6, 2015
0291bbf
Update to fix "typing goes on last focused component"
cdjackson Aug 9, 2015
cbea928
Update callbacks and tests
cdjackson Aug 9, 2015
9147326
Update tagging paste and tests
cdjackson Aug 11, 2015
14a5789
Update dist folder
cdjackson Aug 12, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 48 additions & 13 deletions examples/bootstrap.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,28 +36,63 @@
<body ng-controller="DemoCtrl">
<script src="demo.js"></script>

<p>Selected: {{person.selected.name}}</p>
<p>Selected:
<span ng-repeat="p in [].concat(person.selected)">
<span ng-if="!$first">,</span>
{{p.name}}
</span>
</p>

<form class="form-horizontal">
<fieldset>
<legend>ui-select inside a Bootstrap form</legend>

<div class="form-group">
<label class="col-sm-3 control-label">Default</label>
<div class="col-sm-6">
<div class="form-group">
<label class="col-sm-3 control-label">Default</label>
<div class="col-sm-6">

<ui-select ng-model="person.selected" theme="bootstrap">
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="item in people | filter: $select.search">
<div ng-bind-html="item.name | highlight: $select.search"></div>
<small ng-bind-html="item.email | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>
<ui-select ng-model="person.selected" theme="bootstrap">
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="item in people | filter: $select.search">
<div ng-bind-html="item.name | highlight: $select.search"></div>
<small ng-bind-html="item.email | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>

</div>
</div>
</div>

<div class="form-group">
<div class="form-group">
<label class="col-sm-3 control-label">Search Disabled</label>
<div class="col-sm-6">

<ui-select ng-model="person.selected" theme="bootstrap" search-enabled="false">
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}</ui-select-match>
<ui-select-choices repeat="item in people">
<div ng-bind-html="item.name"></div>
<small ng-bind-html="item.email"></small>
</ui-select-choices>
</ui-select>

</div>
</div>

<div class="form-group">
<label class="col-sm-3 control-label">Multiple</label>
<div class="col-sm-6">

<ui-select multiple ng-model="person.selected" theme="bootstrap" class="form-control" sortable="false" close-on-select="false">
<ui-select-match placeholder="Select or search a person in the list...">{{$item.name}}</ui-select-match>
<ui-select-choices repeat="item in people | filter: $select.search">
<div ng-bind-html="item.name | highlight: $select.search"></div>
<small ng-bind-html="item.email | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>

</div>
</div>

<div class="form-group">
<label class="col-sm-3 control-label">Grouped</label>
<div class="col-sm-6">

Expand Down
192 changes: 192 additions & 0 deletions examples/newdemo.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
<!DOCTYPE html>
<html lang="en" ng-app="demo">
<head>
<meta charset="utf-8">
<title>AngularJS ui-select</title>

<!--
IE8 support, see AngularJS Internet Explorer Compatibility http://docs.angularjs.org/guide/ie
For Firefox 3.6, you will also need to include jQuery and ECMAScript 5 shim
-->
<!--[if lt IE 9]>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/es5-shim/2.2.0/es5-shim.js"></script>
<script>
document.createElement('ui-select');
document.createElement('ui-select-match');
document.createElement('ui-select-choices');
</script>
<![endif]-->

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

<!-- ui-select files -->
<script src="../dist/select.js"></script>
<link rel="stylesheet" href="../dist/select.css">

<style>
body {
padding: 15px;
}
</style>
</head>

<body ng-controller="DemoCtrl">
<script src="newdemo.js"></script>

<p>Selected: {{person.selected.name}}</p>

<form class="form-horizontal">
<fieldset>
<legend>ui-select inside a Bootstrap form</legend>
<!--
<div class="form-group">
<label class="col-sm-3 control-label">Default</label>

<div class="col-sm-6">

<ui-select ng-model="person.selected" theme="bootstrap">
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}
</ui-select-match>
<ui-select-choices repeat="item in people | filter: $select.search">
<div ng-bind-html="item.name | highlight: $select.search"></div>
<small ng-bind-html="item.email | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>
</div>
</div>

<div class="form-group">
<label class="col-sm-3 control-label">Search Disabled</label>

<div class="col-sm-6">

<ui-select ng-model="person.selected" theme="bootstrap" search-enabled="false">
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}
</ui-select-match>
<ui-select-choices repeat="item in people">
<div ng-bind-html="item.name"></div>
<small ng-bind-html="item.email"></small>
</ui-select-choices>
</ui-select>

</div>
</div>

<div class="form-group">
<label class="col-sm-3 control-label">Multiple (sortable)</label>

<div class="col-sm-6">

<ui-select multiple ng-model="person.selected" theme="bootstrap" class="form-control" sortable="true"
close-on-select="false">
<ui-select-match placeholder="Select or search a person in the list...">{{$item.name}}
</ui-select-match>
<ui-select-choices repeat="item in people | filter: $select.search">
<div ng-bind-html="item.name | highlight: $select.search"></div>
<small ng-bind-html="item.email | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>

</div>
</div>

<div class="form-group">
<label class="col-sm-3 control-label">Grouped</label>

<div class="col-sm-6">

<ui-select ng-model="person.selected" theme="bootstrap">
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}
</ui-select-match>
<ui-select-choices group-by="'country'" repeat="item in people | filter: $select.search">
<span ng-bind-html="item.name | highlight: $select.search"></span>
<small ng-bind-html="item.email | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>

</div>
</div>

<div class="form-group">
<label class="col-sm-3 control-label">With a clear button</label>

<div class="col-sm-6">
<div class="input-group">

<ui-select allow-clear ng-model="person.selected" theme="bootstrap">
<ui-select-match placeholder="Select or search a person in the list...">
{{$select.selected.name}}
</ui-select-match>
<ui-select-choices repeat="item in people | filter: $select.search">
<span ng-bind-html="item.name | highlight: $select.search"></span>
<small ng-bind-html="item.email | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>

<span class="input-group-btn">
<button ng-click="person.selected = undefined" class="btn btn-default">
<span class="glyphicon glyphicon-trash"></span>
</button>
</span>

</div>
</div>
</div>

<div class="form-group">
<label class="col-sm-3 control-label">Disabled</label>

<div class="col-sm-6">
<ui-select ng-model="person.selected" theme="bootstrap" ng-disabled="true">
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}
</ui-select-match>
<ui-select-choices repeat="item in people | filter: $select.search">
<div ng-bind-html="item.name | highlight: $select.search"></div>
<small ng-bind-html="item.email | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>
</div>
</div>
-->
<div class="form-group">
<label class="col-sm-3 control-label">Tagging</label>

<div class="col-sm-6">
<ui-select multiple ng-model="multipleDemo.colors" theme="bootstrap"
ng-disabled="disabled" title="Choose a color"
ui-select-tagging
>
<ui-select-match placeholder="Select colors...">{{$item}}</ui-select-match>
<ui-select-choices repeat="color in availableColors | filter:$select.search">
{{color}}
</ui-select-choices>
</ui-select>
</div>
</div>
<!--
<div class="form-group">
<label class="col-sm-3 control-label">Combo Box</label>

<div class="col-sm-6">
<ui-select ng-model="person.selected" theme="bootstrap"
on-keypress="onComboKeypress(event)"
on-before-select="onComboBeforeSelect($item)"
ui-select-manual type="INTEGER">
<ui-select-match placeholder="Select or search a person in the list...">{{$select.selected.name}}
</ui-select-match>
<ui-select-choices repeat="item in people | filter: $select.search">
<div ng-bind-html="item.name | highlight: $select.search"></div>
<small ng-bind-html="item.email | highlight: $select.search"></small>
</ui-select-choices>
</ui-select>
</div>
</div>
-->
</fieldset>
</form>

</body>
</html>
Loading