@kigi/components 1.17.0-beta.2 → 1.17.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.17.0-beta.2",
3
+ "version": "1.17.0-beta.3",
4
4
  "description": "@kigi/components",
5
5
  "main": "src/components/index.ts",
6
6
  "scripts": {
@@ -38,12 +38,12 @@ 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
@@ -116,9 +116,9 @@ class MbgAddressManualController {
116
116
  this.entity = {
117
117
  zipCode: this.entity.zipCode.replace('-', ''),
118
118
  neighbourhood: response.data.bairro ? response.data.bairro.trim() : 'Centro',
119
- localization: this.entity.localization
120
- ? this.entity.localization
121
- : (response.data.localidade || '').trim(),
119
+ localization: response.data.localidade
120
+ ? (response.data.localidade || '').trim()
121
+ : this.entity.localization,
122
122
  premisse: premisse || 'CEP Único',
123
123
  number: this.entity.number || '',
124
124
  information: this.entity.information || '',
@@ -148,8 +148,9 @@ class MbgAddressManualController {
148
148
  )
149
149
  }
150
150
 
151
+
151
152
  loadStates = () => {
152
- this.$http.get(`https://servicodados.ibge.gov.br/api/v1/localidades/estados`).then((resp) => {
153
+ return this.$http.get(`https://servicodados.ibge.gov.br/api/v1/localidades/estados`).then((resp) => {
153
154
  this.states = resp.data.map((city) => {
154
155
  return {
155
156
  id: city.id,
@@ -79,7 +79,7 @@ class MbgMultiSelectController {
79
79
  this.verifyScroll()
80
80
  this.$timeout(() => delete this.searchModel)
81
81
  if (this.ngChange) {
82
- this.ngChange({ value: item })
82
+ this.ngChange()
83
83
  }
84
84
  }
85
85
  })
@@ -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
- await this.updateModelValue(this.ngValue ? item[this.ngValue] : item)
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
  }