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.3 - 2016-02-18T15:32:28.698Z
5
5
* License: MIT
6
6
*/
7
7
@@ -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 ) {
@@ -184,6 +184,9 @@ uis.directive('uiSelectChoices',
184
184
replace : true ,
185
185
transclude : true ,
186
186
templateUrl : function ( tElement ) {
187
+ // Needed so the uiSelect can detect the transcluded content
188
+ tElement . addClass ( 'ui-select-choices' ) ;
189
+
187
190
// Gets theme attribute from parent (ui-select)
188
191
var theme = tElement . parent ( ) . attr ( 'theme' ) || uiSelectConfig . theme ;
189
192
return theme + '/choices.tpl.html' ;
@@ -1002,7 +1005,7 @@ uis.directive('uiSelect',
1002
1005
1003
1006
if ( ! contains && ! $select . clickTriggeredSelect ) {
1004
1007
//Will lose focus only with certain targets
1005
- var focusableControls = [ 'input' , 'button' , 'textarea' ] ;
1008
+ var focusableControls = [ 'input' , 'button' , 'textarea' , 'select' ] ;
1006
1009
var targetController = angular . element ( e . target ) . controller ( 'uiSelect' ) ; //To check if target is other ui-select
1007
1010
var skipFocusser = targetController && targetController !== $select ; //To check if target is other ui-select
1008
1011
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) {
1207
1210
replace : true ,
1208
1211
transclude : true ,
1209
1212
templateUrl : function ( tElement ) {
1213
+ // Needed so the uiSelect can detect the transcluded content
1214
+ tElement . addClass ( 'ui-select-match' ) ;
1215
+
1210
1216
// Gets theme attribute from parent (ui-select)
1211
1217
var theme = tElement . parent ( ) . attr ( 'theme' ) || uiSelectConfig . theme ;
1212
1218
var multi = tElement . parent ( ) . attr ( 'multiple' ) ;
@@ -1340,10 +1346,13 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
1340
1346
locals [ $select . parserResult . itemName ] = list [ p ] ;
1341
1347
result = $select . parserResult . modelMapper ( scope , locals ) ;
1342
1348
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
+ }
1347
1356
}
1348
1357
}
1349
1358
if ( angular . equals ( result , value ) ) {
@@ -1988,4 +1997,4 @@ $templateCache.put("select2/select-multiple.tpl.html","<div class=\"ui-select-co
1988
1997
$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>" ) ;
1989
1998
$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>" ) ;
1990
1999
$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