@kigi/components 1.4.9 → 1.5.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.4.9",
3
+ "version": "1.5.3",
4
4
  "description": "@kigi/components",
5
5
  "main": "src/components/index.ts",
6
6
  "scripts": {
@@ -534,6 +534,7 @@ class MbgAddressController {
534
534
  size: 'md',
535
535
  resolve: {
536
536
  EX,
537
+ notFound: () => this.notFound,
537
538
  },
538
539
  })
539
540
  modal.result.then((response) => {
@@ -31,8 +31,8 @@
31
31
  <div class="mbg-input-wrapper input-cep-wrapper">
32
32
  <input autocomplete="{{ $ctrl.autocompleteValue }}"
33
33
  autocorrect="{{ $ctrl.autocompleteValue }}"
34
- ng-class="{'mbg-error': !$ctrl.entity.zipCode && $ctrl.inputErrors}"
35
- mbg-error="!$ctrl.entity.zipCode"
34
+ ng-class="{'mbg-error': (!$ctrl.entity.zipCode && $ctrl.inputErrors) || $ctrl.notFoundCep}"
35
+ mbg-error="!$ctrl.entity.zipCode || $ctrl.notFoundCep"
36
36
  mbg-error-when="$ctrl.inputErrors"
37
37
  mbg-error-message="É necessário informar o CEP"
38
38
  spellcheck="false"
@@ -27,6 +27,7 @@ class MbgAddressManualController {
27
27
  public entity: any = {}
28
28
  public countries: any[]
29
29
  public inputErrors: boolean = false
30
+ public notFoundCep: boolean = false
30
31
 
31
32
  constructor(
32
33
  public $scope,
@@ -35,6 +36,7 @@ class MbgAddressManualController {
35
36
  public $http,
36
37
  public mbgAddressService,
37
38
  public EX,
39
+ public notFound,
38
40
  ) {}
39
41
 
40
42
  $onInit() {
@@ -104,6 +106,7 @@ class MbgAddressManualController {
104
106
  if (this.entity && this.entity.zipCode) {
105
107
  this.mbgAddressService.getCep(this.entity.zipCode).then((response) => {
106
108
  if (response && response.data && response.data.cep) {
109
+ this.notFoundCep = false
107
110
  const formalCode = response.data.ibge || ''
108
111
  const premisse = this.formatFromPremisse(response.data.logradouro)
109
112
  this.entity = {
@@ -121,6 +124,9 @@ class MbgAddressManualController {
121
124
  formalCode,
122
125
  state: response.data.uf,
123
126
  }
127
+ } else {
128
+ this.notFoundCep = true
129
+ this.notFound()
124
130
  }
125
131
  })
126
132
  }
@@ -166,6 +172,7 @@ MbgAddressManualController['$inject'] = [
166
172
  '$http',
167
173
  'mbgAddressService',
168
174
  'EX',
175
+ 'notFound',
169
176
  ]
170
177
 
171
178
  export { MbgAddressManualController }
@@ -56,7 +56,7 @@ class MbgRepasseController {
56
56
  handleNgModel() {
57
57
  this.$timeout(() => {
58
58
  this.ngModel['conditions'] = this.conditions
59
- .filter((cond) => cond.field && cond.operator && cond.selected)
59
+ .filter((cond) => cond.field && cond.operator && cond.selected !== undefined)
60
60
  .map((condition) => {
61
61
  return {
62
62
  field: condition.field.type,
@@ -65,7 +65,7 @@ class MbgRepasseController {
65
65
  }
66
66
  })
67
67
  this.ngModel['applies'] = this.applies
68
- .filter((app) => app.field && app.selected)
68
+ .filter((app) => app.field && app.selected !== undefined)
69
69
  .map((apply) => {
70
70
  return {
71
71
  field: apply.field.type,