@kigi/components 1.17.0 → 1.17.1-beta.2
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
|
@@ -38,15 +38,16 @@ class MbgAddressManualController {
|
|
|
38
38
|
public EX,
|
|
39
39
|
public notFound,
|
|
40
40
|
public address,
|
|
41
|
-
) {}
|
|
41
|
+
) { }
|
|
42
42
|
|
|
43
|
-
$onInit() {
|
|
43
|
+
async $onInit() {
|
|
44
44
|
this.navigatorData = detect()
|
|
45
45
|
this.createAutocompleteDisabled()
|
|
46
|
-
this.loadStates()
|
|
46
|
+
await this.loadStates()
|
|
47
47
|
this.loadCountries()
|
|
48
48
|
if (this.address) {
|
|
49
49
|
this.entity = this.address
|
|
50
|
+
this.searchAddressByCEP()
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
|
|
@@ -116,9 +117,9 @@ class MbgAddressManualController {
|
|
|
116
117
|
this.entity = {
|
|
117
118
|
zipCode: this.entity.zipCode.replace('-', ''),
|
|
118
119
|
neighbourhood: response.data.bairro ? response.data.bairro.trim() : 'Centro',
|
|
119
|
-
localization:
|
|
120
|
-
?
|
|
121
|
-
:
|
|
120
|
+
localization: response.data.localidade
|
|
121
|
+
? (response.data.localidade || '').trim()
|
|
122
|
+
: this.entity.localization,
|
|
122
123
|
premisse: premisse || 'CEP Único',
|
|
123
124
|
number: this.entity.number || '',
|
|
124
125
|
information: this.entity.information || '',
|
|
@@ -148,8 +149,9 @@ class MbgAddressManualController {
|
|
|
148
149
|
)
|
|
149
150
|
}
|
|
150
151
|
|
|
152
|
+
|
|
151
153
|
loadStates = () => {
|
|
152
|
-
this.$http.get(`https://servicodados.ibge.gov.br/api/v1/localidades/estados`).then((resp) => {
|
|
154
|
+
return this.$http.get(`https://servicodados.ibge.gov.br/api/v1/localidades/estados`).then((resp) => {
|
|
153
155
|
this.states = resp.data.map((city) => {
|
|
154
156
|
return {
|
|
155
157
|
id: city.id,
|
|
@@ -56,7 +56,7 @@ class MbgSelectController {
|
|
|
56
56
|
public $timeout,
|
|
57
57
|
public $compile,
|
|
58
58
|
public $transclude,
|
|
59
|
-
) {}
|
|
59
|
+
) { }
|
|
60
60
|
|
|
61
61
|
$onInit() {
|
|
62
62
|
this.fixedValue = this.ngValue || 'id'
|
|
@@ -409,7 +409,8 @@ class MbgSelectController {
|
|
|
409
409
|
item = isNaN(this.inputValue) ? this.inputValue : Number(this.inputValue)
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
|
-
|
|
412
|
+
this.selectOption(item)
|
|
413
|
+
return
|
|
413
414
|
}
|
|
414
415
|
} else {
|
|
415
416
|
await this.updateModelValue(this.inputValue)
|
|
@@ -458,6 +459,7 @@ class MbgSelectController {
|
|
|
458
459
|
value &&
|
|
459
460
|
(!angular.equals(value, this.ngModel) || !angular.equals(value, this.inputValue))
|
|
460
461
|
) {
|
|
462
|
+
this.inputValue = ''
|
|
461
463
|
this.updateInputValue()
|
|
462
464
|
}
|
|
463
465
|
}
|