Skip to content

Commit 136fdb7

Browse files
dimircpgrm
authored andcommitted
chore(build): v0.13.1
1 parent c27c190 commit 136fdb7

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ui-select",
3-
"version": "0.13.0",
3+
"version": "0.13.1",
44
"homepage": "https://github.com/angular-ui/ui-select",
55
"authors": [
66
"AngularUI"

dist/select.js

Lines changed: 28 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ uis.controller('uiSelectCtrl',
394394
$scope.$uisSource = Object.keys(originalSource($scope)).map(function(v){
395395
var result = {};
396396
result[ctrl.parserResult.keyName] = v;
397-
result.value = $scope[ctrl.parserResult.sourceName][v];
397+
result.value = $scope.peopleObj[v];
398398
return result;
399399
});
400400
};
@@ -408,7 +408,6 @@ uis.controller('uiSelectCtrl',
408408
}
409409

410410
ctrl.refreshItems = function (data){
411-
$scope.calculateDropdownPos();
412411
data = data || ctrl.parserResult.source($scope);
413412
var selectedItems = ctrl.selected;
414413
//TODO should implement for single mode removeSelected
@@ -420,6 +419,9 @@ uis.controller('uiSelectCtrl',
420419
ctrl.setItemsFn(filteredItems);
421420
}
422421
}
422+
if (ctrl.dropdownPosition === 'auto' || ctrl.dropdownPosition === 'up'){
423+
$scope.calculateDropdownPos();
424+
}
423425
};
424426

425427
// See https://github.com/angular/angular.js/blob/v1.2.15/src/ng/directive/ngRepeat.js#L259
@@ -1855,21 +1857,39 @@ uis.service('uisRepeatParser', ['uiSelectMinErr','$parse', function(uiSelectMinE
18551857
self.parse = function(expression) {
18561858

18571859

1858-
//0000000000000000000000000000000000011111111100000000000000022222222222222003333333333333333333333000044444444444444444400000000000000005555500000666666666666600000000000000000000007777777770000000
1859-
var match = expression.match(/^\s*(?:([\s\S]+?)\s+as\s+)?(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\w]+)\s*(|\s*[\s\S]+?)?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);
1860+
var match;
1861+
var isObjectCollection = /\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)/.test(expression);
1862+
// If an array is used as collection
1863+
1864+
// if (isObjectCollection){
1865+
//00000000000000000000000000000111111111000000000000000222222222222220033333333333333333333330000444444444444444444000000000000000556666660000077777777777755000000000000000000000088888880000000
1866+
match = expression.match(/^\s*(?:([\s\S]+?)\s+as\s+)?(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+(([\w]+)?\s*(|\s*[\s\S]+?))?(?:\s+track\s+by\s+([\s\S]+?))?\s*$/);
1867+
1868+
// 1 Alias
1869+
// 2 Item
1870+
// 3 Key on (key,value)
1871+
// 4 Value on (key,value)
1872+
// 5 Collection expresion (only used when using an array collection)
1873+
// 6 Object that will be converted to Array when using (key,value) syntax
1874+
// 7 Filters that will be applied to #6 when using (key,value) syntax
1875+
// 8 Track by
18601876

18611877
if (!match) {
18621878
throw uiSelectMinErr('iexp', "Expected expression in form of '_item_ in _collection_[ track by _id_]' but got '{0}'.",
18631879
expression);
18641880
}
1881+
if (!match[6] && isObjectCollection) {
1882+
throw uiSelectMinErr('iexp', "Expected expression in form of '_item_ as (_key_, _item_) in _ObjCollection_ [ track by _id_]' but got '{0}'.",
1883+
expression);
1884+
}
18651885

18661886
return {
18671887
itemName: match[4] || match[2], // (lhs) Left-hand side,
18681888
keyName: match[3], //for (key, value) syntax
1869-
source: $parse(!match[3] ? match[5] + (match[6] || ''): match[5]), //concat source with filters if its an array
1870-
sourceName: match[5],
1871-
filters: match[6],
1872-
trackByExp: match[7],
1889+
source: $parse(!match[3] ? match[5] : match[6]),
1890+
sourceName: match[6],
1891+
filters: match[7],
1892+
trackByExp: match[8],
18731893
modelMapper: $parse(match[1] || match[4] || match[2]),
18741894
repeatExpression: function (grouped) {
18751895
var expression = this.itemName + ' in ' + (grouped ? '$group.items' : '$select.items');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"repository": {
77
"url": "git://github.com/angular-ui/ui-select.git"
88
},
9-
"version": "0.13.0",
9+
"version": "0.13.1",
1010
"devDependencies": {
1111
"bower": "~1.3",
1212
"del": "~0.1.1",

0 commit comments

Comments
 (0)