@sgcloud-sgsistemas/base 1.3.8 → 1.3.9

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.3.8",
3
+ "version": "1.3.9",
4
4
  "description": "Base para os sistemas da mobiage",
5
5
  "repository": {
6
6
  "type": "private",
@@ -10,6 +10,12 @@ const controller = ($scope, CashierService, $state) => {
10
10
  $scope.setting.openState();
11
11
  }
12
12
  };
13
+ $scope.switchCashier = (event) => {
14
+ event.stopPropagation();
15
+ if ($scope.setting.switchState) {
16
+ $scope.setting.switchState();
17
+ }
18
+ };
13
19
  $scope.cashierIsEmpty = () => angular.equals($scope.setting, {});
14
20
  CashierService.registerCashier($scope.updateComponent);
15
21
  };
@@ -76,4 +76,36 @@
76
76
  width: 260px;
77
77
  }
78
78
  }
79
+
80
+ .mb-bt-switch-cashier {
81
+ display: flex;
82
+ align-items: center;
83
+ justify-content: center;
84
+ width: 32px;
85
+ min-width: 32px;
86
+ height: 38px;
87
+ padding: 0;
88
+ border: 0;
89
+ border-left: 1px solid rgba(255, 255, 255, .45);
90
+ border-radius: 0 6px 6px 0;
91
+ background-color: var(--secondary);
92
+ color: #fff;
93
+ font-size: 12px;
94
+ cursor: pointer;
95
+ transform: translateY(55%);
96
+
97
+ &:hover {
98
+ filter: brightness(0.92);
99
+ }
100
+
101
+ &:focus {
102
+ background-color: var(--secondary);
103
+ outline: none;
104
+ }
105
+
106
+ &:focus-visible {
107
+ outline: 2px solid rgba(255, 255, 255, .85);
108
+ outline-offset: 2px;
109
+ }
110
+ }
79
111
  }
@@ -1,6 +1,6 @@
1
1
  <div class="mb"
2
2
  tabindex="-1"
3
- ng-class="{'active' : setting.open}"
3
+ ng-class="{'active' : setting.open, 'has-switch-cashier': $ctrl.showSwitch && setting.open}"
4
4
  ng-style="setting.open && $ctrl.activeColor && {'background-color': $ctrl.activeColor }"
5
5
  cashier>
6
6
  <div class="mb-bt-cashier"
@@ -29,4 +29,14 @@
29
29
  </span>
30
30
  </div>
31
31
  </div>
32
+ <button type="button"
33
+ class="mb-bt-switch-cashier"
34
+ ng-show="$ctrl.showSwitch && setting.open"
35
+ ng-click="switchCashier($event)"
36
+ aria-label="Trocar de caixa"
37
+ uib-tooltip="Selecionar novo caixa"
38
+ tooltip-append-to-body="true"
39
+ tooltip-placement="bottom">
40
+ <i class="fas fa-exchange-alt" aria-hidden="true"></i>
41
+ </button>
32
42
  </div>
@@ -5,7 +5,8 @@ import './cashier.styles.scss';
5
5
  const component = {
6
6
  bindings: {
7
7
  config: '=',
8
- activeColor: '@?'
8
+ activeColor: '@?',
9
+ showSwitch: '<?'
9
10
  },
10
11
  template,
11
12
  controller
@@ -9,7 +9,7 @@
9
9
  padding-right: 15px;
10
10
  position: relative;
11
11
  z-index: 510;
12
- border-radius: 34px;
12
+ border-radius: 6px;
13
13
  border: none;
14
14
  padding-left: 10px;
15
15
  display: flex;
@@ -167,6 +167,19 @@
167
167
 
168
168
  > .mb-t-cashier{
169
169
  padding: 0px;
170
+
171
+ mb-cashier .mb[cashier] {
172
+ .mb-bt-cashier {
173
+ margin: 0;
174
+ border-radius: 6px;
175
+ }
176
+ }
177
+
178
+ mb-cashier .mb[cashier].has-switch-cashier {
179
+ .mb-bt-cashier {
180
+ border-radius: 6px 0 0 6px;
181
+ }
182
+ }
170
183
  }
171
184
 
172
185
  > .mb-t-notifications-container {
@@ -50,7 +50,8 @@
50
50
  <div class="mb-t-cashier" tabindex="-1">
51
51
  <mb-cashier config="vm.config.user"
52
52
  tabindex="-1"
53
- ng-if="!vm.config.hideCashier"></mb-cashier>
53
+ ng-if="!vm.config.hideCashier"
54
+ show-switch="true"></mb-cashier>
54
55
  </div>
55
56
 
56
57
  <div class="mb-price-check"