1
1
/*!
2
2
* ui-select
3
3
* http://github.com/angular-ui/ui-select
4
- * Version: 0.14.1 - 2016-01-27T22:27:00.452Z
4
+ * Version: 0.14.2 - 2016-02-09T20:04:30.868Z
5
5
* License: MIT
6
6
*/
7
7
8
8
9
- ( function ( ) {
9
+ ( function ( ) {
10
10
"use strict" ;
11
11
var KEY = {
12
12
TAB : 9 ,
@@ -145,7 +145,7 @@ var uis = angular.module('ui.select', [])
145
145
*/
146
146
. filter ( 'highlight' , function ( ) {
147
147
function escapeRegexp ( queryToEscape ) {
148
- return queryToEscape . replace ( / ( [ . ? * + ^ $ [ \] \\ ( ) { } | - ] ) / g, '\\$1' ) ;
148
+ return ( '' + queryToEscape ) . replace ( / ( [ . ? * + ^ $ [ \] \\ ( ) { } | - ] ) / g, '\\$1' ) ;
149
149
}
150
150
151
151
return function ( matchItem , query ) {
@@ -773,7 +773,7 @@ uis.controller('uiSelectCtrl',
773
773
if ( data && data . length > 0 && ctrl . taggingTokens . isActivated ) {
774
774
// split by first token only
775
775
var separator = KEY . toSeparator ( ctrl . taggingTokens . tokens [ 0 ] ) ;
776
- var items = data . split ( separator ) ;
776
+ var items = data . split ( separator ) ;
777
777
if ( items && items . length > 0 ) {
778
778
var oldsearch = ctrl . search ;
779
779
angular . forEach ( items , function ( item ) {
@@ -1002,7 +1002,7 @@ uis.directive('uiSelect',
1002
1002
1003
1003
if ( ! contains && ! $select . clickTriggeredSelect ) {
1004
1004
//Will lose focus only with certain targets
1005
- var focusableControls = [ 'input' , 'button' , 'textarea' ] ;
1005
+ var focusableControls = [ 'input' , 'button' , 'textarea' , 'select' ] ;
1006
1006
var targetController = angular . element ( e . target ) . controller ( 'uiSelect' ) ; //To check if target is other ui-select
1007
1007
var skipFocusser = targetController && targetController !== $select ; //To check if target is other ui-select
1008
1008
if ( ! skipFocusser ) skipFocusser = ~ focusableControls . indexOf ( e . target . tagName . toLowerCase ( ) ) ; //Check if target is input, button or textarea
@@ -1244,7 +1244,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
1244
1244
$select = $scope . $select ,
1245
1245
ngModel ;
1246
1246
1247
- //Wait for link fn to inject it
1247
+ //Wait for link fn to inject it
1248
1248
$scope . $evalAsync ( function ( ) { ngModel = $scope . ngModel ; } ) ;
1249
1249
1250
1250
ctrl . activeMatchIndex = - 1 ;
@@ -1256,7 +1256,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
1256
1256
1257
1257
ctrl . refreshComponent = function ( ) {
1258
1258
//Remove already selected items
1259
- //e.g. When user clicks on a selection, the selected array changes and
1259
+ //e.g. When user clicks on a selection, the selected array changes and
1260
1260
//the dropdown should remove that item
1261
1261
$select . refreshItems ( ) ;
1262
1262
$select . sizeSearchInput ( ) ;
@@ -1355,7 +1355,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
1355
1355
} ;
1356
1356
if ( ! inputValue ) return resultMultiple ; //If ngModel was undefined
1357
1357
for ( var k = inputValue . length - 1 ; k >= 0 ; k -- ) {
1358
- //Check model array of currently selected items
1358
+ //Check model array of currently selected items
1359
1359
if ( ! checkFnMultiple ( $select . selected , inputValue [ k ] ) ) {
1360
1360
//Check model array of all items available
1361
1361
if ( ! checkFnMultiple ( data , inputValue [ k ] ) ) {
@@ -1366,8 +1366,8 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
1366
1366
}
1367
1367
return resultMultiple ;
1368
1368
} ) ;
1369
-
1370
- //Watch for external model changes
1369
+
1370
+ //Watch for external model changes
1371
1371
scope . $watchCollection ( function ( ) { return ngModel . $modelValue ; } , function ( newValue , oldValue ) {
1372
1372
if ( oldValue != newValue ) {
1373
1373
ngModel . $modelValue = null ; //Force scope model value and ngModel value to be out of sync to re-run formatters
@@ -1930,7 +1930,7 @@ uis.service('uisRepeatParser', ['uiSelectMinErr','$parse', function(uiSelectMinE
1930
1930
1931
1931
// if (isObjectCollection){
1932
1932
//00000000000000000000000000000111111111000000000000000222222222222220033333333333333333333330000444444444444444444000000000000000556666660000077777777777755000000000000000000000088888880000000
1933
- match = expression . match ( / ^ \s * (?: ( [ \s \S ] + ?) \s + a s \s + ) ? (?: ( [ \$ \w ] [ \$ \w ] * ) | (?: \( \s * ( [ \$ \w ] [ \$ \w ] * ) \s * , \s * ( [ \$ \w ] [ \$ \w ] * ) \s * \) ) ) \s + i n \s + ( ( [ \w \. ] + ) ? \s * ( | \s * [ \s \S ] + ?) ) ? (?: \s + t r a c k \s + b y \s + ( [ \s \S ] + ?) ) ? \s * $ / ) ;
1933
+ match = expression . match ( / ^ \s * (?: ( [ \s \S ] + ?) \s + a s \s + ) ? (?: ( [ \$ \w ] [ \$ \w ] * ) | (?: \( \s * ( [ \$ \w ] [ \$ \w ] * ) \s * , \s * ( [ \$ \w ] [ \$ \w ] * ) \s * \) ) ) \s + i n \s + ( ( [ \w \. ] + ) ? \s * ( | \s * [ \s \S ] + ?) ) ? (?: \s + t r a c k \s + b y \s + ( [ \s \S ] + ?) ) ? \s * $ / ) ;
1934
1934
1935
1935
// 1 Alias
1936
1936
// 2 Item
@@ -1964,7 +1964,7 @@ uis.service('uisRepeatParser', ['uiSelectMinErr','$parse', function(uiSelectMinE
1964
1964
expression += ' track by ' + this . trackByExp ;
1965
1965
}
1966
1966
return expression ;
1967
- }
1967
+ }
1968
1968
} ;
1969
1969
1970
1970
} ;
@@ -1976,11 +1976,7 @@ uis.service('uisRepeatParser', ['uiSelectMinErr','$parse', function(uiSelectMinE
1976
1976
} ] ) ;
1977
1977
1978
1978
} ( ) ) ;
1979
- < << << << HEAD
1980
- angular . module ( "ui.select" ) . run ( [ "$templateCache" , function ( $templateCache ) { $templateCache . put ( "bootstrap/choices.tpl.html" , "<ul class=\"ui-select-choices ui-select-choices-content ui-select-dropdown dropdown-menu\" role=\"listbox\" ng-show=\"$select.items.length > 0\"><li class=\"ui-select-choices-group\" id=\"ui-select-choices-{{ $select.generatedId }}\"><div class=\"divider\" ng-show=\"$select.isGrouped && $index > 0\"></div><div ng-show=\"$select.isGrouped\" class=\"ui-select-choices-group-label dropdown-header\" ng-bind=\"$group.name\"></div><div id=\"ui-select-choices-row-{{ $select.generatedId }}-{{$index}}\" class=\"ui-select-choices-row\" ng-class=\"{active: $select.isActive(this), disabled: $select.isDisabled(this)}\" role=\"option\"><a ng-click=\"$event.preventDefault()\" class=\"ui-select-choices-row-inner\"></a></div></li></ul>" ) ;
1981
- = === ===
1982
1979
angular . module ( "ui.select" ) . run ( [ "$templateCache" , function ( $templateCache ) { $templateCache . put ( "bootstrap/choices.tpl.html" , "<ul class=\"ui-select-choices ui-select-choices-content ui-select-dropdown dropdown-menu\" role=\"listbox\" ng-show=\"$select.items.length > 0\"><li class=\"ui-select-choices-group\" id=\"ui-select-choices-{{ $select.generatedId }}\"><div class=\"divider\" ng-show=\"$select.isGrouped && $index > 0\"></div><div ng-show=\"$select.isGrouped\" class=\"ui-select-choices-group-label dropdown-header\" ng-bind=\"$group.name\"></div><div id=\"ui-select-choices-row-{{ $select.generatedId }}-{{$index}}\" class=\"ui-select-choices-row\" ng-class=\"{active: $select.isActive(this), disabled: $select.isDisabled(this)}\" role=\"option\"><a href=\"\" class=\"ui-select-choices-row-inner\"></a></div></li></ul>" ) ;
1983
- > >>> >>> 88 aebde5f1b43405d692e4fc368968af4b368621
1984
1980
$templateCache . put ( "bootstrap/match-multiple.tpl.html" , "<span class=\"ui-select-match\"><span ng-repeat=\"$item in $select.selected\"><span class=\"ui-select-match-item btn btn-default btn-xs\" tabindex=\"-1\" type=\"button\" ng-disabled=\"$select.disabled\" ng-click=\"$selectMultiple.activeMatchIndex = $index;\" ng-class=\"{\'btn-primary\':$selectMultiple.activeMatchIndex === $index, \'select-locked\':$select.isLocked(this, $index)}\" ui-select-sort=\"$select.selected\"><span class=\"close ui-select-match-close\" ng-hide=\"$select.disabled\" ng-click=\"$selectMultiple.removeChoice($index)\"> ×</span> <span uis-transclude-append=\"\"></span></span></span></span>" ) ;
1985
1981
$templateCache . put ( "bootstrap/match.tpl.html" , "<div class=\"ui-select-match\" ng-hide=\"$select.searchEnabled && $select.open\" ng-disabled=\"$select.disabled\" ng-class=\"{\'btn-default-focus\':$select.focus}\"><span tabindex=\"-1\" class=\"btn btn-default form-control ui-select-toggle\" aria-label=\"{{ $select.baseTitle }} activate\" ng-disabled=\"$select.disabled\" ng-click=\"$select.activate()\" style=\"outline: 0;\"><span ng-show=\"$select.isEmpty()\" class=\"ui-select-placeholder text-muted\">{{$select.placeholder}}</span> <span ng-hide=\"$select.isEmpty()\" class=\"ui-select-match-text pull-left\" ng-class=\"{\'ui-select-allow-clear\': $select.allowClear && !$select.isEmpty()}\" ng-transclude=\"\"></span> <i class=\"caret pull-right\" ng-click=\"$select.toggle($event)\"></i> <a ng-show=\"$select.allowClear && !$select.isEmpty()\" aria-label=\"{{ $select.baseTitle }} clear\" style=\"margin-right: 10px\" ng-click=\"$select.clear($event)\" class=\"btn btn-xs btn-link pull-right\"><i class=\"glyphicon glyphicon-remove\" aria-hidden=\"true\"></i></a></span></div>" ) ;
1986
1982
$templateCache . put ( "bootstrap/select-multiple.tpl.html" , "<div class=\"ui-select-container ui-select-multiple ui-select-bootstrap dropdown form-control\" ng-class=\"{open: $select.open}\"><div><div class=\"ui-select-match\"></div><input type=\"text\" autocomplete=\"false\" autocorrect=\"off\" autocapitalize=\"off\" spellcheck=\"false\" class=\"ui-select-search input-xs\" placeholder=\"{{$selectMultiple.getPlaceholder()}}\" ng-disabled=\"$select.disabled\" ng-hide=\"$select.disabled\" ng-click=\"$select.activate()\" ng-model=\"$select.search\" role=\"combobox\" aria-label=\"{{ $select.baseTitle }}\" ondrop=\"return false;\"></div><div class=\"ui-select-choices\"></div></div>" ) ;
@@ -1992,4 +1988,4 @@ $templateCache.put("select2/select-multiple.tpl.html","<div class=\"ui-select-co
1992
1988
$templateCache . put ( "select2/select.tpl.html" , "<div class=\"ui-select-container select2 select2-container\" ng-class=\"{\'select2-container-active select2-dropdown-open open\': $select.open, \'select2-container-disabled\': $select.disabled, \'select2-container-active\': $select.focus, \'select2-allowclear\': $select.allowClear && !$select.isEmpty()}\"><div class=\"ui-select-match\"></div><div class=\"ui-select-dropdown select2-drop select2-with-searchbox select2-drop-active\" ng-class=\"{\'select2-display-none\': !$select.open}\"><div class=\"select2-search\" ng-show=\"$select.searchEnabled\"><input type=\"text\" autocomplete=\"false\" autocorrect=\"false\" autocapitalize=\"off\" spellcheck=\"false\" role=\"combobox\" aria-expanded=\"true\" aria-owns=\"ui-select-choices-{{ $select.generatedId }}\" aria-label=\"{{ $select.baseTitle }}\" aria-activedescendant=\"ui-select-choices-row-{{ $select.generatedId }}-{{ $select.activeIndex }}\" class=\"ui-select-search select2-input\" ng-model=\"$select.search\"></div><div class=\"ui-select-choices\"></div></div></div>" ) ;
1993
1989
$templateCache . put ( "selectize/choices.tpl.html" , "<div ng-show=\"$select.open\" class=\"ui-select-choices ui-select-dropdown selectize-dropdown single\"><div class=\"ui-select-choices-content selectize-dropdown-content\"><div class=\"ui-select-choices-group optgroup\" role=\"listbox\"><div ng-show=\"$select.isGrouped\" class=\"ui-select-choices-group-label optgroup-header\" ng-bind=\"$group.name\"></div><div role=\"option\" class=\"ui-select-choices-row\" ng-class=\"{active: $select.isActive(this), disabled: $select.isDisabled(this)}\"><div class=\"option ui-select-choices-row-inner\" data-selectable=\"\"></div></div></div></div></div>" ) ;
1994
1990
$templateCache . put ( "selectize/match.tpl.html" , "<div ng-hide=\"($select.open || $select.isEmpty())\" class=\"ui-select-match\" ng-transclude=\"\"></div>" ) ;
1995
- $templateCache . put ( "selectize/select.tpl.html" , "<div class=\"ui-select-container selectize-control single\" ng-class=\"{\'open\': $select.open}\"><div class=\"selectize-input\" ng-class=\"{\'focus\': $select.open, \'disabled\': $select.disabled, \'selectize-focus\' : $select.focus}\" ng-click=\"$select.activate()\"><div class=\"ui-select-match\"></div><input type=\"text\" autocomplete=\"false\" tabindex=\"-1\" class=\"ui-select-search ui-select-toggle\" ng-click=\"$select.toggle($event)\" placeholder=\"{{$select.placeholder}}\" ng-model=\"$select.search\" ng-hide=\"!$select.searchEnabled || ($select.selected && !$select.open)\" ng-disabled=\"$select.disabled\" aria-label=\"{{ $select.baseTitle }}\"></div><div class=\"ui-select-choices\"></div></div>" ) ; } ] ) ;
1991
+ $templateCache . put ( "selectize/select.tpl.html" , "<div class=\"ui-select-container selectize-control single\" ng-class=\"{\'open\': $select.open}\"><div class=\"selectize-input\" ng-class=\"{\'focus\': $select.open, \'disabled\': $select.disabled, \'selectize-focus\' : $select.focus}\" ng-click=\"$select.open && !$select.searchEnabled ? $select.toggle($event) : $select. activate()\"><div class=\"ui-select-match\"></div><input type=\"text\" autocomplete=\"false\" tabindex=\"-1\" class=\"ui-select-search ui-select-toggle\" ng-click=\"$select.toggle($event)\" placeholder=\"{{$select.placeholder}}\" ng-model=\"$select.search\" ng-hide=\"!$select.searchEnabled || ($select.selected && !$select.open)\" ng-disabled=\"$select.disabled\" aria-label=\"{{ $select.baseTitle }}\"></div><div class=\"ui-select-choices\"></div></div>" ) ; } ] ) ;
0 commit comments