@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.
Files changed (140) hide show
  1. package/README.md +505 -0
  2. package/app.js +686 -0
  3. package/assets/img/custom-icon.svg +1 -0
  4. package/assets/img/logo-finance.png +0 -0
  5. package/assets/img/logo.png +0 -0
  6. package/assets/img/logo_company.png +0 -0
  7. package/assets/img/perfil.png +0 -0
  8. package/config/postcss.config.js +14 -0
  9. package/config/webpack.config.common.js +53 -0
  10. package/config/webpack.config.dev.js +50 -0
  11. package/config/webpack.config.prod.js +49 -0
  12. package/index.html +115 -0
  13. package/package.json +64 -0
  14. package/resources/audio/mouth-pop.mp3 +0 -0
  15. package/src/index.js +1 -0
  16. package/src/modules/base/components/container/container.style.scss +7 -0
  17. package/src/modules/base/components/container/container.template.html +2 -0
  18. package/src/modules/base/components/container/index.js +9 -0
  19. package/src/modules/base/components/content-container/content-container.style.scss +36 -0
  20. package/src/modules/base/components/content-container/content-container.template.html +8 -0
  21. package/src/modules/base/components/content-container/index.js +9 -0
  22. package/src/modules/base/controllers/base.controller.js +39 -0
  23. package/src/modules/base/index.js +42 -0
  24. package/src/modules/base/providers/theme.provider.js +12 -0
  25. package/src/modules/base/providers/themes.list.js +233 -0
  26. package/src/modules/base/styles/base.animations.scss +43 -0
  27. package/src/modules/base/styles/base.flex.scss +45 -0
  28. package/src/modules/base/styles/base.style.scss +169 -0
  29. package/src/modules/base/templates/base.template.html +6 -0
  30. package/src/modules/footer/components/footer/footer.controller.js +17 -0
  31. package/src/modules/footer/components/footer/footer.style.scss +0 -0
  32. package/src/modules/footer/components/footer/footer.template.html +25 -0
  33. package/src/modules/footer/components/footer/index.js +13 -0
  34. package/src/modules/footer/controllers/footer.controller.js +13 -0
  35. package/src/modules/footer/index.js +19 -0
  36. package/src/modules/footer/services/footer.service.js +24 -0
  37. package/src/modules/footer/styles/footer.animations.scss +11 -0
  38. package/src/modules/footer/styles/footer.style.scss +28 -0
  39. package/src/modules/footer/templates/footer.template.html +1 -0
  40. package/src/modules/pageloader/controllers/pageloader.controller.js +60 -0
  41. package/src/modules/pageloader/index.js +15 -0
  42. package/src/modules/pageloader/services/pageloader.service.js +15 -0
  43. package/src/modules/pageloader/styles/pageloader.style.scss +67 -0
  44. package/src/modules/pageloader/templates/pageloader.template.html +9 -0
  45. package/src/modules/side-content/components/btn/btn.controller.js +55 -0
  46. package/src/modules/side-content/components/btn/btn.style.scss +48 -0
  47. package/src/modules/side-content/components/btn/btn.template.html +18 -0
  48. package/src/modules/side-content/components/btn/index.js +17 -0
  49. package/src/modules/side-content/controllers/side-content.controller.js +93 -0
  50. package/src/modules/side-content/index.js +17 -0
  51. package/src/modules/side-content/services/side-content.service.js +49 -0
  52. package/src/modules/side-content/styles/side-content.style.scss +73 -0
  53. package/src/modules/side-content/templates/side-content.template.html +25 -0
  54. package/src/modules/side-menu/components/btn/btn.controller.js +13 -0
  55. package/src/modules/side-menu/components/btn/btn.style.scss +75 -0
  56. package/src/modules/side-menu/components/btn/btn.template.html +43 -0
  57. package/src/modules/side-menu/components/btn/index.js +26 -0
  58. package/src/modules/side-menu/components/category/category.style.scss +47 -0
  59. package/src/modules/side-menu/components/category/category.template.html +23 -0
  60. package/src/modules/side-menu/components/category/index.js +13 -0
  61. package/src/modules/side-menu/components/html/html.controller.js +5 -0
  62. package/src/modules/side-menu/components/html/html.template.html +3 -0
  63. package/src/modules/side-menu/components/html/index.js +14 -0
  64. package/src/modules/side-menu/components/item/index.js +29 -0
  65. package/src/modules/side-menu/components/item/item.template.html +40 -0
  66. package/src/modules/side-menu/components/link/index.js +18 -0
  67. package/src/modules/side-menu/components/link/link.controller.js +48 -0
  68. package/src/modules/side-menu/components/link/link.style.scss +10 -0
  69. package/src/modules/side-menu/components/link/link.template.html +21 -0
  70. package/src/modules/side-menu/components/quick-menu/index.js +14 -0
  71. package/src/modules/side-menu/components/quick-menu/quick-menu.controller.js +67 -0
  72. package/src/modules/side-menu/components/quick-menu/quick-menu.style.scss +151 -0
  73. package/src/modules/side-menu/components/quick-menu/quick-menu.template.html +44 -0
  74. package/src/modules/side-menu/components/sub-category/index.js +20 -0
  75. package/src/modules/side-menu/components/sub-category/sub-category.controller.js +16 -0
  76. package/src/modules/side-menu/components/sub-category/sub-category.style.scss +48 -0
  77. package/src/modules/side-menu/components/sub-category/sub-category.template.html +47 -0
  78. package/src/modules/side-menu/controllers/sideMenu.js +71 -0
  79. package/src/modules/side-menu/index.js +33 -0
  80. package/src/modules/side-menu/services/sideMenu.js +12 -0
  81. package/src/modules/side-menu/styles/side-menu.style.scss +86 -0
  82. package/src/modules/side-menu/templates/side-menu.template.html +30 -0
  83. package/src/modules/themes/themes.style.scss +227 -0
  84. package/src/modules/top-notifications/components/notification/index.js +17 -0
  85. package/src/modules/top-notifications/components/notification/notification.controller.js +168 -0
  86. package/src/modules/top-notifications/components/notification/notification.style.scss +210 -0
  87. package/src/modules/top-notifications/components/notification/notification.template.html +22 -0
  88. package/src/modules/top-notifications/controllers/top-notifications.controller.js +33 -0
  89. package/src/modules/top-notifications/index.js +18 -0
  90. package/src/modules/top-notifications/services/top-notifications.services.js +108 -0
  91. package/src/modules/top-notifications/styles/top-notifications.style.scss +0 -0
  92. package/src/modules/top-notifications/templates/top-notifications.template.html +5 -0
  93. package/src/modules/topbar/components/cashier/cashier.controller.js +17 -0
  94. package/src/modules/topbar/components/cashier/cashier.styles.scss +79 -0
  95. package/src/modules/topbar/components/cashier/cashier.template.html +32 -0
  96. package/src/modules/topbar/components/cashier/index.js +14 -0
  97. package/src/modules/topbar/components/cashier/service/cashier.service.js +43 -0
  98. package/src/modules/topbar/components/environment/environment.html +24 -0
  99. package/src/modules/topbar/components/environment/environment.js +16 -0
  100. package/src/modules/topbar/components/environment/environment.scss +137 -0
  101. package/src/modules/topbar/components/environment/index.js +11 -0
  102. package/src/modules/topbar/components/environment/service/environment.service.js +19 -0
  103. package/src/modules/topbar/components/notifications/index.js +13 -0
  104. package/src/modules/topbar/components/notifications/notifications.controller.js +108 -0
  105. package/src/modules/topbar/components/notifications/notifications.styles.scss +282 -0
  106. package/src/modules/topbar/components/notifications/notifications.template.html +154 -0
  107. package/src/modules/topbar/components/search/components/input/index.js +19 -0
  108. package/src/modules/topbar/components/search/components/input/input.controller.js +19 -0
  109. package/src/modules/topbar/components/search/components/input/input.style.scss +74 -0
  110. package/src/modules/topbar/components/search/components/input/input.template.html +8 -0
  111. package/src/modules/topbar/components/search/components/result-line/index.js +16 -0
  112. package/src/modules/topbar/components/search/components/result-line/result-line.controller.js +69 -0
  113. package/src/modules/topbar/components/search/components/result-line/result-line.style.scss +58 -0
  114. package/src/modules/topbar/components/search/components/result-line/result-line.template.html +29 -0
  115. package/src/modules/topbar/components/search/controllers/search.controller.js +298 -0
  116. package/src/modules/topbar/components/search/index.js +21 -0
  117. package/src/modules/topbar/components/search/styles/search.style.scss +114 -0
  118. package/src/modules/topbar/components/search/templates/search.template.html +48 -0
  119. package/src/modules/topbar/components/user/components/btn/btn.style.scss +35 -0
  120. package/src/modules/topbar/components/user/components/btn/btn.template.html +36 -0
  121. package/src/modules/topbar/components/user/components/btn/index.js +15 -0
  122. package/src/modules/topbar/components/user/components/link/index.js +18 -0
  123. package/src/modules/topbar/components/user/components/link/link.controller.js +15 -0
  124. package/src/modules/topbar/components/user/components/link/link.style.scss +13 -0
  125. package/src/modules/topbar/components/user/components/link/link.template.html +26 -0
  126. package/src/modules/topbar/components/user/components/loading/index.js +14 -0
  127. package/src/modules/topbar/components/user/components/loading/loading.animations.scss +9 -0
  128. package/src/modules/topbar/components/user/components/loading/loading.style.scss +12 -0
  129. package/src/modules/topbar/components/user/components/loading/loading.template.html +3 -0
  130. package/src/modules/topbar/components/user/controllers/user.controller.js +200 -0
  131. package/src/modules/topbar/components/user/index.js +27 -0
  132. package/src/modules/topbar/components/user/services/user.service.js +14 -0
  133. package/src/modules/topbar/components/user/styles/user.animations.scss +27 -0
  134. package/src/modules/topbar/components/user/styles/user.style.scss +997 -0
  135. package/src/modules/topbar/components/user/templates/user.template.html +252 -0
  136. package/src/modules/topbar/controllers/topbar.controller.js +27 -0
  137. package/src/modules/topbar/index.js +31 -0
  138. package/src/modules/topbar/services/base-notification-service.js +40 -0
  139. package/src/modules/topbar/styles/topbar.style.scss +211 -0
  140. package/src/modules/topbar/templates/topbar.template.html +93 -0
