@kigi/components 1.18.0-beta.2 → 1.18.0-beta.3

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.18.0-beta.2",
3
+ "version": "1.18.0-beta.3",
4
4
  "description": "@kigi/components",
5
5
  "main": "src/components/index.ts",
6
6
  "scripts": {
@@ -50,7 +50,7 @@ class MbgAddressController {
50
50
  public $timeout,
51
51
  public mbgAddressService: MbgAddressService,
52
52
  public $uibModal,
53
- ) {}
53
+ ) { }
54
54
 
55
55
  $onInit() {
56
56
  if (this.capitalize && this.address) {
@@ -93,8 +93,8 @@ class MbgAddressController {
93
93
  state: this.address.state
94
94
  ? this.address.state
95
95
  : this.address.uf && this.address.uf.initial
96
- ? this.address.uf.initial
97
- : '',
96
+ ? this.address.uf.initial
97
+ : '',
98
98
  }
99
99
  if (this.ngModel) {
100
100
  this.ngModel.EX = (this.ngModel.country || '').toLowerCase() !== 'brasil'
@@ -236,13 +236,10 @@ class MbgAddressController {
236
236
 
237
237
  createFullName() {
238
238
  if (this.address.premisse) {
239
- this.fullAddress = `${
240
- this.address.premisse ? this.address.premisse : this.ngModel.premisse
241
- } - ${
242
- this.address.neighbourhood ? this.address.neighbourhood : this.ngModel.neighbourhood
243
- }, ${this.address.localization ? this.address.localization : this.ngModel.localization} - ${
244
- this.ngModel.state
245
- }, ${this.ngModel.country}`
239
+ this.fullAddress = `${this.address.premisse ? this.address.premisse : this.ngModel.premisse
240
+ } - ${this.address.neighbourhood ? this.address.neighbourhood : this.ngModel.neighbourhood
241
+ }, ${this.address.localization ? this.address.localization : this.ngModel.localization} - ${this.ngModel.state
242
+ }, ${this.ngModel.country}`
246
243
  }
247
244
  }
248
245
 
@@ -289,8 +286,8 @@ class MbgAddressController {
289
286
  countryCode: this.ngModel.countryCode,
290
287
  zipCode: this.address.zipCode ? this.address.zipCode : this.ngModel.zipCode.replace('-', ''),
291
288
  neighbourhood: this.address.neighbourhood
292
- ? this.address.neighbourhood
293
- : this.ngModel.neighbourhood,
289
+ ? this.ngModel.neighbourhood
290
+ : this.address.neighbourhood,
294
291
  localization: this.ngModel.localization,
295
292
  premisse: this.address.premisse
296
293
  ? this.address.premisse
@@ -575,6 +572,7 @@ class MbgAddressController {
575
572
  response.zipCode = response.zipCode || ''
576
573
  this.address.country = response.country || 'Brasil'
577
574
  this.address.premisse = response.premisse || this.address.premisse
575
+ this.address.neighbourhood = response.neighbourhood || 'Centro'
578
576
  this.ngModel = response
579
577
  if (!EX) {
580
578
  this.$timeout(() => this.searchAddressInfo(JSON.parse(JSON.stringify(response))))
@@ -1,76 +1,112 @@
1
1
  <div class="mbg-address-manual-wrapper">
2
2
 
3
3
  <form name="manualAddress">
4
- <div class="row" ng-if="$ctrl.EX">
4
+ <div class="row"
5
+ ng-if="$ctrl.EX">
5
6
  <div class="col-md-6">
6
7
  <label>País</label>
7
- <mbg-select ng-model="$ctrl.entity.country" placeholder="Brasil" ng-if="$ctrl.countries"
8
- on-select="$ctrl.selectCountry(value)" on-unselect="$ctrl.unselectCountry()" label="label" ng-value="label"
9
- fetch="$ctrl.countries"></mbg-select>
8
+ <mbg-select ng-model="$ctrl.entity.country"
9
+ placeholder="Brasil"
10
+ ng-if="$ctrl.countries"
11
+ on-select="$ctrl.selectCountry(value)"
12
+ on-unselect="$ctrl.unselectCountry()"
13
+ label="label"
14
+ ng-value="label"
15
+ fetch="$ctrl.countries"></mbg-select>
10
16
  </div>
11
17
  <div class="col-md-6">
12
18
  <label>CEP</label>
13
19
  <div class="mbg-input-wrapper input-cep-wrapper">
14
- <input type="text" ng-model="$ctrl.entity.zipCode" ng-change="$ctrl.validateLenth($event)"
15
- placeholder="99999" />
20
+ <input type="text"
21
+ ng-model="$ctrl.entity.zipCode"
22
+ ng-change="$ctrl.validateLenth($event)"
23
+ placeholder="99999" />
16
24
  </div>
17
25
  </div>
18
26
  </div>
19
27
  <div class="row">
20
- <div class="col-md-4" ng-if="!$ctrl.EX">
28
+ <div class="col-md-4"
29
+ ng-if="!$ctrl.EX">
21
30
  <label>CEP</label>
22
31
  <div class="mbg-input-wrapper input-cep-wrapper">
23
- <input autocomplete="{{ $ctrl.autocompleteValue }}" autocorrect="{{ $ctrl.autocompleteValue }}"
24
- ng-class="{'mbg-error': (!$ctrl.entity.zipCode && $ctrl.inputErrors) || $ctrl.notFoundCep}"
25
- mbg-error="!$ctrl.entity.zipCode || $ctrl.notFoundCep" mbg-error-when="$ctrl.inputErrors"
26
- mbg-error-message="É necessário informar o CEP" spellcheck="false" type="text"
27
- ng-change="$ctrl.onChangeCep()" ng-model="$ctrl.entity.zipCode" placeholder="99999-999" ui-br-cep-mask />
32
+ <input autocomplete="{{ $ctrl.autocompleteValue }}"
33
+ autocorrect="{{ $ctrl.autocompleteValue }}"
34
+ ng-class="{'mbg-error': (!$ctrl.entity.zipCode && $ctrl.inputErrors) || $ctrl.notFoundCep}"
35
+ mbg-error="!$ctrl.entity.zipCode || $ctrl.notFoundCep"
36
+ mbg-error-when="$ctrl.inputErrors"
37
+ mbg-error-message="É necessário informar o CEP"
38
+ spellcheck="false"
39
+ type="text"
40
+ ng-change="$ctrl.onChangeCep()"
41
+ ng-model="$ctrl.entity.zipCode"
42
+ placeholder="99999-999"
43
+ ui-br-cep-mask />
28
44
  </div>
29
45
  </div>
30
46
  <div ng-class="$ctrl.EX ? 'col-md-12' : 'col-md-8'">
31
- <label>Logradouro</label>
32
- <mbg-input-text capitalize="true" ng-model="$ctrl.entity.premisse" placeholder="Ex. Av Duque de Caxias">
47
+ <label>Logradouros</label>
48
+ <mbg-input-text capitalize="true"
49
+ ng-model="$ctrl.entity.premisse"
50
+ placeholder="Ex. Av Duque de Caxias">
33
51
  </mbg-input-text>
34
52
  </div>
35
53
  </div>
36
54
  <div class="row">
37
55
  <div class="col-md-12">
38
56
  <label>Bairro</label>
39
- <mbg-input-text capitalize="true" ng-model="$ctrl.entity.neighbourhood" placeholder="Ex. Jardim América">
57
+ <mbg-input-text capitalize="true"
58
+ ng-model="$ctrl.entity.neighbourhood"
59
+ placeholder="Ex. Jardim América">
40
60
  </mbg-input-text>
41
61
  </div>
42
62
  </div>
43
63
  <div class="row">
44
- <div class="col-md-6" ng-if="!$ctrl.EX">
64
+ <div class="col-md-6"
65
+ ng-if="!$ctrl.EX">
45
66
  <label>Estado</label>
46
- <mbg-select capitalize="true" ng-model="$ctrl.entity.state" fetch="$ctrl.searchState(query)" label="name"
47
- ng-value="shortName" placeholder="Ex. Paraná"></mbg-select>
67
+ <mbg-select capitalize="true"
68
+ ng-model="$ctrl.entity.state"
69
+ fetch="$ctrl.searchState(query)"
70
+ label="name"
71
+ ng-value="shortName"
72
+ placeholder="Ex. Paraná"></mbg-select>
48
73
  </div>
49
- <div class="col-md-6" ng-if="$ctrl.EX">
74
+ <div class="col-md-6"
75
+ ng-if="$ctrl.EX">
50
76
  <label>Estado</label>
51
- <mbg-input-text capitalize="true" ng-model="$ctrl.entity.state" placeholder="Ex. Maringá"></mbg-input-text>
77
+ <mbg-input-text capitalize="true"
78
+ ng-model="$ctrl.entity.state"
79
+ placeholder="Ex. Maringá"></mbg-input-text>
52
80
  </div>
53
81
  <div class="col-md-6">
54
82
  <label>Cidade</label>
55
- <mbg-input-text capitalize="true" ng-model="$ctrl.entity.localization" placeholder="Ex. Maringá">
83
+ <mbg-input-text capitalize="true"
84
+ ng-model="$ctrl.entity.localization"
85
+ placeholder="Ex. Maringá">
56
86
  </mbg-input-text>
57
87
  </div>
58
88
  </div>
59
89
  <div class="row">
60
90
  <div class="col-md-4">
61
91
  <label>Número</label>
62
- <mbg-input-text ng-model="$ctrl.entity.number" placeholder="Ex. 36"></mbg-input-text>
92
+ <mbg-input-text ng-model="$ctrl.entity.number"
93
+ placeholder="Ex. 36"></mbg-input-text>
63
94
  </div>
64
95
  <div class="col-md-8">
65
96
  <label>Complemento</label>
66
- <mbg-input-text capitalize="true" ng-model="$ctrl.entity.information" placeholder="Ex. Restaurante X">
97
+ <mbg-input-text capitalize="true"
98
+ ng-model="$ctrl.entity.information"
99
+ placeholder="Ex. Restaurante X">
67
100
  </mbg-input-text>
68
101
  </div>
69
102
  </div>
70
103
  </form>
71
104
 
72
105
  <div class="content-confirm-upload">
73
- <mbg-btn-form label="Salvar" loading="$ctrl.loading" ng-click="$ctrl.finish(manualAddress.$valid)"></mbg-btn-form>
74
- <a class="btn-cancel" ng-click="$ctrl.dismiss()">Cancelar</a>
106
+ <mbg-btn-form label="Salvar"
107
+ loading="$ctrl.loading"
108
+ ng-click="$ctrl.finish(manualAddress.$valid)"></mbg-btn-form>
109
+ <a class="btn-cancel"
110
+ ng-click="$ctrl.dismiss()">Cancelar</a>
75
111
  </div>
76
112
  </div>
@@ -38,7 +38,7 @@ class MbgAddressManualController {
38
38
  public EX,
39
39
  public notFound,
40
40
  public address,
41
- ) {}
41
+ ) { }
42
42
 
43
43
  $onInit() {
44
44
  this.navigatorData = detect()
@@ -1,5 +1,5 @@
1
1
  <div class="mbg-multi-select-wrapper">
2
- <span ng-if="$ctrl.showScrollArrows" class="arrow-left" ng-click="$ctrl.scrollToLeft()">
2
+ <span ng-if="$ctrl.showScrollArrows" class="arrow-left visibility" ng-click="$ctrl.scrollToLeft()">
3
3
  <i class="fas fa-chevron-circle-left"></i>
4
4
  </span>
5
5
  <div class="mbg-multi-select-scroll"
@@ -37,7 +37,7 @@
37
37
  label="{{ $ctrl.label }}"></mbg-select>
38
38
  </div>
39
39
  </div>
40
- <span ng-if="$ctrl.showScrollArrows" class="arrow-right" ng-click="$ctrl.scrollToRight()">
40
+ <span ng-if="$ctrl.showScrollArrows" class="arrow-right visibility" ng-click="$ctrl.scrollToRight()">
41
41
  <i class="fas fa-chevron-circle-right"></i>
42
42
  </span>
43
43
  </div>
@@ -9,8 +9,6 @@
9
9
  position: absolute;
10
10
  font-size: 20px;
11
11
 
12
- z-index: 10;
13
-
14
12
  background: white;
15
13
  overflow: hidden;
16
14
  height: 20px;
@@ -23,28 +21,22 @@
23
21
  }
24
22
  }
25
23
 
26
- .arrow-left {
27
- left: 0px;
28
- transition: transform .5s;
29
- transform: translateX(-40px);
30
- }
31
-
32
- .arrow-right {
33
- right: 0px;
34
- transition: transform .5s;
35
- transform: translateX(40px);
24
+ .visibility {
25
+ display: none;
36
26
  }
37
-
38
27
 
39
28
  &:hover {
40
- .arrow-left {
41
- transition: transform .3s;
42
- transform: translateX(8px);
43
- }
44
- .arrow-right {
45
- transition: transform .3s;
46
- transform: translateX(-8px);
47
- }
29
+ .visibility {
30
+ display: block;
31
+ }
32
+ }
33
+
34
+ .arrow-left {
35
+ left: 8px;
36
+ }
37
+
38
+ .arrow-right {
39
+ right: 8px;
48
40
  }
49
41
 
50
42
  .mbg-multi-select-scroll {
@@ -22,8 +22,6 @@ class MbgMultiSelectController {
22
22
  private enableFavorite: boolean
23
23
  private stepScrollSize: any
24
24
  private showScrollArrows: boolean
25
- private onRemoveItem: Function
26
- private index
27
25
 
28
26
  constructor(public $scope, public $element, public $attrs, public $timeout) {}
29
27
 
@@ -32,8 +30,6 @@ class MbgMultiSelectController {
32
30
  this.stepScrollSize = 200
33
31
  }
34
32
 
35
- this.index = this.index || 0
36
-
37
33
  this.widthEllipsis = this.widthEllipsis || '154px'
38
34
  this.$scope.$watch(
39
35
  '$ctrl.ngModel',
@@ -57,7 +53,7 @@ class MbgMultiSelectController {
57
53
 
58
54
  verifyScroll() {
59
55
  this.$timeout(() => {
60
- const elm = angular.element(`.mbg-multi-select-scroll`)[this.index]
56
+ const elm = angular.element(`.mbg-multi-select-scroll`)[0]
61
57
  this.$timeout(() => {
62
58
  ScrollAnimate.scrollLeftTo(elm, elm.scrollWidth, 350)
63
59
  }, 100)
@@ -66,7 +62,7 @@ class MbgMultiSelectController {
66
62
 
67
63
  scrollToLeft() {
68
64
  this.$timeout(() => {
69
- const elm: Element = angular.element(`.mbg-multi-select-scroll`)[this.index]
65
+ const elm: Element = angular.element(`.mbg-multi-select-scroll`)[0]
70
66
  this.$timeout(() => {
71
67
  const value = +elm.scrollLeft - this.stepScrollSize
72
68
  elm.scroll({
@@ -79,7 +75,8 @@ class MbgMultiSelectController {
79
75
 
80
76
  scrollToRight() {
81
77
  this.$timeout(() => {
82
- const elm = angular.element(`.mbg-multi-select-scroll`)[this.index]
78
+ const elm = angular.element(`.mbg-multi-select-scroll`)[0]
79
+
83
80
  this.$timeout(() => {
84
81
  const value = +elm.scrollLeft + this.stepScrollSize
85
82
  elm.scroll({
@@ -122,8 +119,6 @@ class MbgMultiSelectController {
122
119
  }
123
120
 
124
121
  remoteItem(index) {
125
- const item = this.ngModel[index]
126
-
127
122
  this.ngModel.splice(index, 1)
128
123
  this.verifyScroll()
129
124
  this.$timeout(() => {
@@ -131,10 +126,6 @@ class MbgMultiSelectController {
131
126
  this.ngChange()
132
127
  }
133
128
  })
134
-
135
- if (this.onRemoveItem) {
136
- this.onRemoveItem({ item, index })
137
- }
138
129
  }
139
130
 
140
131
  stopDragEvents() {
@@ -288,8 +279,6 @@ const mbgMultiSelect = {
288
279
  enableFavorite: '=?',
289
280
  stepScrollSize: '=?',
290
281
  showScrollArrows: '=?',
291
- onRemoveItem: '&?',
292
- index: '=?',
293
282
  },
294
283
  template,
295
284
  controller: MbgMultiSelectController,