@kigi/components 1.16.0-beta.2 → 1.16.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.16.0-beta.2",
3
+ "version": "1.16.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()