@@ -0,0 +1,43 @@
1
+ <mb-sm-link action="vm.action"
2
+ keys="vm.keys"
3
+ config="vm.config"
4
+ action-type="vm.actionType">
5
+ <div side-menu-btn
6
+ class="mb"
7
+ ng-class="{'lastChild' : vm.lastChild, 'firstChild' : vm.firstChild}">
8
+ <div class="mb-smb-text"
9
+ ng-if="vm.iconSide === 'right'">
10
+ {{ vm.label }}
11
+ </div>
12
+
13
+ <div class="mb-smb-icon"
14
+ ng-if="vm.iconSrc === 'fontawesome'"
15
+ ng-style="{'font-size': vm.iconSize ? vm.iconSize + 'px' : undefined, 'line-height' : vm.iconSize ? vm.iconSize + 'px' : undefined, 'height' : vm.iconSize ? vm.iconSize + 'px' : undefined, 'width' : vm.iconSize ? 'auto' : undefined }">
16
+ <i class="{{vm.icon}}"></i>
17
+ </div>
18
+ <div class="mb-smb-icon"
19
+ ng-if="vm.iconSrc === 'material'"
20
+ ng-style="{ 'height' : vm.iconSize ? vm.iconSize + 'px' : undefined, 'width' : vm.iconSize ? 'auto' : undefined }">
21
+ <i class="material-icons"
22
+ ng-style="{'font-size': vm.iconSize ? vm.iconSize + 'px' : undefined, 'line-height' : vm.iconSize ? vm.iconSize + 'px' : undefined }">{{
23
+ vm.icon }}</i>
24
+ </div>
25
+ <div class="mb-smb-icon"
26
+ ng-if="vm.iconSrc !== 'material' && vm.iconSrc !== 'fontawesome' && vm.iconSrc !== undefined && vm.iconSrc.length > 0"
27
+ ng-style="{ 'height' : vm.iconSize ? vm.iconSize + 'px' : undefined, 'width' : vm.iconSize ? 'auto' : undefined }">
28
+ <img class="mb-smb-custom-icon"
29
+ ng-src="{{ vm.iconSrc }}"
30
+ alt="">
31
+ </div>
32
+
33
+ <div class="mb-smb-text"
34
+ ng-if="vm.iconSide !== 'right'">
35
+ {{ vm.label }}
36
+ <span ng-if="vm.tag"
37
+ ng-style="{background: vm.tag.color}"
38
+ class="mbg-tag">
39
+ {{ vm.tag.label }}
40
+ </span>
41
+ </div>
42
+ </div>
43
+ </mb-sm-link>
@@ -0,0 +1,26 @@
1
+ import template from './btn.template.html';
2
+ import './btn.style.scss';
3
+ import controller from './btn.controller';
4
+
5
+ const btn = {
6
+ bindings: {
7
+ label: '@',
8
+ icon: '@',
9
+ iconSrc: '@',
10
+ iconSize: '@',
11
+ action: '<',
12
+ actionType: '<',
13
+ iconSide: '@',
14
+ firstChild: '<',
15
+ lastChild: '<',
16
+ tag: '=?',
17
+ config: '=?',
18
+ hotkey: '@',
19
+ keys: '=?'
20
+ },
21
+ template,
22
+ controller,
23
+ controllerAs: 'vm'
24
+ };
25
+
26
+ export default btn;
@@ -0,0 +1,47 @@
1
+ @import '../../../themes/themes.style.scss';
2
+
3
+ .mb[sm-category] {
4
+ user-select: none;
5
+ padding-bottom: 5px;
6
+
7
+ > .mb-smc-title {
8
+ font-weight: 700;
9
+ vertical-align: middle;
10
+ display: inline-block;
11
+
12
+ > .mb-smc-dot {
13
+ height: 7px;
14
+ width: 7px;
15
+ border-radius: 3.5px;
16
+ display: inline-block;
17
+ vertical-align: middle;
18
+ background-color: #00bdc1;
19
+ @include themify(background-color, color4);
20
+ }
21
+
22
+ > .mb-smc-title-text {
23
+ font-size: 12px;
24
+ font-weight: 700;
25
+ color: #00bdc1;
26
+ @include themify(color, color4);
27
+ display: inline-block;
28
+ }
29
+ }
30
+
31
+ > .mb-smc-detail-container {
32
+ width: 100%;
33
+
34
+ > .mbg-smc-detail {
35
+ width: 50px;
36
+
37
+ > .mbg-smc-detail-path {
38
+ fill: #ccc;
39
+ @include themify(fill, neutral3);
40
+ stroke: #ccc;
41
+ @include themify(stroke, neutral3);
42
+ stroke-miterlimit: 10;
43
+ stroke-width: 2px;
44
+ }
45
+ }
46
+ }
47
+ }
@@ -0,0 +1,23 @@
1
+ <div class="mb"
2
+ sm-category>
3
+ <div class="mb-smc-title" ng-show="vm.label">
4
+ <div class="mb-smc-dot"></div>
5
+ <div class="mb-smc-title-text">
6
+ {{ vm.label }}
7
+ </div>
8
+ </div>
9
+ <div ng-transclude>
10
+
11
+
12
+ </div>
13
+ <div class="mb-smc-detail-container">
14
+ <svg class="mbg-smc-detail"
15
+ xmlns="http://www.w3.org/2000/svg"
16
+ viewBox="0 0 78.56 7.99">
17
+ <path class="mbg-smc-detail-path"
18
+ d="M11.82,5A9.21,9.21,0,0,0,23.76,5a7.23,7.23,0,0,1,9.59,0,9.21,9.21,0,0,0,11.9,0,7.24,7.24,0,0,1,9.56,0,9.21,9.21,0,0,0,12,0,7,7,0,0,1,4.78-1.8A6.47,6.47,0,0,1,75.68,4.5c.48-.47.95-1,1.41-1.45a8.6,8.6,0,0,0-5.55-1.88,8.94,8.94,0,0,0-6,2.2,7.24,7.24,0,0,1-9.56,0A9.21,9.21,0,0,0,44,3.37a7.23,7.23,0,0,1-9.55,0,9.21,9.21,0,0,0-11.94,0,7.23,7.23,0,0,1-9.55,0,8.94,8.94,0,0,0-6-2.2A8.58,8.58,0,0,0,1.51,3c.46.49.93,1,1.41,1.45A6.46,6.46,0,0,1,7,3.17,7,7,0,0,1,11.82,5Z"
19
+
20
+ transform="translate(-0.04 -0.16)" />
21
+ </svg>
22
+ </div>
23
+ </div>
@@ -0,0 +1,13 @@
1
+ import template from './category.template.html';
2
+ import './category.style.scss';
3
+
4
+ const category = {
5
+ bindings: {
6
+ label: '@'
7
+ },
8
+ template,
9
+ transclude: true,
10
+ controllerAs: 'vm'
11
+ };
12
+
13
+ export default category;
@@ -0,0 +1,5 @@
1
+ const controller = () => {
2
+
3
+ };
4
+
5
+ export default controller;
@@ -0,0 +1,3 @@
1
+ <div ng-bind-html="vm.html">
2
+
3
+ </div>
@@ -0,0 +1,14 @@
1
+ import controller from './html.controller';
2
+ import template from './html.template.html';
3
+
4
+ const component = {
5
+ bindings: {
6
+ html: '<'
7
+ },
8
+ controller,
9
+ controllerAs: 'vm',
10
+ template,
11
+ transclude: true
12
+ };
13
+
14
+ export default component;
@@ -0,0 +1,29 @@
1
+ import template from './item.template.html';
2
+
3
+ const item = {
4
+ bindings: {
5
+ config: '<',
6
+ keys: '=?',
7
+ firstChild: '<',
8
+ lastChild: '<'
9
+ },
10
+ template,
11
+ controllerAs: 'vm',
12
+ controller: ['$scope', function ($scope) {
13
+ const vm = this
14
+
15
+ vm.$onInit = () => {
16
+ }
17
+
18
+ vm.showSubCategory = () => {
19
+ return true
20
+ // if (vm.config && vm.config.children) {
21
+ // return vm.config.children.filter((children) => !children.key || (vm.keys || []).indexOf(children.key) !== -1).length > 0
22
+ // }
23
+ // return true
24
+ }
25
+
26
+ }]
27
+ };
28
+
29
+ export default item;
@@ -0,0 +1,40 @@
1
+ <mb-sm-category ng-if="vm.config.type === 'category'"
2
+ label="{{vm.config.label}}">
3
+ <mb-sm-item ng-repeat="item in vm.config.children"
4
+ first-child="$first"
5
+ last-child="$last"
6
+ keys="vm.keys"
7
+ config="item">
8
+ </mb-sm-item>
9
+ </mb-sm-category>
10
+ <mb-sm-subcategory qtd-sub-itens="vm.config.children.length"
11
+ show-itens="vm.config.showItens"
12
+ icon-src="{{vm.config.iconSrc}}"
13
+ icon="{{vm.config.icon}}"
14
+ icon-size="{{vm.config.iconSize}}"
15
+ ng-if="vm.config.type === 'sub-category' && vm.showSubCategory()"
16
+ label="{{vm.config.label}}">
17
+ <mb-sm-item ng-repeat="item in vm.config.children"
18
+ first-child="$first"
19
+ last-child="$last"
20
+ keys="vm.keys"
21
+ config="item">
22
+ </mb-sm-item>
23
+ </mb-sm-subcategory>
24
+ <mb-sm-btn ng-if="vm.config.type === 'btn'"
25
+ icon-src="{{vm.config.iconSrc}}"
26
+ icon="{{vm.config.icon}}"
27
+ icon-size="{{vm.config.iconSize}}"
28
+ label="{{vm.config.label}}"
29
+ action="vm.config.action"
30
+ action-type="vm.config.actionType"
31
+ hotkey="{{vm.config.hotkey}}"
32
+ config="vm.config"
33
+ first-child="vm.firstChild"
34
+ tag="vm.config.tag"
35
+ keys="vm.keys"
36
+ last-child="vm.lastChild">
37
+ </mb-sm-btn>
38
+ <mb-sm-html ng-if="vm.config.type === 'html'"
39
+ html="vm.config.html">
40
+ </mb-sm-html>
@@ -0,0 +1,18 @@
1
+ import controller from './link.controller';
2
+ import template from './link.template.html';
3
+ import './link.style.scss';
4
+
5
+ const component = {
6
+ bindings: {
7
+ actionType: '<',
8
+ action: '<',
9
+ keys: '=?',
10
+ config: '=?'
11
+ },
12
+ controller,
13
+ controllerAs: 'vm',
14
+ template,
15
+ transclude: true
16
+ };
17
+
18
+ export default component;
@@ -0,0 +1,48 @@
1
+ const controller = function ($state, mbSidemenuService, MbgNotification, $timeout) {
2
+ this.$onInit = () => {
3
+ // console.log(this);
4
+ };
5
+
6
+ this.pressBtn = async (vm) => {
7
+ let access = true
8
+ if (vm.config && !!vm.config.key && (vm.keys || []).indexOf(vm.config.key) === -1) {
9
+ access = await this.authAccess(vm.config)
10
+ }
11
+ if (access) {
12
+ switch (vm.actionType) {
13
+ case 'state':
14
+ const regexParams = new RegExp(/\((.*?)\)/gm).exec(vm.action)
15
+ const state = vm.action.replace(new RegExp(/\((.*?)\)/, 'gm'), '')
16
+ const params = (regexParams || []).length > 0 ? JSON.parse(regexParams[1].replace(new RegExp(/'/, 'gm'), `"`)) : {}
17
+ $state.go(state, params)
18
+ break
19
+ case 'link':
20
+ location.href = vm.action
21
+ break
22
+ case 'function':
23
+ vm.action()
24
+ break
25
+ }
26
+ } else {
27
+ $timeout(() => {
28
+ MbgNotification.openNotification({
29
+ type: 'error',
30
+ variation: 'toast',
31
+ duration: 3000,
32
+ text: 'Acesso negado'
33
+ })
34
+ })
35
+ }
36
+ }
37
+
38
+ this.authAccess = async (data) => {
39
+ const config = mbSidemenuService.getMenuConfig()
40
+ if (config.authAccess) {
41
+ return config.authAccess(data)
42
+ } else {
43
+ return true
44
+ }
45
+ }
46
+ };
47
+
48
+ export default controller;
@@ -0,0 +1,10 @@
1
+ .mb[smb-link] {
2
+ text-decoration: none;
3
+
4
+ &:visited, &:focus, &:active {
5
+ color: inherit;
6
+ text-decoration: none;
7
+ outline: none;
8
+ box-shadow: none;
9
+ }
10
+ }
@@ -0,0 +1,21 @@
1
+ <a tabindex="-1"
2
+ class="mb"
3
+ smb-link
4
+ ng-transclude
5
+ ng-if="vm.actionType === 'state'"
6
+ ng-click="vm.pressBtn(vm)">
7
+ </a>
8
+ <a tabindex="-1"
9
+ class="mb"
10
+ smb-link
11
+ ng-transclude
12
+ ng-if="vm.actionType === 'link'"
13
+ ng-click="vm.pressBtn(vm)">
14
+ </a>
15
+ <a tabindex="-1"
16
+ class="mb"
17
+ smb-link
18
+ ng-transclude
19
+ ng-if="vm.actionType === 'function'"
20
+ ng-click="vm.pressBtn(vm)">
21
+ </a>
@@ -0,0 +1,14 @@
1
+ import template from './quick-menu.template.html';
2
+ import './quick-menu.style.scss';
3
+ import controller from './quick-menu.controller';
4
+
5
+ const quickMenu = {
6
+ bindings: {
7
+ config: '=?'
8
+ },
9
+ controller,
10
+ controllerAs: 'vm',
11
+ template
12
+ };
13
+
14
+ export default quickMenu;
@@ -0,0 +1,67 @@
1
+ const controller = function ($scope, $timeout, $interval) {
2
+
3
+ $scope.state = {
4
+ quickMenuOpen: false,
5
+ animationInProgress: false,
6
+ menuBottomY: 0
7
+ };
8
+
9
+ $timeout(() => {
10
+ if (this.config.enableAutoToggle && !$scope.debounce) {
11
+ $scope.debounce = true
12
+ $scope.toggleQuickMenu()
13
+ $timeout(() => {
14
+ $scope.toggleQuickMenu()
15
+ $scope.debounce = false
16
+ }, 2000)
17
+ }
18
+ }, 1000)
19
+
20
+
21
+ const toggleAnimationInProgress = () => {
22
+ $scope.state.animationInProgress = true;
23
+ $timeout(() => {
24
+ $scope.state.animationInProgress = false;
25
+ }, 475);
26
+ };
27
+
28
+ const toggleMenuBottom = (state) => {
29
+ if (state === true) {
30
+ $scope.state.menuBottomY = (this.config.links.length * 43) + 5;
31
+ } else {
32
+ $scope.state.menuBottomY = 0;
33
+ }
34
+ };
35
+
36
+ const onClickOutside = () => {
37
+ $timeout(() => {
38
+ $scope.toggleQuickMenu();
39
+ });
40
+ };
41
+
42
+ $scope.toggleQuickMenu = () => {
43
+ if ($scope.state.animationInProgress === false) {
44
+ if ($scope.state.quickMenuOpen === true) {
45
+ $scope.state.quickMenuOpen = false;
46
+ toggleMenuBottom($scope.state.quickMenuOpen);
47
+
48
+ document.removeEventListener('click', onClickOutside);
49
+
50
+ toggleAnimationInProgress();
51
+ } else if ($scope.state.quickMenuOpen === false) {
52
+ $scope.state.quickMenuOpen = true;
53
+
54
+ document.addEventListener('click', onClickOutside);
55
+
56
+ toggleMenuBottom($scope.state.quickMenuOpen);
57
+ toggleAnimationInProgress();
58
+ }
59
+ }
60
+ };
61
+
62
+ this.$onDestroy = () => {
63
+ document.removeEventListener('click', onClickOutside);
64
+ };
65
+ };
66
+
67
+ export default controller;
@@ -0,0 +1,151 @@
1
+ @import "../../../themes/themes.style.scss";
2
+
3
+ /* Quick Menu */
4
+ .mb[sm-quick-menu] {
5
+ width: 100%;
6
+ height: 40px;
7
+ position: relative;
8
+
9
+ > .mb-smqm-button {
10
+ background-color: #ff0758;
11
+
12
+ @include themify(background-color, quickMenuBtnBackground);
13
+
14
+ width: 100%;
15
+ height: 40px;
16
+ border-radius: 20px;
17
+ text-align: center;
18
+ transform: translate3d(0px, 0px, 0px);
19
+ position: relative;
20
+ display: flex;
21
+ flex-direction: row;
22
+ justify-content: space-between;
23
+ align-items: center;
24
+ z-index: 603;
25
+ cursor: pointer;
26
+ box-shadow: 0px 3px 30px rgba(0, 0, 0, 0.1);
27
+ user-select: none;
28
+
29
+ > .mb-smqm-button-text {
30
+ margin-left: 15px;
31
+ margin-right: 10px;
32
+ font-size: 12px;
33
+ color: #ffffff;
34
+ font-weight: 700;
35
+ }
36
+
37
+ > .mb-smqm-button-arrow-container {
38
+ width: 30px;
39
+ height: 30px;
40
+ background-color: white;
41
+ vertical-align: middle;
42
+ transform: rotateZ(0deg);
43
+ border-radius: 50%;
44
+ display: flex;
45
+ justify-content: center;
46
+ align-items: center;
47
+ margin-right: 5px;
48
+ transition: transform 500ms cubic-bezier(0.475, 0.01, 0.195, 1.035);
49
+
50
+ > .mb-smqm-button-arrow {
51
+ color: #ff0758;
52
+
53
+ @include themify(color, quickMenuBtnBackground);
54
+
55
+ transform: translate(0px, 1px);
56
+ user-select: none;
57
+ font-size: 17px;
58
+ }
59
+
60
+ &.mb-smqm-active {
61
+ transform: rotateZ(180deg);
62
+ }
63
+ }
64
+ }
65
+
66
+ > .mb-smqm-menu {
67
+ width: 100%;
68
+ height: 120px;
69
+ background-color: #de0440;
70
+
71
+ @include themify(background-color, quickMenuBackground);
72
+
73
+ position: absolute;
74
+ top: 20px;
75
+ transform: scaleY(0);
76
+ transform-origin: 50% 0%;
77
+ transition: transform 500ms cubic-bezier(0.475, 0.01, 0.195, 1.035);
78
+ padding: 20px 15px 0px 15px;
79
+ z-index: 602;
80
+
81
+ &.mb-smqm-active {
82
+ transform: scaleY(1);
83
+ }
84
+
85
+ > .mb-smqm-content {
86
+ width: 100%;
87
+ position: relative;
88
+ transition: opacity 500ms linear;
89
+ opacity: 0;
90
+
91
+ &.mb-smqm-active {
92
+ transition: opacity 500ms 100ms linear;
93
+ opacity: 1;
94
+ }
95
+
96
+ .mb[side-menu-btn] {
97
+ display: flex;
98
+ justify-content: space-between;
99
+ align-items: center;
100
+ height: auto;
101
+ padding-top: 10px;
102
+ padding-bottom: 10px;
103
+ border-bottom: 1px solid rgba(255, 255, 255, 0.2);
104
+ transform: none;
105
+ position: relative;
106
+
107
+ > .mb-smb-text {
108
+ color: white;
109
+ transition: 100ms opacity linear;
110
+ opacity: 0.7;
111
+ }
112
+
113
+ > .mb-smb-icon {
114
+ color: white;
115
+ transition: 100ms opacity linear;
116
+ opacity: 0.7;
117
+ }
118
+
119
+ &:hover {
120
+ > .mb-smb-text {
121
+ opacity: 1;
122
+ }
123
+
124
+ > .mb-smb-icon {
125
+ opacity: 1;
126
+ }
127
+ }
128
+
129
+ &.lastChild {
130
+ border-bottom: none;
131
+ }
132
+ }
133
+ }
134
+ }
135
+
136
+ > .mb-smqm-menu-bottom {
137
+ position: absolute;
138
+ top: 0px;
139
+ width: 100%;
140
+ height: 40px;
141
+ transform: translate3d(0px, 0px, 0px);
142
+ transition: transform 500ms cubic-bezier(0.475, 0.01, 0.195, 1.035);
143
+ background-color: #de0440;
144
+
145
+ @include themify(background-color, quickMenuBackground);
146
+
147
+ border-radius: 20px;
148
+ z-index: 600;
149
+ box-shadow: 0px 5px 5px rgba(0, 0, 0, 0.15);
150
+ }
151
+ }
@@ -0,0 +1,44 @@
1
+ <div class="mb"
2
+ tabindex="-1"
3
+ sm-quick-menu>
4
+ <div class="mb-smqm-button"
5
+ tabindex="-1"
6
+ title="{{vm.config.buttonText + ' (c)'}}"
7
+ ng-click="toggleQuickMenu()">
8
+ <div class="mb-smqm-button-text" tabindex="-1">
9
+ {{ vm.config.buttonText }}
10
+ </div>
11
+ <div class="mb-smqm-button-arrow-container"
12
+ tabindex="-1"
13
+ ng-class="{'mb-smqm-active' : state.quickMenuOpen}">
14
+ <div class="mb-smqm-button-arrow" tabindex="-1">
15
+ <i class="fas fa-caret-down" tabindex="-1"></i>
16
+ </div>
17
+ </div>
18
+ </div>
19
+ <div class="mb-smqm-menu"
20
+ tabindex="-1"
21
+ ng-style="{'height': (5 + (vm.config.links.length * 43)) + 'px'}"
22
+ ng-class="{'mb-smqm-active' : state.quickMenuOpen}">
23
+ <div class="mb-smqm-content"
24
+ tabindex="-1"
25
+ ng-class="{'mb-smqm-active' : state.quickMenuOpen}">
26
+ <mb-sm-btn ng-repeat="link in vm.config.links"
27
+ tabindex="-1"
28
+ icon-src="{{link.iconSrc}}"
29
+ icon="{{link.icon}}"
30
+ icon-size="{{link.iconSize}}"
31
+ label="{{link.label}}"
32
+ action="link.action"
33
+ action-type="link.actionType"
34
+ icon-side="right"
35
+ hotkey="{{link.hotkey}}"
36
+ first-child="$first"
37
+ last-child="$last">
38
+ </mb-sm-btn>
39
+ </div>
40
+ </div>
41
+ <div class="mb-smqm-menu-bottom"
42
+ tabindex="-1"
43
+ ng-style="{'transform': 'translate3d(0px,' + state.menuBottomY + 'px, 0px)'}"></div>
44
+ </div>
@@ -0,0 +1,20 @@
1
+ import template from './sub-category.template.html';
2
+ import './sub-category.style.scss';
3
+ import controller from './sub-category.controller';
4
+
5
+ const subCategory = {
6
+ bindings: {
7
+ label: '@',
8
+ icon: '@',
9
+ iconSrc: '@',
10
+ iconSize: '@',
11
+ showItens: '<?',
12
+ qtdSubItens: '<?'
13
+ },
14
+ controller,
15
+ controllerAs: 'vm',
16
+ template,
17
+ transclude: true
18
+ };
19
+
20
+ export default subCategory;
@@ -0,0 +1,16 @@
1
+ const controller = function () {
2
+ const vm = this;
3
+ vm.opened = false;
4
+ vm.btnHeight = 25;
5
+
6
+ vm.toggle = () => {
7
+ if (vm.opened === true) {
8
+ vm.opened = false;
9
+ } else {
10
+ vm.opened = true;
11
+ }
12
+ };
13
+
14
+ };
15
+
16
+ export default controller;