@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
|
@@ -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
|
-
|
|
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.
|
|
241
|
-
|
|
242
|
-
|
|
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.
|
|
293
|
-
: this.
|
|
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"
|
|
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"
|
|
8
|
-
|
|
9
|
-
|
|
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"
|
|
15
|
-
|
|
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"
|
|
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 }}"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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>
|
|
32
|
-
<mbg-input-text capitalize="true"
|
|
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"
|
|
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"
|
|
64
|
+
<div class="col-md-6"
|
|
65
|
+
ng-if="!$ctrl.EX">
|
|
45
66
|
<label>Estado</label>
|
|
46
|
-
<mbg-select capitalize="true"
|
|
47
|
-
|
|
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"
|
|
74
|
+
<div class="col-md-6"
|
|
75
|
+
ng-if="$ctrl.EX">
|
|
50
76
|
<label>Estado</label>
|
|
51
|
-
<mbg-input-text capitalize="true"
|
|
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"
|
|
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"
|
|
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"
|
|
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"
|
|
74
|
-
|
|
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>
|