@sgcloud-sgsistemas/base 1.1.0 → 1.1.1

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sgcloud-sgsistemas/base",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Base para os sistemas da mobiage",
5
5
  "repository": {
6
6
  "type": "private",
@@ -1,15 +1,20 @@
1
1
  const controller = function ($scope, hotkeys, $timeout, MbgNotification) {
2
2
  const vm = this
3
- vm.translateY = ''
4
- vm.height = '100vh'
3
+
4
+ vm.style = {
5
+ '--notificationYOffset': '0px',
6
+ transform: '',
7
+ height: '100vh',
8
+ }
5
9
  vm.topage = false
6
10
 
7
- const updateTransform = (translateY, height) => {
8
- vm.transition = 'transform 0.5s ease, height 0.5s 0.5s ease'
9
- vm.translateY = translateY
10
- vm.height = height
11
+ const updateTransform = (height) => {
12
+ vm.style.transition = 'transform 0.5s ease, height 0.5s 0.5s ease'
13
+ vm.style.transform = `translateY(${height})`
14
+ vm.style['--notificationYOffset'] = height
15
+ vm.style.height = `calc(100vh - ${height})`
11
16
  $timeout(() => {
12
- vm.transition = 'none'
17
+ vm.style.transition = 'none'
13
18
  }, 1100)
14
19
  }
15
20
 
@@ -28,10 +33,7 @@ const controller = function ($scope, hotkeys, $timeout, MbgNotification) {
28
33
  MbgNotification.registerContentCallback(updateTransform)
29
34
  const countFixedNotification = MbgNotification.getFixedOpened()
30
35
  if (countFixedNotification > 0) {
31
- updateTransform(
32
- `translateY(${50 * countFixedNotification}px)`,
33
- `calc(100vh - ${50 * countFixedNotification}px)`,
34
- )
36
+ updateTransform(`${50 * countFixedNotification}px`)
35
37
  }
36
38
  }
37
39
  }
@@ -1,6 +1,6 @@
1
1
  <div class="mb"
2
2
  base
3
3
  ng-transclude
4
- ng-style="{'transform': vm.translateY, 'height': vm.height || '100vh', 'transition': vm.transition}"
4
+ ng-style="vm.style"
5
5
  ng-class="[vm.config.theme, { 'mobiage-base-topage-enter' : vm.topage }]">
6
6
  </div>
@@ -46,7 +46,7 @@ const controller = function ($timeout, MbgNotification, $element) {
46
46
  const translateX = 'translateX(0%)';
47
47
  vm.zIndex = 23700 - notifCount;
48
48
  vm.containerTransform = `${translateX} ${translateY}`;
49
- MbgNotification.updateContentTransform(`translateY(${(notifCount) * vm.notifHeight.fixed}px)`, `calc(100vh - ${(notifCount) * vm.notifHeight.fixed}px)`);
49
+ MbgNotification.updateContentTransform(`${(notifCount) * vm.notifHeight.fixed}px`, `calc(100vh - ${(notifCount) * vm.notifHeight.fixed}px)`);
50
50
  if (config.duration && config.duration !== 'fixed') {
51
51
  const durationWait = $timeout(() => {
52
52
  MbgNotification.closeFixedNotif(config.id);
@@ -119,7 +119,7 @@ const controller = function ($timeout, MbgNotification, $element) {
119
119
  const element = $element;
120
120
  switch (config.variation) {
121
121
  case 'fixed': {
122
- MbgNotification.updateContentTransform(`translateY(${vm.notifHeight.fixed * MbgNotification.fixedNotifBuffer.length}px)`, `calc(100vh - ${vm.notifHeight.fixed * MbgNotification.fixedNotifBuffer.length}px)`);
122
+ MbgNotification.updateContentTransform(`${vm.notifHeight.fixed * MbgNotification.fixedNotifBuffer.length}px`, `calc(100vh - ${vm.notifHeight.fixed * MbgNotification.fixedNotifBuffer.length}px)`);
123
123
  break;
124
124
  }
125
125
  default: {
@@ -161,4 +161,4 @@ const controller = function ($timeout, MbgNotification, $element) {
161
161
  };
162
162
  };
163
163
 
164
- export default controller;
164
+ export default controller;