11/*!
22 * ui-select
33 * http://github.com/angular-ui/ui-select
4- * Version: 0.14.1 - 2016-01-27T22:27:00.452Z
4+ * Version: 0.14.3 - 2016-02-18T15:32:28.698Z
55 * License: MIT
66 */
77
@@ -145,7 +145,7 @@ var uis = angular.module('ui.select', [])
145145 */
146146. filter ( 'highlight' , function ( ) {
147147 function escapeRegexp ( queryToEscape ) {
148- return queryToEscape . replace ( / ( [ . ? * + ^ $ [ \] \\ ( ) { } | - ] ) / g, '\\$1' ) ;
148+ return ( '' + queryToEscape ) . replace ( / ( [ . ? * + ^ $ [ \] \\ ( ) { } | - ] ) / g, '\\$1' ) ;
149149 }
150150
151151 return function ( matchItem , query ) {
@@ -184,6 +184,9 @@ uis.directive('uiSelectChoices',
184184 replace : true ,
185185 transclude : true ,
186186 templateUrl : function ( tElement ) {
187+ // Needed so the uiSelect can detect the transcluded content
188+ tElement . addClass ( 'ui-select-choices' ) ;
189+
187190 // Gets theme attribute from parent (ui-select)
188191 var theme = tElement . parent ( ) . attr ( 'theme' ) || uiSelectConfig . theme ;
189192 return theme + '/choices.tpl.html' ;
@@ -1002,7 +1005,7 @@ uis.directive('uiSelect',
10021005
10031006 if ( ! contains && ! $select . clickTriggeredSelect ) {
10041007 //Will lose focus only with certain targets
1005- var focusableControls = [ 'input' , 'button' , 'textarea' ] ;
1008+ var focusableControls = [ 'input' , 'button' , 'textarea' , 'select' ] ;
10061009 var targetController = angular . element ( e . target ) . controller ( 'uiSelect' ) ; //To check if target is other ui-select
10071010 var skipFocusser = targetController && targetController !== $select ; //To check if target is other ui-select
10081011 if ( ! skipFocusser ) skipFocusser = ~ focusableControls . indexOf ( e . target . tagName . toLowerCase ( ) ) ; //Check if target is input, button or textarea
@@ -1207,6 +1210,9 @@ uis.directive('uiSelectMatch', ['uiSelectConfig', function(uiSelectConfig) {
12071210 replace : true ,
12081211 transclude : true ,
12091212 templateUrl : function ( tElement ) {
1213+ // Needed so the uiSelect can detect the transcluded content
1214+ tElement . addClass ( 'ui-select-match' ) ;
1215+
12101216 // Gets theme attribute from parent (ui-select)
12111217 var theme = tElement . parent ( ) . attr ( 'theme' ) || uiSelectConfig . theme ;
12121218 var multi = tElement . parent ( ) . attr ( 'multiple' ) ;
@@ -1340,10 +1346,13 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
13401346 locals [ $select . parserResult . itemName ] = list [ p ] ;
13411347 result = $select . parserResult . modelMapper ( scope , locals ) ;
13421348 if ( $select . parserResult . trackByExp ) {
1343- var matches = / \. ( .+ ) / . exec ( $select . parserResult . trackByExp ) ;
1344- if ( matches . length > 0 && result [ matches [ 1 ] ] == value [ matches [ 1 ] ] ) {
1345- resultMultiple . unshift ( list [ p ] ) ;
1346- return true ;
1349+ var propsItemNameMatches = / ( \w * ) \. / . exec ( $select . parserResult . trackByExp ) ;
1350+ var matches = / \. ( [ ^ \s ] + ) / . exec ( $select . parserResult . trackByExp ) ;
1351+ if ( propsItemNameMatches . length > 0 && propsItemNameMatches [ 1 ] == $select . parserResult . itemName ) {
1352+ if ( matches . length > 0 && result [ matches [ 1 ] ] == value [ matches [ 1 ] ] ) {
1353+ resultMultiple . unshift ( list [ p ] ) ;
1354+ return true ;
1355+ }
13471356 }
13481357 }
13491358 if ( angular . equals ( result , value ) ) {
@@ -1988,4 +1997,4 @@ $templateCache.put("select2/select-multiple.tpl.html","<div class=\"ui-select-co
19881997$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>" ) ;
19891998$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>" ) ;
19901999$templateCache . put ( "selectize/match.tpl.html" , "<div ng-hide=\"($select.open || $select.isEmpty())\" class=\"ui-select-match\" ng-transclude=\"\"></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.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>" ) ; } ] ) ;
2000+ $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