@sgcloud-sgsistemas/base 1.3.1 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -14,13 +14,11 @@ const controller = function ($scope, $timeout, mbSidemenuService, hotkeys) {
|
|
|
14
14
|
const incrementSelected = () => {
|
|
15
15
|
if ($scope.selected === undefined) {
|
|
16
16
|
$scope.selected = [0, 0];
|
|
17
|
-
} else {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if (resultIndex < $scope.result[groupIndex].children.length - 1) {
|
|
17
|
+
} else if ($scope.selected[0] < $scope.result.length) {
|
|
18
|
+
if ($scope.selected[1] < $scope.result[$scope.selected[0]].children.length - 1) {
|
|
21
19
|
$scope.selected[1] += 1;
|
|
22
|
-
} else {
|
|
23
|
-
$scope.selected[0]
|
|
20
|
+
} else if (!($scope.selected[0] === $scope.result.length - 1 && $scope.selected[1] === $scope.result[$scope.selected[0]].children.length - 1)) {
|
|
21
|
+
$scope.selected[0] += 1;
|
|
24
22
|
$scope.selected[1] = 0;
|
|
25
23
|
}
|
|
26
24
|
}
|
|
@@ -28,12 +26,10 @@ const controller = function ($scope, $timeout, mbSidemenuService, hotkeys) {
|
|
|
28
26
|
|
|
29
27
|
const decrementSelected = () => {
|
|
30
28
|
if ($scope.selected !== undefined) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
if (resultIndex > 0) {
|
|
29
|
+
if ($scope.selected[1] > 0) {
|
|
34
30
|
$scope.selected[1] -= 1;
|
|
35
|
-
} else {
|
|
36
|
-
$scope.selected[0]
|
|
31
|
+
} else if ($scope.selected[0] > 0) {
|
|
32
|
+
$scope.selected[0] -= 1;
|
|
37
33
|
$scope.selected[1] = $scope.result[$scope.selected[0]].children.length - 1;
|
|
38
34
|
}
|
|
39
35
|
}
|
|
@@ -134,7 +130,7 @@ const controller = function ($scope, $timeout, mbSidemenuService, hotkeys) {
|
|
|
134
130
|
}
|
|
135
131
|
});
|
|
136
132
|
// TO-DO (Limitar resultados parando o algoritmo ao chegar no limite de resultados)
|
|
137
|
-
return elements.sort((a, b) => a.
|
|
133
|
+
return elements.sort((a, b) => a.matchesCount > b.matchesCount).reverse();
|
|
138
134
|
};
|
|
139
135
|
|
|
140
136
|
/* Para cada tipo, faz um elemento no array */
|