@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,60 @@
|
|
|
1
|
+
const controller = function (MbgPageLoader, $timeout, $q, hotkeys, $scope) {
|
|
2
|
+
const vm = this;
|
|
3
|
+
vm.hide = true;
|
|
4
|
+
vm.active = false;
|
|
5
|
+
vm.text = 'Carregando';
|
|
6
|
+
vm.promise = undefined;
|
|
7
|
+
|
|
8
|
+
const setHotkeys = () => {
|
|
9
|
+
hotkeys.bindTo($scope).add({
|
|
10
|
+
combo: 'esc',
|
|
11
|
+
callback(event) {
|
|
12
|
+
event.preventDefault();
|
|
13
|
+
vm.close();
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const removeHotkeys = () => {
|
|
19
|
+
hotkeys.del('esc');
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
vm.open = (promise, title = 'Carregando') => {
|
|
23
|
+
setHotkeys();
|
|
24
|
+
vm.hide = false;
|
|
25
|
+
vm.text = title;
|
|
26
|
+
$timeout(() => {
|
|
27
|
+
vm.active = true;
|
|
28
|
+
}, 50);
|
|
29
|
+
return promise.finally(() => { vm.close(); });
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
vm.close = () => {
|
|
33
|
+
removeHotkeys();
|
|
34
|
+
vm.active = false;
|
|
35
|
+
$timeout(() => {
|
|
36
|
+
vm.hide = true;
|
|
37
|
+
vm.endPromise();
|
|
38
|
+
}, 500);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
vm.createPromise = () => {
|
|
42
|
+
if (vm.promise === undefined && vm.active === false && vm.hide === true) {
|
|
43
|
+
vm.promise = $q.defer();
|
|
44
|
+
vm.open(vm.promise.promise);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
vm.endPromise = () => {
|
|
49
|
+
if (vm.promise !== undefined) {
|
|
50
|
+
vm.promise.resolve();
|
|
51
|
+
vm.promise = undefined;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
vm.$onInit = () => {
|
|
56
|
+
MbgPageLoader.registerComponentCallback(vm.open, vm.close, vm.createPromise, vm.endPromise);
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export default controller;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import template from './templates/pageloader.template.html';
|
|
2
|
+
import controller from './controllers/pageloader.controller';
|
|
3
|
+
import service from './services/pageloader.service';
|
|
4
|
+
|
|
5
|
+
import './styles/pageloader.style.scss';
|
|
6
|
+
|
|
7
|
+
const component = {
|
|
8
|
+
template,
|
|
9
|
+
controller,
|
|
10
|
+
controllerAs: 'vm'
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const module = angular.module('mb.pageloader', []);
|
|
14
|
+
module.service('MbgPageLoader', service);
|
|
15
|
+
module.component('mbPageloader', component);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const service = function () {
|
|
2
|
+
this.open = undefined;
|
|
3
|
+
this.close = undefined;
|
|
4
|
+
this.createPromise = undefined;
|
|
5
|
+
this.endPromise = undefined;
|
|
6
|
+
|
|
7
|
+
this.registerComponentCallback = (open, close, create, end) => {
|
|
8
|
+
this.open = open;
|
|
9
|
+
this.close = close;
|
|
10
|
+
this.createPromise = create;
|
|
11
|
+
this.endPromise = end;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default service;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
@import "../../themes/themes.style.scss";
|
|
2
|
+
|
|
3
|
+
.mb[mb-pageloader] {
|
|
4
|
+
height: 100%;
|
|
5
|
+
width: 100%;
|
|
6
|
+
position: fixed;
|
|
7
|
+
background-color: rgba(255, 255, 255, 0.8);
|
|
8
|
+
top: 0px;
|
|
9
|
+
left: 0px;
|
|
10
|
+
right: 0px;
|
|
11
|
+
bottom: 0px;
|
|
12
|
+
z-index: 900;
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
align-items: center;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
color: #bbb;
|
|
18
|
+
font-family: 'Montserrat', sans-serif;
|
|
19
|
+
font-weight: 400;
|
|
20
|
+
font-size: 12px;
|
|
21
|
+
opacity: 0;
|
|
22
|
+
transition: opacity 0.5s linear;
|
|
23
|
+
will-change: opacity;
|
|
24
|
+
|
|
25
|
+
.mb-pl-container {
|
|
26
|
+
width: auto;
|
|
27
|
+
opacity: 0;
|
|
28
|
+
transition: transform 0.5s ease, opacity 0.5s linear;
|
|
29
|
+
will-change: transform, opacity;
|
|
30
|
+
transform: translateY(30%);
|
|
31
|
+
text-align: center;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
align-items: center;
|
|
35
|
+
|
|
36
|
+
svg {
|
|
37
|
+
margin-bottom: 10px;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&.mb-pageloader-active {
|
|
42
|
+
opacity: 1;
|
|
43
|
+
|
|
44
|
+
.mb-pl-container {
|
|
45
|
+
opacity: 1;
|
|
46
|
+
transform: translateY(0%);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.mb-pl-color1 {
|
|
51
|
+
fill: #ddd;
|
|
52
|
+
|
|
53
|
+
@include themify(fill, color1);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.mb-pl-color2 {
|
|
57
|
+
fill: #ddd;
|
|
58
|
+
|
|
59
|
+
@include themify(fill, color4);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.mb-pl-color3 {
|
|
63
|
+
fill: #ddd;
|
|
64
|
+
|
|
65
|
+
@include themify(fill, color1);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
const controller = function (MbgSideContent, $timeout) {
|
|
2
|
+
const vm = this;
|
|
3
|
+
const btnHeight = 93;
|
|
4
|
+
vm.top = 0;
|
|
5
|
+
vm.right = 0;
|
|
6
|
+
vm.active = false;
|
|
7
|
+
|
|
8
|
+
vm.updateBtn = (stackLvl, bufferLength) => {
|
|
9
|
+
vm.top = -(((bufferLength - 1) * btnHeight) / 2) + (stackLvl * btnHeight);
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
vm.open = () => {
|
|
13
|
+
$timeout(() => {
|
|
14
|
+
if (vm.contentOpen) {
|
|
15
|
+
vm.right = -400;
|
|
16
|
+
vm.active = true;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
vm.close = () => {
|
|
22
|
+
vm.right = 0;
|
|
23
|
+
vm.active = false;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
vm.toggleContent = (evt) => {
|
|
27
|
+
evt.stopPropagation();
|
|
28
|
+
|
|
29
|
+
if (vm.active === true) {
|
|
30
|
+
vm.close();
|
|
31
|
+
} else {
|
|
32
|
+
vm.open();
|
|
33
|
+
}
|
|
34
|
+
vm.toggleFn();
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
vm.$onInit = () => {
|
|
38
|
+
MbgSideContent.registerBtn({ update: vm.updateBtn, config: vm.config });
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
vm.$onChanges = (changes) => {
|
|
42
|
+
if (changes.contentOpen) {
|
|
43
|
+
if (changes.contentOpen.currentValue === true && vm.activeContent.id === vm.config.id) {
|
|
44
|
+
vm.open();
|
|
45
|
+
} else {
|
|
46
|
+
vm.close();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (changes.activeContent) {
|
|
50
|
+
vm.activeContent = changes.activeContent.currentValue;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export default controller;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
.mb-sc-button {
|
|
2
|
+
width: 60px;
|
|
3
|
+
height: 60px;
|
|
4
|
+
position: fixed;
|
|
5
|
+
right: 0px;
|
|
6
|
+
top: calc(50% - 30px);
|
|
7
|
+
z-index: 1000;
|
|
8
|
+
transition: transform 500ms ease;
|
|
9
|
+
|
|
10
|
+
.mb-sc-b-content-container {
|
|
11
|
+
position: relative;
|
|
12
|
+
height: 100%;
|
|
13
|
+
width: 100%;
|
|
14
|
+
|
|
15
|
+
.mb-sc-corner {
|
|
16
|
+
filter: drop-shadow( 0px 0px 10px rgba(0,0,0,0.1));
|
|
17
|
+
top: 50%;
|
|
18
|
+
position: absolute;
|
|
19
|
+
right: -20px;
|
|
20
|
+
fill: white;
|
|
21
|
+
transform: translateY(-50%);
|
|
22
|
+
width: 80px;
|
|
23
|
+
z-index: 1001;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.mb-sc-icon-container {
|
|
27
|
+
top: 50%;
|
|
28
|
+
transform: translateY(-50%);
|
|
29
|
+
right: 5px;
|
|
30
|
+
position: absolute;
|
|
31
|
+
z-index: 1002;
|
|
32
|
+
border-radius: 50%;
|
|
33
|
+
height: 45px;
|
|
34
|
+
width: 45px;
|
|
35
|
+
background-color: #00d5d2;
|
|
36
|
+
cursor: pointer;
|
|
37
|
+
display: flex;
|
|
38
|
+
justify-content: center;
|
|
39
|
+
|
|
40
|
+
.mb-sc-icon {
|
|
41
|
+
color: #fff;
|
|
42
|
+
font-size: 22px;
|
|
43
|
+
line-height: 45px;
|
|
44
|
+
text-align: center;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<div class="mb-sc-button"
|
|
2
|
+
ng-style="{'transform': 'translateY(' + vm.top + 'px) translateX(' + vm.right + 'px)'}">
|
|
3
|
+
<div class="mb-sc-b-content-container">
|
|
4
|
+
<svg class="mb-sc-corner"
|
|
5
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
6
|
+
viewBox="0 0 231.59 393.64">
|
|
7
|
+
<path class="cls-1"
|
|
8
|
+
d="M231.59,0H212.71c-5.87,14.72-14.91,33.59-28.81,56a122.54,122.54,0,0,1-21.26,26A102.77,102.77,0,0,1,95,107.83h-.4a89.32,89.32,0,0,0-89.3,89.3v.2a89.32,89.32,0,0,0,89.29,89.3v0l.18,0H95a102.77,102.77,0,0,1,67.37,25.55,122.56,122.56,0,0,1,21.53,26.27c13.64,22,22.6,40.59,28.48,55.19h19.21Z"
|
|
9
|
+
/>
|
|
10
|
+
</svg>
|
|
11
|
+
<div ng-click="vm.toggleContent($event)"
|
|
12
|
+
class="mb-sc-icon-container"
|
|
13
|
+
ng-style="{'background-color': vm.config.btnBgColor }">
|
|
14
|
+
<i class="{{ vm.config.icon }} mb-sc-icon"
|
|
15
|
+
ng-style="{'color': vm.config.iconColor }"></i>
|
|
16
|
+
</div>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import template from './btn.template.html';
|
|
2
|
+
import controller from './btn.controller';
|
|
3
|
+
import './btn.style.scss';
|
|
4
|
+
|
|
5
|
+
const component = {
|
|
6
|
+
bindings: {
|
|
7
|
+
config: '=',
|
|
8
|
+
toggleFn: '&',
|
|
9
|
+
contentOpen: '<',
|
|
10
|
+
activeContent: '<'
|
|
11
|
+
},
|
|
12
|
+
template,
|
|
13
|
+
controller,
|
|
14
|
+
controllerAs: 'vm'
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export default component;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
const controller = function ($scope, $timeout, MbgSideContent, $compile) {
|
|
2
|
+
const vm = this;
|
|
3
|
+
vm.active = false;
|
|
4
|
+
vm.bgHide = true;
|
|
5
|
+
vm.hoverButton = false;
|
|
6
|
+
vm.contentBuffer = [];
|
|
7
|
+
vm.activeContent = undefined;
|
|
8
|
+
|
|
9
|
+
let animationInProgress = false;
|
|
10
|
+
|
|
11
|
+
vm.open = (content) => {
|
|
12
|
+
if (animationInProgress === false) {
|
|
13
|
+
vm.activeContent = content;
|
|
14
|
+
document.getElementById('mb-sc-content').innerHTML = vm.activeContent.template;
|
|
15
|
+
const scope = $scope.$new();
|
|
16
|
+
$compile(document.getElementById('mb-sc-content'))(scope);
|
|
17
|
+
vm.activeContent.onOpen(content);
|
|
18
|
+
animationInProgress = true;
|
|
19
|
+
vm.bgHide = typeof content.bgHide === 'undefined' ? false : content.bgHide;
|
|
20
|
+
const active = () => {
|
|
21
|
+
$timeout(() => {
|
|
22
|
+
if (content.template !== '') {
|
|
23
|
+
vm.active = true;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
// document.addEventListener('click', vm.close);
|
|
28
|
+
requestAnimationFrame(active);
|
|
29
|
+
$timeout(() => {
|
|
30
|
+
animationInProgress = false;
|
|
31
|
+
}, 500);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
vm.close = () => {
|
|
36
|
+
if (animationInProgress === false) {
|
|
37
|
+
if (vm.activeContent !== undefined && vm.activeContent.onClose !== undefined) {
|
|
38
|
+
vm.activeContent.onClose();
|
|
39
|
+
}
|
|
40
|
+
animationInProgress = true;
|
|
41
|
+
$timeout(() => {
|
|
42
|
+
vm.active = false;
|
|
43
|
+
document.removeEventListener('click', vm.close);
|
|
44
|
+
});
|
|
45
|
+
$timeout(() => {
|
|
46
|
+
vm.bgHide = true;
|
|
47
|
+
}, 250);
|
|
48
|
+
$timeout(() => {
|
|
49
|
+
animationInProgress = false;
|
|
50
|
+
}, 500);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
vm.toggle = (content) => {
|
|
55
|
+
if (vm.active === false) {
|
|
56
|
+
vm.open(content);
|
|
57
|
+
} else {
|
|
58
|
+
vm.close(content);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
vm.stopPropagation = (evt) => {
|
|
63
|
+
evt.stopPropagation();
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
vm.mouseEnterBtn = () => {
|
|
67
|
+
$timeout(() => {
|
|
68
|
+
vm.hoverButton = true;
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
vm.mouseLeaveBtn = () => {
|
|
73
|
+
$timeout(() => {
|
|
74
|
+
vm.hoverButton = false;
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
vm.updateComponent = () => {
|
|
79
|
+
vm.contentBuffer = MbgSideContent.contentBuffer;
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
vm.$onInit = () => {
|
|
83
|
+
MbgSideContent.registerComponent(vm.updateComponent, vm.close);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
vm.$onDestroy = () => {
|
|
87
|
+
MbgSideContent.contentBuffer = []
|
|
88
|
+
MbgSideContent.btnBuffer = []
|
|
89
|
+
vm.updateComponent()
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
export default controller;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import template from './templates/side-content.template.html';
|
|
2
|
+
import controller from './controllers/side-content.controller';
|
|
3
|
+
import service from './services/side-content.service';
|
|
4
|
+
import './styles/side-content.style.scss';
|
|
5
|
+
|
|
6
|
+
import btn from './components/btn';
|
|
7
|
+
|
|
8
|
+
const component = {
|
|
9
|
+
template,
|
|
10
|
+
controller,
|
|
11
|
+
controllerAs: 'vm'
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
angular.module('mb.sidecontent', ['ngSanitize'])
|
|
15
|
+
.component('mbScBtn', btn)
|
|
16
|
+
.component('mbSideContent', component)
|
|
17
|
+
.service('MbgSideContent', service);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const sideContentService = function () {
|
|
2
|
+
const service = this;
|
|
3
|
+
service.contentBuffer = [];
|
|
4
|
+
|
|
5
|
+
let execAfterRegister = false;
|
|
6
|
+
service.updateComponent = () => {
|
|
7
|
+
execAfterRegister = true;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
service.add = (content) => {
|
|
11
|
+
const conteudo = Object.assign({
|
|
12
|
+
template: '',
|
|
13
|
+
icon: 'fas fa-question',
|
|
14
|
+
iconColor: '#fff',
|
|
15
|
+
btnBgColor: '#00d5d2',
|
|
16
|
+
onOpen: () => {},
|
|
17
|
+
onClose: () => {},
|
|
18
|
+
bgHide: false,
|
|
19
|
+
}, content, { id: Math.random().toString(36).slice(2) });
|
|
20
|
+
service.contentBuffer.push(conteudo);
|
|
21
|
+
service.updateComponent();
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
service.registerComponent = (update, close) => {
|
|
25
|
+
service.updateComponent = update;
|
|
26
|
+
service.close = close;
|
|
27
|
+
if (execAfterRegister === true) {
|
|
28
|
+
service.updateComponent();
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
service.btnBuffer = [];
|
|
33
|
+
service.registerBtn = (btn) => {
|
|
34
|
+
service.btnBuffer.push(btn);
|
|
35
|
+
service.updateAllBtn();
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
service.updateAllBtn = () => {
|
|
39
|
+
service.btnBuffer.forEach((btn, index) => {
|
|
40
|
+
btn.update(index, service.btnBuffer.length);
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
service.close = () => {};
|
|
45
|
+
|
|
46
|
+
return service;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export default sideContentService;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
.mb[side-content] {
|
|
2
|
+
.mb-sc-content-container{
|
|
3
|
+
width: 400px;
|
|
4
|
+
height: 100vh;
|
|
5
|
+
position: fixed;
|
|
6
|
+
right: 0px;
|
|
7
|
+
top: 0px;
|
|
8
|
+
left: auto;
|
|
9
|
+
bottom: 0px;
|
|
10
|
+
background-color: #fff;
|
|
11
|
+
z-index: 1002;
|
|
12
|
+
transform: translateX(100%);
|
|
13
|
+
transition: transform 500ms ease, box-shadow 250ms linear;
|
|
14
|
+
|
|
15
|
+
&.mb-sc-bg-hide {
|
|
16
|
+
background-color: transparent;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.mb-sc-preview {
|
|
20
|
+
transform: translateX(95%);
|
|
21
|
+
box-shadow: -3px 0px 100px 20px rgba(0,0,0,0.1);
|
|
22
|
+
|
|
23
|
+
&.mb-sc-active {
|
|
24
|
+
box-shadow: 0px 0px 0px 0px rgba(0,0,0,0);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
&.mb-sc-active {
|
|
29
|
+
transform: translateX(0%);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
&.mb-sc-active-bg-hide {
|
|
33
|
+
transform: translateX(0%);
|
|
34
|
+
top: calc(50% - 150px);
|
|
35
|
+
height: min-content;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.mb-sc-anchor {
|
|
39
|
+
position: relative;
|
|
40
|
+
width: 100%;
|
|
41
|
+
height: 100%;
|
|
42
|
+
|
|
43
|
+
.mb-sc-content {
|
|
44
|
+
width: 100%;
|
|
45
|
+
height: 100%;
|
|
46
|
+
background-color: transparent;
|
|
47
|
+
position: relative;
|
|
48
|
+
z-index: 1003;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.mb-sc-background {
|
|
54
|
+
opacity: 0;
|
|
55
|
+
background-color: rgba(0,0,0,0.5);
|
|
56
|
+
width: 100%;
|
|
57
|
+
height: 100vh;
|
|
58
|
+
position: fixed;
|
|
59
|
+
z-index: 999;
|
|
60
|
+
left: 0px;
|
|
61
|
+
top: 0px;
|
|
62
|
+
transition: opacity 250ms linear;
|
|
63
|
+
will-change: opacity;
|
|
64
|
+
|
|
65
|
+
&.mb-sc-bg-hide {
|
|
66
|
+
display: none;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&.mb-sc-active {
|
|
70
|
+
opacity: 1;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<div class="mb"
|
|
2
|
+
side-content>
|
|
3
|
+
<div class="mb-sc-content-container"
|
|
4
|
+
ng-click="vm.stopPropagation($event)"
|
|
5
|
+
ng-class="{'mb-sc-active': vm.active && !vm.bgHide, 'mb-sc-active-bg-hide': vm.active && vm.bgHide, 'mb-sc-preview':vm.hoverButton && vm.active !== true, 'mb-sc-bg-hide': vm.bgHide}">
|
|
6
|
+
<div class="mb-sc-anchor">
|
|
7
|
+
|
|
8
|
+
<div id="mb-sc-content"
|
|
9
|
+
class="mb-sc-content">
|
|
10
|
+
|
|
11
|
+
</div>
|
|
12
|
+
|
|
13
|
+
</div>
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
<mb-sc-btn ng-repeat="content in vm.contentBuffer"
|
|
17
|
+
content-open="vm.active"
|
|
18
|
+
active-content="vm.activeContent"
|
|
19
|
+
toggle-fn="vm.toggle(content)"
|
|
20
|
+
config="content"></mb-sc-btn>
|
|
21
|
+
|
|
22
|
+
<div class="mb-sc-background"
|
|
23
|
+
ng-click="vm.close()"
|
|
24
|
+
ng-class="{'mb-sc-active':vm.active, 'mb-sc-bg-hide':vm.bgHide}"></div>
|
|
25
|
+
</div>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const controller = function ($element, $scope, hotkeys) {
|
|
2
|
+
const click = () => {
|
|
3
|
+
$element[0].children[0].click();
|
|
4
|
+
};
|
|
5
|
+
this.$onInit = () => {
|
|
6
|
+
const { hotkey } = this;
|
|
7
|
+
if (hotkey && hotkey.length > 0) {
|
|
8
|
+
hotkeys.bindTo($scope).add({ combo: hotkey, callback: click });
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export default controller;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
@import "../../../themes/themes.style.scss";
|
|
2
|
+
|
|
3
|
+
.mb[side-menu-btn] {
|
|
4
|
+
color: #ccc;
|
|
5
|
+
@include themify(color, neutral2);
|
|
6
|
+
font-size: 12px;
|
|
7
|
+
font-weight: 400;
|
|
8
|
+
width: 100%;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: row;
|
|
11
|
+
justify-content: flex-start;
|
|
12
|
+
align-items: center;
|
|
13
|
+
user-select: none;
|
|
14
|
+
transition: transform 250ms ease;
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
padding-top: 5px;
|
|
17
|
+
padding-bottom: 5px;
|
|
18
|
+
|
|
19
|
+
.mbg-tag {
|
|
20
|
+
border-radius: 5px;
|
|
21
|
+
color: #fff;
|
|
22
|
+
text-transform: uppercase;
|
|
23
|
+
font-weight: 600;
|
|
24
|
+
text-shadow: none;
|
|
25
|
+
font-size: 9px;
|
|
26
|
+
padding: 3px 8px;
|
|
27
|
+
text-rendering: optimizeSpeed;
|
|
28
|
+
-webkit-font-smoothing: antialiased;
|
|
29
|
+
line-height: 1;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
> .mb-smb-icon {
|
|
33
|
+
font-size: 14px;
|
|
34
|
+
margin-right: 5px;
|
|
35
|
+
width: 22px;
|
|
36
|
+
height: 22px;
|
|
37
|
+
line-height: 22px;
|
|
38
|
+
user-select: none;
|
|
39
|
+
text-align: center;
|
|
40
|
+
transition: color 200ms linear;
|
|
41
|
+
|
|
42
|
+
> .mb-smb-custom-icon {
|
|
43
|
+
width: auto;
|
|
44
|
+
height: 100%;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.material-icons {
|
|
48
|
+
font-size: 16px;
|
|
49
|
+
line-height: 22px;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
> .mb-smb-text {
|
|
54
|
+
display: inline-block;
|
|
55
|
+
vertical-align: middle;
|
|
56
|
+
transition: color 200ms linear;
|
|
57
|
+
font-weight: 600;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&:hover {
|
|
61
|
+
transform: translate3d(1%, 0, 0);
|
|
62
|
+
|
|
63
|
+
> .mb-smb-text {
|
|
64
|
+
color: #9136ca;
|
|
65
|
+
|
|
66
|
+
@include themify(color, color1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
> .mb-smb-icon {
|
|
70
|
+
color: #9136ca;
|
|
71
|
+
|
|
72
|
+
@include themify(color, color1);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|