@kigi/components 1.4.4 → 1.4.8

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": "@kigi/components",
3
- "version": "1.4.4",
3
+ "version": "1.4.8",
4
4
  "description": "@kigi/components",
5
5
  "main": "src/components/index.ts",
6
6
  "scripts": {
@@ -31,6 +31,10 @@
31
31
  <div class="mbg-input-wrapper input-cep-wrapper">
32
32
  <input autocomplete="{{ $ctrl.autocompleteValue }}"
33
33
  autocorrect="{{ $ctrl.autocompleteValue }}"
34
+ ng-class="{'mbg-error': !$ctrl.entity.zipCode && $ctrl.inputErrors}"
35
+ mbg-error="!$ctrl.entity.zipCode"
36
+ mbg-error-when="$ctrl.inputErrors"
37
+ mbg-error-message="É necessário informar o CEP"
34
38
  spellcheck="false"
35
39
  type="text"
36
40
  ng-change="$ctrl.onChangeCep()"
@@ -91,7 +95,7 @@
91
95
  <div class="content-confirm-upload">
92
96
  <mbg-btn-form label="Salvar"
93
97
  loading="$ctrl.loading"
94
- ng-click="$ctrl.finish()"></mbg-btn-form>
98
+ ng-click="$ctrl.finish(manualAddress.$valid)"></mbg-btn-form>
95
99
  <a class="btn-cancel"
96
100
  ng-click="$ctrl.dismiss()">Cancelar</a>
97
101
  </div>
@@ -26,6 +26,7 @@ class MbgAddressManualController {
26
26
  public navigatorData
27
27
  public entity: any = {}
28
28
  public countries: any[]
29
+ public inputErrors: boolean = false
29
30
 
30
31
  constructor(
31
32
  public $scope,
@@ -149,7 +150,11 @@ class MbgAddressManualController {
149
150
  })
150
151
  }
151
152
 
152
- finish() {
153
+ finish(valid) {
154
+ this.inputErrors = true
155
+ if (!valid) {
156
+ return
157
+ }
153
158
  this.$uibModalInstance.close(this.entity)
154
159
  }
155
160
  }
@@ -72,7 +72,6 @@
72
72
  ng-model="$ctrl.gridValues[$index][$parent.$index].stock"
73
73
  placeholder="0"
74
74
  ng-keydown="$ctrl.onKeydown($event)"
75
- positive-number="true"
76
75
  ng-class="{ 'grid-disable': $ctrl.activeAddOrRemove && !$ctrl.gridValues[$index][$parent.$index].enable }"
77
76
  ng-change="$ctrl.handleGridValues()"
78
77
  ng-model-options="{ debounce: 500 }"
@@ -92,4 +91,4 @@
92
91
  </tr>
93
92
  </tbody>
94
93
  </table>
95
- </div>
94
+ </div>
@@ -53,7 +53,6 @@
53
53
  ng-model="item.stock"
54
54
  ng-keydown="$ctrl.onKeydown($event)"
55
55
  placeholder="0"
56
- positive-number="true"
57
56
  placeholder="Estoque"
58
57
  ng-model-options="{ debounce: 500 }"
59
58
  class="inline-product-stock" />
@@ -72,4 +71,4 @@
72
71
  </div>
73
72
  </div>
74
73
  </div>
75
- </div>
74
+ </div>
@@ -88,12 +88,17 @@
88
88
  <ul class="ul-options"
89
89
  vs-repeat="{size: {{$ctrl.transcludeSize || 'null'}}}">
90
90
  <li ng-mousedown="$ctrl.selectOption(item)"
91
+ class="mbg-item-select"
91
92
  ng-style="$ctrl.transcludeSize && {'min-height': $ctrl.transcludeSize}"
92
93
  ng-repeat="item in $ctrl.data">
93
94
  <div ng-if="$ctrl.transcludeTemplate"
94
95
  mbg-dynamic-html="$ctrl.transcludeTemplate"></div>
95
- <div ng-if="!$ctrl.transcludeTemplate && $ctrl.labelValue">{{item[$ctrl.labelValue]}}</div>
96
- <div ng-if="!$ctrl.transcludeTemplate && !$ctrl.labelValue">{{item}}</div>
96
+ <div ng-if="!$ctrl.transcludeTemplate && $ctrl.labelValue"><span
97
+ ng-class="{'mbg-item-animation': item[$ctrl.labelValue].length > 30}">{{item[$ctrl.labelValue]}}</span>
98
+ </div>
99
+ <div ng-if="!$ctrl.transcludeTemplate && !$ctrl.labelValue"><span
100
+ ng-class="{'mbg-item-animation': item.length > 30}">{{item}}</span>
101
+ </div>
97
102
  <i title="Favoritar"
98
103
  ng-if="$ctrl.enableFavorite"
99
104
  ng-mousedown="$ctrl.favorite($event, item)"
@@ -115,4 +120,4 @@
115
120
  </li>
116
121
  </ul>
117
122
  </div>
118
- </div>
123
+ </div>
@@ -1,5 +1,6 @@
1
1
  .mbg-select-wrapper {
2
2
  position: relative;
3
+
3
4
  .mbg-select-input-fake {
4
5
  border: 1px solid #ddd;
5
6
  background: #fff;
@@ -131,7 +132,8 @@
131
132
  transform: rotate(40deg);
132
133
  opacity: 0.4;
133
134
 
134
- &:hover, &.fixed {
135
+ &:hover,
136
+ &.fixed {
135
137
  transform: rotate(0deg);
136
138
  opacity: 1;
137
139
  }
@@ -170,3 +172,35 @@ mbg-select[disabled="disabled"] {
170
172
  font-weight: 500;
171
173
  }
172
174
  }
175
+
176
+ .mbg-item-select {
177
+ span.mbg-item-animation {
178
+ left: 0;
179
+ transition-delay: 1s;
180
+ }
181
+
182
+ &:hover {
183
+ text-overflow: initial;
184
+
185
+ span.mbg-item-animation {
186
+ display: inline-block;
187
+ position: relative;
188
+ animation: animation-select-label 5s infinite;
189
+ }
190
+ }
191
+ }
192
+
193
+ @keyframes animation-select-label {
194
+ 0% {
195
+ transform: translateX(0%);
196
+ }
197
+ 15% {
198
+ transform: translateX(0%);
199
+ }
200
+ 80% {
201
+ transform: translateX(-50%);
202
+ }
203
+ 100% {
204
+ transform: translateX(0%);
205
+ }
206
+ }