@kigi/components 1.16.0-beta.3 → 1.17.0
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,10 +236,13 @@ class MbgAddressController {
|
|
|
236
236
|
|
|
237
237
|
createFullName() {
|
|
238
238
|
if (this.address.premisse) {
|
|
239
|
-
this.fullAddress = `${
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
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}`
|
|
243
246
|
}
|
|
244
247
|
}
|
|
245
248
|
|
|
@@ -286,8 +289,8 @@ class MbgAddressController {
|
|
|
286
289
|
countryCode: this.ngModel.countryCode,
|
|
287
290
|
zipCode: this.address.zipCode ? this.address.zipCode : this.ngModel.zipCode.replace('-', ''),
|
|
288
291
|
neighbourhood: this.address.neighbourhood
|
|
289
|
-
? this.
|
|
290
|
-
: this.
|
|
292
|
+
? this.address.neighbourhood
|
|
293
|
+
: this.ngModel.neighbourhood,
|
|
291
294
|
localization: this.ngModel.localization,
|
|
292
295
|
premisse: this.address.premisse
|
|
293
296
|
? this.address.premisse
|
|
@@ -572,7 +575,6 @@ class MbgAddressController {
|
|
|
572
575
|
response.zipCode = response.zipCode || ''
|
|
573
576
|
this.address.country = response.country || 'Brasil'
|
|
574
577
|
this.address.premisse = response.premisse || this.address.premisse
|
|
575
|
-
this.address.neighbourhood = response.neighbourhood || 'Centro'
|
|
576
578
|
this.ngModel = response
|
|
577
579
|
if (!EX) {
|
|
578
580
|
this.$timeout(() => this.searchAddressInfo(JSON.parse(JSON.stringify(response))))
|
|
@@ -1,112 +1,76 @@
|
|
|
1
1
|
<div class="mbg-address-manual-wrapper">
|
|
2
2
|
|
|
3
3
|
<form name="manualAddress">
|
|
4
|
-
<div class="row"
|
|
5
|
-
ng-if="$ctrl.EX">
|
|
4
|
+
<div class="row" ng-if="$ctrl.EX">
|
|
6
5
|
<div class="col-md-6">
|
|
7
6
|
<label>País</label>
|
|
8
|
-
<mbg-select ng-model="$ctrl.entity.country"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
on-select="$ctrl.selectCountry(value)"
|
|
12
|
-
on-unselect="$ctrl.unselectCountry()"
|
|
13
|
-
label="label"
|
|
14
|
-
ng-value="label"
|
|
15
|
-
fetch="$ctrl.countries"></mbg-select>
|
|
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>
|
|
16
10
|
</div>
|
|
17
11
|
<div class="col-md-6">
|
|
18
12
|
<label>CEP</label>
|
|
19
13
|
<div class="mbg-input-wrapper input-cep-wrapper">
|
|
20
|
-
<input type="text"
|
|
21
|
-
|
|
22
|
-
ng-change="$ctrl.validateLenth($event)"
|
|
23
|
-
placeholder="99999" />
|
|
14
|
+
<input type="text" ng-model="$ctrl.entity.zipCode" ng-change="$ctrl.validateLenth($event)"
|
|
15
|
+
placeholder="99999" />
|
|
24
16
|
</div>
|
|
25
17
|
</div>
|
|
26
18
|
</div>
|
|
27
19
|
<div class="row">
|
|
28
|
-
<div class="col-md-4"
|
|
29
|
-
ng-if="!$ctrl.EX">
|
|
20
|
+
<div class="col-md-4" ng-if="!$ctrl.EX">
|
|
30
21
|
<label>CEP</label>
|
|
31
22
|
<div class="mbg-input-wrapper input-cep-wrapper">
|
|
32
|
-
<input autocomplete="{{ $ctrl.autocompleteValue }}"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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 />
|
|
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 />
|
|
44
28
|
</div>
|
|
45
29
|
</div>
|
|
46
30
|
<div ng-class="$ctrl.EX ? 'col-md-12' : 'col-md-8'">
|
|
47
|
-
<label>
|
|
48
|
-
<mbg-input-text capitalize="true"
|
|
49
|
-
ng-model="$ctrl.entity.premisse"
|
|
50
|
-
placeholder="Ex. Av Duque de Caxias">
|
|
31
|
+
<label>Logradouro</label>
|
|
32
|
+
<mbg-input-text capitalize="true" ng-model="$ctrl.entity.premisse" placeholder="Ex. Av Duque de Caxias">
|
|
51
33
|
</mbg-input-text>
|
|
52
34
|
</div>
|
|
53
35
|
</div>
|
|
54
36
|
<div class="row">
|
|
55
37
|
<div class="col-md-12">
|
|
56
38
|
<label>Bairro</label>
|
|
57
|
-
<mbg-input-text capitalize="true"
|
|
58
|
-
ng-model="$ctrl.entity.neighbourhood"
|
|
59
|
-
placeholder="Ex. Jardim América">
|
|
39
|
+
<mbg-input-text capitalize="true" ng-model="$ctrl.entity.neighbourhood" placeholder="Ex. Jardim América">
|
|
60
40
|
</mbg-input-text>
|
|
61
41
|
</div>
|
|
62
42
|
</div>
|
|
63
43
|
<div class="row">
|
|
64
|
-
<div class="col-md-6"
|
|
65
|
-
ng-if="!$ctrl.EX">
|
|
44
|
+
<div class="col-md-6" ng-if="!$ctrl.EX">
|
|
66
45
|
<label>Estado</label>
|
|
67
|
-
<mbg-select capitalize="true"
|
|
68
|
-
|
|
69
|
-
fetch="$ctrl.searchState(query)"
|
|
70
|
-
label="name"
|
|
71
|
-
ng-value="shortName"
|
|
72
|
-
placeholder="Ex. Paraná"></mbg-select>
|
|
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>
|
|
73
48
|
</div>
|
|
74
|
-
<div class="col-md-6"
|
|
75
|
-
ng-if="$ctrl.EX">
|
|
49
|
+
<div class="col-md-6" ng-if="$ctrl.EX">
|
|
76
50
|
<label>Estado</label>
|
|
77
|
-
<mbg-input-text capitalize="true"
|
|
78
|
-
ng-model="$ctrl.entity.state"
|
|
79
|
-
placeholder="Ex. Maringá"></mbg-input-text>
|
|
51
|
+
<mbg-input-text capitalize="true" ng-model="$ctrl.entity.state" placeholder="Ex. Maringá"></mbg-input-text>
|
|
80
52
|
</div>
|
|
81
53
|
<div class="col-md-6">
|
|
82
54
|
<label>Cidade</label>
|
|
83
|
-
<mbg-input-text capitalize="true"
|
|
84
|
-
ng-model="$ctrl.entity.localization"
|
|
85
|
-
placeholder="Ex. Maringá">
|
|
55
|
+
<mbg-input-text capitalize="true" ng-model="$ctrl.entity.localization" placeholder="Ex. Maringá">
|
|
86
56
|
</mbg-input-text>
|
|
87
57
|
</div>
|
|
88
58
|
</div>
|
|
89
59
|
<div class="row">
|
|
90
60
|
<div class="col-md-4">
|
|
91
61
|
<label>Número</label>
|
|
92
|
-
<mbg-input-text ng-model="$ctrl.entity.number"
|
|
93
|
-
placeholder="Ex. 36"></mbg-input-text>
|
|
62
|
+
<mbg-input-text ng-model="$ctrl.entity.number" placeholder="Ex. 36"></mbg-input-text>
|
|
94
63
|
</div>
|
|
95
64
|
<div class="col-md-8">
|
|
96
65
|
<label>Complemento</label>
|
|
97
|
-
<mbg-input-text capitalize="true"
|
|
98
|
-
ng-model="$ctrl.entity.information"
|
|
99
|
-
placeholder="Ex. Restaurante X">
|
|
66
|
+
<mbg-input-text capitalize="true" ng-model="$ctrl.entity.information" placeholder="Ex. Restaurante X">
|
|
100
67
|
</mbg-input-text>
|
|
101
68
|
</div>
|
|
102
69
|
</div>
|
|
103
70
|
</form>
|
|
104
71
|
|
|
105
72
|
<div class="content-confirm-upload">
|
|
106
|
-
<mbg-btn-form label="Salvar"
|
|
107
|
-
|
|
108
|
-
ng-click="$ctrl.finish(manualAddress.$valid)"></mbg-btn-form>
|
|
109
|
-
<a class="btn-cancel"
|
|
110
|
-
ng-click="$ctrl.dismiss()">Cancelar</a>
|
|
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>
|
|
111
75
|
</div>
|
|
112
76
|
</div>
|