@sgcloud-sgsistemas/base 1.0.0
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/README.md +505 -0
- package/app.js +686 -0
- package/assets/img/custom-icon.svg +1 -0
- package/assets/img/logo-finance.png +0 -0
- package/assets/img/logo.png +0 -0
- package/assets/img/logo_company.png +0 -0
- package/assets/img/perfil.png +0 -0
- package/config/postcss.config.js +14 -0
- package/config/webpack.config.common.js +53 -0
- package/config/webpack.config.dev.js +50 -0
- package/config/webpack.config.prod.js +49 -0
- package/index.html +115 -0
- package/package.json +64 -0
- package/resources/audio/mouth-pop.mp3 +0 -0
- package/src/index.js +1 -0
- package/src/modules/base/components/container/container.style.scss +7 -0
- package/src/modules/base/components/container/container.template.html +2 -0
- package/src/modules/base/components/container/index.js +9 -0
- package/src/modules/base/components/content-container/content-container.style.scss +36 -0
- package/src/modules/base/components/content-container/content-container.template.html +8 -0
- package/src/modules/base/components/content-container/index.js +9 -0
- package/src/modules/base/controllers/base.controller.js +39 -0
- package/src/modules/base/index.js +42 -0
- package/src/modules/base/providers/theme.provider.js +12 -0
- package/src/modules/base/providers/themes.list.js +233 -0
- package/src/modules/base/styles/base.animations.scss +43 -0
- package/src/modules/base/styles/base.flex.scss +45 -0
- package/src/modules/base/styles/base.style.scss +169 -0
- package/src/modules/base/templates/base.template.html +6 -0
- package/src/modules/footer/components/footer/footer.controller.js +17 -0
- package/src/modules/footer/components/footer/footer.style.scss +0 -0
- package/src/modules/footer/components/footer/footer.template.html +25 -0
- package/src/modules/footer/components/footer/index.js +13 -0
- package/src/modules/footer/controllers/footer.controller.js +13 -0
- package/src/modules/footer/index.js +19 -0
- package/src/modules/footer/services/footer.service.js +24 -0
- package/src/modules/footer/styles/footer.animations.scss +11 -0
- package/src/modules/footer/styles/footer.style.scss +28 -0
- package/src/modules/footer/templates/footer.template.html +1 -0
- package/src/modules/pageloader/controllers/pageloader.controller.js +60 -0
- package/src/modules/pageloader/index.js +15 -0
- package/src/modules/pageloader/services/pageloader.service.js +15 -0
- package/src/modules/pageloader/styles/pageloader.style.scss +67 -0
- package/src/modules/pageloader/templates/pageloader.template.html +9 -0
- package/src/modules/side-content/components/btn/btn.controller.js +55 -0
- package/src/modules/side-content/components/btn/btn.style.scss +48 -0
- package/src/modules/side-content/components/btn/btn.template.html +18 -0
- package/src/modules/side-content/components/btn/index.js +17 -0
- package/src/modules/side-content/controllers/side-content.controller.js +93 -0
- package/src/modules/side-content/index.js +17 -0
- package/src/modules/side-content/services/side-content.service.js +49 -0
- package/src/modules/side-content/styles/side-content.style.scss +73 -0
- package/src/modules/side-content/templates/side-content.template.html +25 -0
- package/src/modules/side-menu/components/btn/btn.controller.js +13 -0
- package/src/modules/side-menu/components/btn/btn.style.scss +75 -0
- package/src/modules/side-menu/components/btn/btn.template.html +43 -0
- package/src/modules/side-menu/components/btn/index.js +26 -0
- package/src/modules/side-menu/components/category/category.style.scss +47 -0
- package/src/modules/side-menu/components/category/category.template.html +23 -0
- package/src/modules/side-menu/components/category/index.js +13 -0
- package/src/modules/side-menu/components/html/html.controller.js +5 -0
- package/src/modules/side-menu/components/html/html.template.html +3 -0
- package/src/modules/side-menu/components/html/index.js +14 -0
- package/src/modules/side-menu/components/item/index.js +29 -0
- package/src/modules/side-menu/components/item/item.template.html +40 -0
- package/src/modules/side-menu/components/link/index.js +18 -0
- package/src/modules/side-menu/components/link/link.controller.js +48 -0
- package/src/modules/side-menu/components/link/link.style.scss +10 -0
- package/src/modules/side-menu/components/link/link.template.html +21 -0
- package/src/modules/side-menu/components/quick-menu/index.js +14 -0
- package/src/modules/side-menu/components/quick-menu/quick-menu.controller.js +67 -0
- package/src/modules/side-menu/components/quick-menu/quick-menu.style.scss +151 -0
- package/src/modules/side-menu/components/quick-menu/quick-menu.template.html +44 -0
- package/src/modules/side-menu/components/sub-category/index.js +20 -0
- package/src/modules/side-menu/components/sub-category/sub-category.controller.js +16 -0
- package/src/modules/side-menu/components/sub-category/sub-category.style.scss +48 -0
- package/src/modules/side-menu/components/sub-category/sub-category.template.html +47 -0
- package/src/modules/side-menu/controllers/sideMenu.js +71 -0
- package/src/modules/side-menu/index.js +33 -0
- package/src/modules/side-menu/services/sideMenu.js +12 -0
- package/src/modules/side-menu/styles/side-menu.style.scss +86 -0
- package/src/modules/side-menu/templates/side-menu.template.html +30 -0
- package/src/modules/themes/themes.style.scss +227 -0
- package/src/modules/top-notifications/components/notification/index.js +17 -0
- package/src/modules/top-notifications/components/notification/notification.controller.js +168 -0
- package/src/modules/top-notifications/components/notification/notification.style.scss +210 -0
- package/src/modules/top-notifications/components/notification/notification.template.html +22 -0
- package/src/modules/top-notifications/controllers/top-notifications.controller.js +33 -0
- package/src/modules/top-notifications/index.js +18 -0
- package/src/modules/top-notifications/services/top-notifications.services.js +108 -0
- package/src/modules/top-notifications/styles/top-notifications.style.scss +0 -0
- package/src/modules/top-notifications/templates/top-notifications.template.html +5 -0
- package/src/modules/topbar/components/cashier/cashier.controller.js +17 -0
- package/src/modules/topbar/components/cashier/cashier.styles.scss +79 -0
- package/src/modules/topbar/components/cashier/cashier.template.html +32 -0
- package/src/modules/topbar/components/cashier/index.js +14 -0
- package/src/modules/topbar/components/cashier/service/cashier.service.js +43 -0
- package/src/modules/topbar/components/environment/environment.html +24 -0
- package/src/modules/topbar/components/environment/environment.js +16 -0
- package/src/modules/topbar/components/environment/environment.scss +137 -0
- package/src/modules/topbar/components/environment/index.js +11 -0
- package/src/modules/topbar/components/environment/service/environment.service.js +19 -0
- package/src/modules/topbar/components/notifications/index.js +13 -0
- package/src/modules/topbar/components/notifications/notifications.controller.js +108 -0
- package/src/modules/topbar/components/notifications/notifications.styles.scss +282 -0
- package/src/modules/topbar/components/notifications/notifications.template.html +154 -0
- package/src/modules/topbar/components/search/components/input/index.js +19 -0
- package/src/modules/topbar/components/search/components/input/input.controller.js +19 -0
- package/src/modules/topbar/components/search/components/input/input.style.scss +74 -0
- package/src/modules/topbar/components/search/components/input/input.template.html +8 -0
- package/src/modules/topbar/components/search/components/result-line/index.js +16 -0
- package/src/modules/topbar/components/search/components/result-line/result-line.controller.js +69 -0
- package/src/modules/topbar/components/search/components/result-line/result-line.style.scss +58 -0
- package/src/modules/topbar/components/search/components/result-line/result-line.template.html +29 -0
- package/src/modules/topbar/components/search/controllers/search.controller.js +298 -0
- package/src/modules/topbar/components/search/index.js +21 -0
- package/src/modules/topbar/components/search/styles/search.style.scss +114 -0
- package/src/modules/topbar/components/search/templates/search.template.html +48 -0
- package/src/modules/topbar/components/user/components/btn/btn.style.scss +35 -0
- package/src/modules/topbar/components/user/components/btn/btn.template.html +36 -0
- package/src/modules/topbar/components/user/components/btn/index.js +15 -0
- package/src/modules/topbar/components/user/components/link/index.js +18 -0
- package/src/modules/topbar/components/user/components/link/link.controller.js +15 -0
- package/src/modules/topbar/components/user/components/link/link.style.scss +13 -0
- package/src/modules/topbar/components/user/components/link/link.template.html +26 -0
- package/src/modules/topbar/components/user/components/loading/index.js +14 -0
- package/src/modules/topbar/components/user/components/loading/loading.animations.scss +9 -0
- package/src/modules/topbar/components/user/components/loading/loading.style.scss +12 -0
- package/src/modules/topbar/components/user/components/loading/loading.template.html +3 -0
- package/src/modules/topbar/components/user/controllers/user.controller.js +200 -0
- package/src/modules/topbar/components/user/index.js +27 -0
- package/src/modules/topbar/components/user/services/user.service.js +14 -0
- package/src/modules/topbar/components/user/styles/user.animations.scss +27 -0
- package/src/modules/topbar/components/user/styles/user.style.scss +997 -0
- package/src/modules/topbar/components/user/templates/user.template.html +252 -0
- package/src/modules/topbar/controllers/topbar.controller.js +27 -0
- package/src/modules/topbar/index.js +31 -0
- package/src/modules/topbar/services/base-notification-service.js +40 -0
- package/src/modules/topbar/styles/topbar.style.scss +211 -0
- package/src/modules/topbar/templates/topbar.template.html +93 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
const controller = function ($scope, $timeout, mbSidemenuService, hotkeys) {
|
|
2
|
+
$scope.searchValue = '';
|
|
3
|
+
$scope.data = [];
|
|
4
|
+
$scope.result = [];
|
|
5
|
+
$scope.selected = undefined;
|
|
6
|
+
$scope.autoCompleteHide = true;
|
|
7
|
+
|
|
8
|
+
$scope.onSelect = (index) => {
|
|
9
|
+
$scope.selected = index.slice();
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const incrementSelected = () => {
|
|
13
|
+
if ($scope.selected === undefined) {
|
|
14
|
+
$scope.selected = [0, 0];
|
|
15
|
+
} else if ($scope.selected[0] < $scope.result.length) {
|
|
16
|
+
if ($scope.selected[1] < $scope.result[$scope.selected[0]].children.length - 1) {
|
|
17
|
+
$scope.selected[1] += 1;
|
|
18
|
+
} else if (!($scope.selected[0] === $scope.result.length - 1 && $scope.selected[1] === $scope.result[$scope.selected[0]].children.length - 1)) {
|
|
19
|
+
$scope.selected[0] += 1;
|
|
20
|
+
$scope.selected[1] = 0;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const decrementSelected = () => {
|
|
26
|
+
if ($scope.selected !== undefined) {
|
|
27
|
+
if ($scope.selected[1] > 0) {
|
|
28
|
+
$scope.selected[1] -= 1;
|
|
29
|
+
} else if ($scope.selected[0] > 0) {
|
|
30
|
+
$scope.selected[0] -= 1;
|
|
31
|
+
$scope.selected[1] = $scope.result[$scope.selected[0]].children.length - 1;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const executeSelected = () => {
|
|
37
|
+
const element = angular.element('.mb-tsal-link-active a')[0];
|
|
38
|
+
$timeout(() => { element.click(); });
|
|
39
|
+
const inputElement = document.getElementById('mb-tsi-input');
|
|
40
|
+
$timeout(() => { inputElement.blur(); });
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const setHotkeys = () => {
|
|
44
|
+
hotkeys.bindTo($scope).add({
|
|
45
|
+
combo: 'up',
|
|
46
|
+
callback(event) {
|
|
47
|
+
event.preventDefault();
|
|
48
|
+
decrementSelected();
|
|
49
|
+
},
|
|
50
|
+
allowIn: ['INPUT']
|
|
51
|
+
});
|
|
52
|
+
hotkeys.bindTo($scope).add({
|
|
53
|
+
combo: 'down',
|
|
54
|
+
callback(event) {
|
|
55
|
+
event.preventDefault();
|
|
56
|
+
incrementSelected();
|
|
57
|
+
},
|
|
58
|
+
allowIn: ['INPUT']
|
|
59
|
+
});
|
|
60
|
+
hotkeys.bindTo($scope).add({
|
|
61
|
+
combo: 'enter',
|
|
62
|
+
callback(event) {
|
|
63
|
+
event.preventDefault();
|
|
64
|
+
executeSelected();
|
|
65
|
+
},
|
|
66
|
+
allowIn: ['INPUT']
|
|
67
|
+
});
|
|
68
|
+
hotkeys.bindTo($scope).add({
|
|
69
|
+
combo: 'esc',
|
|
70
|
+
callback(event) {
|
|
71
|
+
event.preventDefault();
|
|
72
|
+
const inputElement = document.getElementById('mb-tsi-input');
|
|
73
|
+
$timeout(() => { inputElement.blur(); });
|
|
74
|
+
},
|
|
75
|
+
allowIn: ['INPUT']
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const removeHotkeys = () => {
|
|
80
|
+
hotkeys.del('down');
|
|
81
|
+
hotkeys.del('up');
|
|
82
|
+
hotkeys.del('enter');
|
|
83
|
+
hotkeys.del('esc');
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
$scope.openAutocomplete = () => {
|
|
87
|
+
$scope.autoCompleteHide = false;
|
|
88
|
+
$timeout(() => {
|
|
89
|
+
$scope.autoCompleteActive = true;
|
|
90
|
+
}, 50);
|
|
91
|
+
setHotkeys();
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
$scope.closeAutoComplete = () => {
|
|
95
|
+
removeHotkeys();
|
|
96
|
+
$scope.selected = undefined;
|
|
97
|
+
$scope.autoCompleteActive = false;
|
|
98
|
+
$timeout(() => { $scope.autoCompleteHide = true; }, 500);
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
$scope.blurInput = () => {
|
|
102
|
+
$scope.closeAutoComplete();
|
|
103
|
+
$timeout(() => { $scope.searchValue = ''; }, 500);
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
const makeAutocompleteObject = (array) => {
|
|
107
|
+
const types = [];
|
|
108
|
+
const autocomplete = [];
|
|
109
|
+
|
|
110
|
+
/* Separa os tipos: */
|
|
111
|
+
array.forEach((element) => {
|
|
112
|
+
if (types.indexOf(element.type) === -1) {
|
|
113
|
+
types.push(element.type);
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
/* Funções auxiliares */
|
|
118
|
+
const transformElement = (element) => {
|
|
119
|
+
const tmpElement = element;
|
|
120
|
+
return tmpElement;
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
const allElementsOfType = (type) => {
|
|
124
|
+
const elements = [];
|
|
125
|
+
array.forEach((element) => {
|
|
126
|
+
if (element.type === type) {
|
|
127
|
+
elements.push(transformElement(element));
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
// TO-DO (Limitar resultados parando o algoritmo ao chegar no limite de resultados)
|
|
131
|
+
return elements.slice(0, 5).sort((a, b) => a.matchesCount > b.matchesCount).reverse();
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
/* Para cada tipo, faz um elemento no array */
|
|
135
|
+
types.forEach((type) => {
|
|
136
|
+
const children = allElementsOfType(type);
|
|
137
|
+
let matchesCount = 0;
|
|
138
|
+
children.forEach((element) => { matchesCount += element.matchesCount; });
|
|
139
|
+
autocomplete.push({ type, children, matchesCount });
|
|
140
|
+
});
|
|
141
|
+
return autocomplete.sort((a, b) => a.matchesCount > b.matchesCount).reverse();
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
const allOcurrencesOf = (index, string, ocurrence) => {
|
|
145
|
+
const result = { index, matches: [] };
|
|
146
|
+
let lastMatch = 0;
|
|
147
|
+
for (let i = 0; i < string.length; i += 1) {
|
|
148
|
+
if (i >= lastMatch) {
|
|
149
|
+
if (string.substring(i, i + ocurrence.length).toLowerCase() === ocurrence.toLowerCase()) {
|
|
150
|
+
result.matches.push([i, i + ocurrence.length]);
|
|
151
|
+
lastMatch = i + ocurrence.length;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return result;
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const search = (searchParam, fixedData, indexes) => {
|
|
159
|
+
/* Retira espaços da search string */
|
|
160
|
+
const searchString = searchParam.trim();
|
|
161
|
+
|
|
162
|
+
/* Caso a search string seja maior que zero */
|
|
163
|
+
if (searchString.length > 0) {
|
|
164
|
+
const result = [];
|
|
165
|
+
/* Para cada item do conteudo */
|
|
166
|
+
$scope.data.forEach((element) => {
|
|
167
|
+
const elementTmp = element;
|
|
168
|
+
elementTmp.matches = [];
|
|
169
|
+
elementTmp.matchesCount = 0;
|
|
170
|
+
/* Busca por cada tipo de dado indexável */
|
|
171
|
+
indexes.forEach((index) => {
|
|
172
|
+
/* Caso tenha o dado indexável */
|
|
173
|
+
if (index.name in element) {
|
|
174
|
+
const string = element[index.name].toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
|
175
|
+
const tmpSearchString = searchString.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, '');
|
|
176
|
+
/* Procura pela string digitada */
|
|
177
|
+
const searchAux = string.search(tmpSearchString);
|
|
178
|
+
if (searchAux !== -1) {
|
|
179
|
+
const allOcurrences = allOcurrencesOf(index, string, tmpSearchString);
|
|
180
|
+
elementTmp.matchesCount += allOcurrences.matches.length;
|
|
181
|
+
elementTmp.matches.push(allOcurrences);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
if (elementTmp.matches.length > 0) {
|
|
186
|
+
result.push(elementTmp);
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
$scope.result = makeAutocompleteObject(result);
|
|
190
|
+
$scope.selected = [0, 0];
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
$scope.onChangeSearch = (text) => {
|
|
195
|
+
/* Não considera espaços */
|
|
196
|
+
const inputText = text.toString().replace(/\\/g, '').replace(/\//ig, '').trim();
|
|
197
|
+
$scope.selected = undefined;
|
|
198
|
+
|
|
199
|
+
if (inputText.length > 0) {
|
|
200
|
+
$scope.openAutocomplete();
|
|
201
|
+
search(inputText, $scope.data, $scope.indexFields);
|
|
202
|
+
$scope.searchValue = inputText;
|
|
203
|
+
} else {
|
|
204
|
+
$scope.autoCompleteActive = false;
|
|
205
|
+
$scope.autoCompleteHide = true;
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const extractMenuLinksFromConfig = (config) => {
|
|
210
|
+
const links = [];
|
|
211
|
+
const prepareLink = (link) => {
|
|
212
|
+
if ((link.type === 'category' || link.type === 'sub-category') && link.children !== undefined && link.children.length > 0) {
|
|
213
|
+
link.children.forEach((element) => {
|
|
214
|
+
prepareLink(element);
|
|
215
|
+
});
|
|
216
|
+
} else if (link.type === undefined || link.type === 'btn') {
|
|
217
|
+
links.push({
|
|
218
|
+
type: 'Menu',
|
|
219
|
+
name: link.label,
|
|
220
|
+
action: link.action,
|
|
221
|
+
actionType: link.actionType
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
// if (config.quickMenu !== undefined && config.quickMenu.links !== undefined && config.quickMenu.links.length > 0) {
|
|
226
|
+
// config.quickMenu.links.forEach((element) => {
|
|
227
|
+
// prepareLink(element);
|
|
228
|
+
// });
|
|
229
|
+
// }
|
|
230
|
+
if (config.structure !== undefined && config.structure.length > 0) {
|
|
231
|
+
config.structure.forEach((element) => {
|
|
232
|
+
prepareLink(element);
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
return links;
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
const prepareData = (data) => {
|
|
239
|
+
const dataTmp = [];
|
|
240
|
+
data.forEach((element) => {
|
|
241
|
+
if (element.type !== undefined) {
|
|
242
|
+
if (element.type === 'static') {
|
|
243
|
+
if (element.data === 'sideMenuLinks') {
|
|
244
|
+
let sideMenuConfig;
|
|
245
|
+
const getConfig = () => {
|
|
246
|
+
$timeout(() => {
|
|
247
|
+
sideMenuConfig = mbSidemenuService.getMenuConfig();
|
|
248
|
+
if (sideMenuConfig === undefined) {
|
|
249
|
+
getConfig();
|
|
250
|
+
} else {
|
|
251
|
+
const links = extractMenuLinksFromConfig(sideMenuConfig);
|
|
252
|
+
links.forEach((item) => {
|
|
253
|
+
dataTmp.push(item);
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
}, 10);
|
|
257
|
+
};
|
|
258
|
+
getConfig();
|
|
259
|
+
} else if (typeof element.data !== 'string' && element.data.length > 0) {
|
|
260
|
+
element.data.forEach((item) => {
|
|
261
|
+
dataTmp.push(item);
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
});
|
|
267
|
+
$scope.data = dataTmp;
|
|
268
|
+
};
|
|
269
|
+
|
|
270
|
+
// Essa função foca o input ao clicar no search
|
|
271
|
+
$scope.focusInput = () => {
|
|
272
|
+
const element = document.getElementById('mb-tsi-input');
|
|
273
|
+
element.focus();
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
$scope.onFocusInput = () => { };
|
|
277
|
+
|
|
278
|
+
$scope.isCompanyInvalid = () => {
|
|
279
|
+
return localStorage.getItem("isCompanyInvalid") == 'true'
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
this.$onInit = () => {
|
|
283
|
+
$scope.$watch('vm.configMenu', () => {
|
|
284
|
+
$scope.indexFields = this.config.indexFields;
|
|
285
|
+
prepareData(this.config.data);
|
|
286
|
+
})
|
|
287
|
+
if (this.config.setHotkeys === true) {
|
|
288
|
+
hotkeys.bindTo($scope).add({
|
|
289
|
+
combo: 'ctrl+b',
|
|
290
|
+
callback() {
|
|
291
|
+
$scope.focusInput();
|
|
292
|
+
}
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
|
|
298
|
+
export default controller;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import controller from './controllers/search.controller';
|
|
2
|
+
import template from './templates/search.template.html';
|
|
3
|
+
import './styles/search.style.scss';
|
|
4
|
+
|
|
5
|
+
import input from './components/input';
|
|
6
|
+
import line from './components/result-line';
|
|
7
|
+
|
|
8
|
+
const component = {
|
|
9
|
+
bindings: {
|
|
10
|
+
config: '=',
|
|
11
|
+
configMenu: '=?'
|
|
12
|
+
},
|
|
13
|
+
template,
|
|
14
|
+
controller,
|
|
15
|
+
controllerAs: 'vm'
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
angular.module('mb.topbar.search', [])
|
|
19
|
+
.component('mbTSearch', component)
|
|
20
|
+
.component('mbTSearchInput', input)
|
|
21
|
+
.component('mbTResultLine', line);
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
@import "../../../../themes/themes.style.scss";
|
|
2
|
+
|
|
3
|
+
$background: #f2f2f2;
|
|
4
|
+
|
|
5
|
+
.mb[search] {
|
|
6
|
+
position: relative;
|
|
7
|
+
width: 100%;
|
|
8
|
+
max-width: 512px;
|
|
9
|
+
z-index: 900;
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
align-items: center;
|
|
13
|
+
justify-content: center;
|
|
14
|
+
|
|
15
|
+
> .mb-ts-autocomplete {
|
|
16
|
+
position: absolute;
|
|
17
|
+
top: 20px;
|
|
18
|
+
width: 100%;
|
|
19
|
+
height: auto;
|
|
20
|
+
background-color: $background;
|
|
21
|
+
z-index: 500;
|
|
22
|
+
border-bottom-right-radius: 10px;
|
|
23
|
+
border-bottom-left-radius: 10px;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
will-change: transform, opacity;
|
|
26
|
+
transform: translate3d(0%, -20px, 0%);
|
|
27
|
+
opacity: 0;
|
|
28
|
+
transition: transform 500ms ease, opacity 200ms linear;
|
|
29
|
+
padding: 30px 0px 10px 0px;
|
|
30
|
+
box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1), 0px 0px 70px rgba(0, 0, 0, 0.25);
|
|
31
|
+
|
|
32
|
+
&.mb-tsa-active {
|
|
33
|
+
transform: translate3d(0%, 0%, 0%);
|
|
34
|
+
opacity: 1;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.mb-ts-autocomplete-title {
|
|
38
|
+
width: 100%;
|
|
39
|
+
height: 40px;
|
|
40
|
+
position: relative;
|
|
41
|
+
padding-right: 15px;
|
|
42
|
+
padding-left: 15px;
|
|
43
|
+
text-align: left;
|
|
44
|
+
|
|
45
|
+
> .mb-ts-autocomplete-title-text {
|
|
46
|
+
height: 40px;
|
|
47
|
+
line-height: 40px;
|
|
48
|
+
color: #333;
|
|
49
|
+
|
|
50
|
+
@include themify(color, color1);
|
|
51
|
+
|
|
52
|
+
background-color: $background;
|
|
53
|
+
display: inline-block;
|
|
54
|
+
padding-right: 20px;
|
|
55
|
+
padding-left: 10px;
|
|
56
|
+
z-index: 501;
|
|
57
|
+
position: relative;
|
|
58
|
+
font-weight: 700;
|
|
59
|
+
font-size: 14px;
|
|
60
|
+
user-select: none;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
> .mb-ts-autocomplete-title-line {
|
|
64
|
+
width: calc(100% - 45px);
|
|
65
|
+
height: 1px;
|
|
66
|
+
background-color: #333;
|
|
67
|
+
|
|
68
|
+
@include themify(background-color, color1);
|
|
69
|
+
|
|
70
|
+
position: absolute;
|
|
71
|
+
top: 50%;
|
|
72
|
+
left: 15px;
|
|
73
|
+
right: 25px;
|
|
74
|
+
transform: translateY(-50%);
|
|
75
|
+
z-index: 500;
|
|
76
|
+
user-select: none;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
> .mb-ts-autocomplete-notfound {
|
|
81
|
+
width: 100%;
|
|
82
|
+
padding: 15px;
|
|
83
|
+
font-weight: 400;
|
|
84
|
+
font-size: 14px;
|
|
85
|
+
color: #ccc;
|
|
86
|
+
@include themify(color, neutral2);
|
|
87
|
+
|
|
88
|
+
> .mb-ts-autocomplete-notfound-search {
|
|
89
|
+
font-weight: 700;
|
|
90
|
+
word-wrap: break-word;
|
|
91
|
+
color: #333;
|
|
92
|
+
|
|
93
|
+
@include themify(color, color1);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
.alert-message-box {
|
|
101
|
+
text-align: left;
|
|
102
|
+
|
|
103
|
+
.alert-message {
|
|
104
|
+
background: #dc3545;
|
|
105
|
+
width: 60%;
|
|
106
|
+
color: #fff;
|
|
107
|
+
font-weight: 700;
|
|
108
|
+
padding: 0.8rem;
|
|
109
|
+
border-radius: .25rem;
|
|
110
|
+
text-align: center;
|
|
111
|
+
border: .1rem solid darken($color:#dc3545, $amount: 10);;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<div class="mb"
|
|
2
|
+
ng-click="focusInput()"
|
|
3
|
+
tabindex="-1"
|
|
4
|
+
search>
|
|
5
|
+
<mb-t-search-input on-blur="blurInput()"
|
|
6
|
+
tabindex="-1"
|
|
7
|
+
on-focus="onFocusInput()"
|
|
8
|
+
on-change-value="onChangeSearch(text)"
|
|
9
|
+
placeholder="Pesquisa (Ctrl + B)"
|
|
10
|
+
type="text"
|
|
11
|
+
name="search"
|
|
12
|
+
icon="fa-search"></mb-t-search-input>
|
|
13
|
+
|
|
14
|
+
<div class="mb-ts-autocomplete"
|
|
15
|
+
tabindex="-1"
|
|
16
|
+
ng-class="{'mb-tsa-active':autoCompleteActive}"
|
|
17
|
+
ng-if="!autoCompleteHide">
|
|
18
|
+
|
|
19
|
+
<div ng-repeat="result in result"
|
|
20
|
+
tabindex="-1">
|
|
21
|
+
<div class="mb-ts-autocomplete-title"
|
|
22
|
+
tabindex="-1">
|
|
23
|
+
<div class="mb-ts-autocomplete-title-text" tabindex="-1">
|
|
24
|
+
{{ result.type }}
|
|
25
|
+
</div>
|
|
26
|
+
<div class="mb-ts-autocomplete-title-line" tabindex="-1"></div>
|
|
27
|
+
</div>
|
|
28
|
+
<mb-t-result-line ng-repeat="line in result.children"
|
|
29
|
+
index="[$parent.$index, $index]"
|
|
30
|
+
tabindex="-1"
|
|
31
|
+
selected="selected"
|
|
32
|
+
on-select="onSelect(index)"
|
|
33
|
+
line="line"></mb-t-result-line>
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div ng-if="result.length === 0"
|
|
37
|
+
tabindex="-1"
|
|
38
|
+
class="mb-ts-autocomplete-notfound">
|
|
39
|
+
Nenhum resultado encontrado para:
|
|
40
|
+
<div class="mb-ts-autocomplete-notfound-search" tabindex="-1">
|
|
41
|
+
{{ '"' + searchValue + '"' }}
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
</div>
|
|
46
|
+
|
|
47
|
+
</div>
|
|
48
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
@import "../../../../../themes/themes.style.scss";
|
|
2
|
+
|
|
3
|
+
.mb[topbar-user-btn] {
|
|
4
|
+
color: #ccc;
|
|
5
|
+
|
|
6
|
+
@include themify(color, neutral2);
|
|
7
|
+
|
|
8
|
+
font-size: 12px;
|
|
9
|
+
font-weight: 700;
|
|
10
|
+
width: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: row;
|
|
13
|
+
justify-content: flex-end;
|
|
14
|
+
align-items: center;
|
|
15
|
+
user-select: none;
|
|
16
|
+
transition: transform 250ms ease, color 100ms linear;
|
|
17
|
+
cursor: pointer;
|
|
18
|
+
padding: 15px 25px 15px 15px;
|
|
19
|
+
|
|
20
|
+
&:hover {
|
|
21
|
+
color: #9136ca;
|
|
22
|
+
|
|
23
|
+
@include themify(color, color1);
|
|
24
|
+
|
|
25
|
+
transform: translate3d(1%, 0, 0);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.mb-tub-icon {
|
|
29
|
+
margin-left: 15px;
|
|
30
|
+
|
|
31
|
+
.fas {
|
|
32
|
+
font-size: 16px;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<mb-t-u-link ng-if="(vm.config.action !== 'changeAccount') || (vm.config.action === 'changeAccount' && vm.otherOrganizations !== undefined && vm.otherOrganizations.length > 0)"
|
|
2
|
+
action-type="vm.config.actionType"
|
|
3
|
+
action="vm.config.action"
|
|
4
|
+
internal-callback="vm.internalCallback({ action: action })"
|
|
5
|
+
close-menu="vm.closeMenu()">
|
|
6
|
+
<div class="mb"
|
|
7
|
+
topbar-user-btn>
|
|
8
|
+
<div>
|
|
9
|
+
{{ vm.config.label }}
|
|
10
|
+
</div>
|
|
11
|
+
<div>
|
|
12
|
+
|
|
13
|
+
<div class="mb-tub-icon"
|
|
14
|
+
ng-if="vm.config.iconSrc === 'fontawesome'"
|
|
15
|
+
ng-style="{'font-size': vm.config.iconSize ? vm.config.iconSize + 'px' : undefined, 'line-height' : vm.config.iconSize ? vm.config.iconSize + 'px' : undefined, 'height' : vm.config.iconSize ? vm.config.iconSize + 'px' : undefined, 'width' : vm.config.iconSize ? 'auto' : undefined }">
|
|
16
|
+
<i class="{{vm.config.icon}}"></i>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="mb-tub-icon"
|
|
20
|
+
ng-if="vm.config.iconSrc === 'material'"
|
|
21
|
+
ng-style="{ 'height' : vm.config.iconSize ? vm.config.iconSize + 'px' : undefined, 'width' : vm.config.iconSize ? 'auto' : undefined }">
|
|
22
|
+
<i class="material-icons"
|
|
23
|
+
ng-style="{'font-size': vm.config.iconSize ? vm.config.iconSize + 'px' : undefined, 'line-height' : vm.config.iconSize ? vm.config.iconSize + 'px' : undefined }">{{ vm.config.icon }}</i>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div class="mb-tub-icon"
|
|
27
|
+
ng-if="vm.config.iconSrc !== 'material' && vm.config.iconSrc !== 'fontawesome' && vm.config.iconSrc !== undefined && vm.config.iconSrc.length > 0"
|
|
28
|
+
|
|
29
|
+
ng-style="{ 'height' : vm.config.iconSize ? vm.config.iconSize + 'px' : undefined, 'width' : vm.config.iconSize ? 'auto' : undefined }">
|
|
30
|
+
<img ng-src="{{ vm.config.iconSrc }}"
|
|
31
|
+
alt="">
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
36
|
+
</mb-t-u-link>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import template from './btn.template.html';
|
|
2
|
+
import './btn.style.scss';
|
|
3
|
+
|
|
4
|
+
const component = {
|
|
5
|
+
bindings: {
|
|
6
|
+
config: '=',
|
|
7
|
+
internalCallback: '&?',
|
|
8
|
+
otherOrganizations: '=',
|
|
9
|
+
closeMenu: '&'
|
|
10
|
+
},
|
|
11
|
+
template,
|
|
12
|
+
controllerAs: 'vm'
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default component;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import template from './link.template.html';
|
|
2
|
+
import controller from './link.controller';
|
|
3
|
+
import './link.style.scss';
|
|
4
|
+
|
|
5
|
+
const component = {
|
|
6
|
+
bindings: {
|
|
7
|
+
actionType: '=',
|
|
8
|
+
action: '=',
|
|
9
|
+
closeMenu: '&',
|
|
10
|
+
internalCallback: '&?'
|
|
11
|
+
},
|
|
12
|
+
template,
|
|
13
|
+
controller,
|
|
14
|
+
controllerAs: 'vm',
|
|
15
|
+
transclude: true
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default component;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const controller = function () {
|
|
2
|
+
const vm = this;
|
|
3
|
+
vm.click = () => {
|
|
4
|
+
if (vm.actionType === 'function') {
|
|
5
|
+
vm.action();
|
|
6
|
+
vm.closeMenu();
|
|
7
|
+
} else if (vm.actionType === 'internal') {
|
|
8
|
+
vm.internalCallback({ action: vm.action });
|
|
9
|
+
} else {
|
|
10
|
+
vm.closeMenu();
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default controller;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<a class="mb"
|
|
2
|
+
topbar-user-link
|
|
3
|
+
ng-click="vm.click()"
|
|
4
|
+
ng-transclude
|
|
5
|
+
ng-if="vm.actionType === 'state'"
|
|
6
|
+
ui-sref="{{vm.action}}">
|
|
7
|
+
</a>
|
|
8
|
+
<a class="mb"
|
|
9
|
+
topbar-user-link
|
|
10
|
+
ng-click="vm.click()"
|
|
11
|
+
ng-transclude
|
|
12
|
+
ng-if="vm.actionType === 'link'"
|
|
13
|
+
ng-href="{{vm.action}}">
|
|
14
|
+
</a>
|
|
15
|
+
<a class="mb"
|
|
16
|
+
topbar-user-link
|
|
17
|
+
ng-click="vm.click()"
|
|
18
|
+
ng-transclude
|
|
19
|
+
ng-if="vm.actionType === 'function'">
|
|
20
|
+
</a>
|
|
21
|
+
<a class="mb"
|
|
22
|
+
topbar-user-link
|
|
23
|
+
ng-click="vm.click()"
|
|
24
|
+
ng-transclude
|
|
25
|
+
ng-if="vm.actionType === 'internal'">
|
|
26
|
+
</a>
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
@import "./loading.animations.scss";
|
|
2
|
+
|
|
3
|
+
.mb[topbar-user-loading] {
|
|
4
|
+
animation-duration: 1s;
|
|
5
|
+
animation-fill-mode: forwards;
|
|
6
|
+
animation-iteration-count: infinite;
|
|
7
|
+
animation-timing-function: linear;
|
|
8
|
+
animation-name: mb-placeholder-loading;
|
|
9
|
+
background: #f6f7f8;
|
|
10
|
+
background: linear-gradient(to bottom right, #eeeeee 8%, #c4c4c4 18%, #eeeeee 33%);
|
|
11
|
+
background-size: 300% 300%;
|
|
12
|
+
}
|