@kigi/components 1.19.0-beta.3 → 1.19.1

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.19.0-beta.3",
3
+ "version": "1.19.1",
4
4
  "description": "@kigi/components",
5
5
  "main": "src/components/index.ts",
6
6
  "scripts": {
@@ -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
- ? this.address.uf.initial
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,14 +236,14 @@ class MbgAddressController {
236
236
 
237
237
  createFullName() {
238
238
  if (this.address.premisse) {
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}`
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
- console.log('this.address.neighbourhood', this.address.neighbourhood);
245
- console.log('this.address.neighbourhood', this.ngModel.neighbourhood);
246
-
247
247
  }
248
248
 
249
249
  getPremisseType(str) {
@@ -12,15 +12,7 @@
12
12
  <mbg-input-search ng-model="$ctrl.inputValue"
13
13
  placeholder="$ctrl.placeholderLeft"
14
14
  ng-model-options="{ debounce: 300 }"
15
- ng-change="$ctrl.executeFetch()">
16
- <select ng-model="$ctrl.selectOptionLeft"
17
- ng-change="$ctrl.executeFetch()">
18
- <option ng-repeat="option in $ctrl.selectOptions"
19
- ng-value="option.key">
20
- {{option.label}}
21
- </option>
22
- </select>
23
- </mbg-input-search>
15
+ ng-change="$ctrl.executeFetch()"></mbg-input-search>
24
16
  <div ng-if="$ctrl.listHeaderDataTransclude"
25
17
  mbg-dynamic-html="$ctrl.listHeaderDataTransclude"></div>
26
18
  <div class="mbg-multi-list-wrapper"
@@ -56,22 +48,9 @@
56
48
  <mbg-input-search ng-model="$ctrl.inputValueResult"
57
49
  ng-model-options="{ debounce: 300 }"
58
50
  placeholder="$ctrl.placeholderRight"
59
- ng-change="$ctrl.searchNgModel()">
60
- <select ng-model="$ctrl.selectOptionRight"
61
- ng-change="$ctrl.searchNgModel()">
62
- <option ng-repeat="option in $ctrl.selectOptions"
63
- ng-value="option.key">
64
- {{option.label}}
65
- </option>
66
- </select>
67
- </mbg-input-search>
51
+ ng-change="$ctrl.searchNgModel()"></mbg-input-search>
68
52
  <div ng-if="$ctrl.listHeaderResultTransclude"
69
53
  mbg-dynamic-html="$ctrl.listHeaderResultTransclude"></div>
70
- <div ng-if="$ctrl.dataModel.length <= 0">
71
- <label class="mbg-label input-label message-text"
72
- ng-if="$ctrl.dataModel.length <= 0">{{$ctrl.message}}
73
- </label>
74
- </div>
75
54
  <div class="mbg-multi-list-wrapper result-multi-list-wrapper"
76
55
  ng-show="$ctrl.dataModel.length > 0">
77
56
  <div ng-if="$ctrl.listRowTransclude"
@@ -1,12 +1,4 @@
1
1
  .mbg-select-multi-list-wrapper {
2
- .message-text{
3
- display: flex;
4
- justify-content: center;
5
- align-items: center;
6
- padding-top: 102px;
7
- margin-bottom: 152px;
8
- }
9
-
10
2
  mbg-input-search .mbg-input-search-wrapper .input-group-search {
11
3
  border: none;
12
4
  border-radius: 5px;
@@ -22,10 +22,6 @@ export class MbgSelectMultiListController {
22
22
  private pagination
23
23
  private order
24
24
  private fieldOrder
25
- private selectOptions
26
- private selectOptionLeft
27
- private selectOptionRight
28
- private message
29
25
 
30
26
  constructor(
31
27
  public $scope,
@@ -34,14 +30,9 @@ export class MbgSelectMultiListController {
34
30
  public $timeout,
35
31
  public $compile,
36
32
  public $transclude,
37
- ) { }
33
+ ) {}
38
34
 
39
35
  $onInit() {
40
- if (this.selectOptions && !!this.selectOptions.length) {
41
- this.selectOptionRight = this.selectOptions[0].key
42
- this.selectOptionLeft = this.selectOptions[0].key
43
- }
44
-
45
36
  this.placeholderLeft = this.placeholderLeft || ''
46
37
  this.placeholderRight = this.placeholderRight || ''
47
38
  this.$scope.$c = this.$scope.$parent
@@ -96,7 +87,7 @@ export class MbgSelectMultiListController {
96
87
 
97
88
  executeFetch() {
98
89
  this.$timeout(() => {
99
- this.fetch({ query: this.inputValue || '', selectOption: this.selectOptionLeft })
90
+ this.fetch({ query: this.inputValue || '' })
100
91
  })
101
92
  }
102
93
 
@@ -117,7 +108,7 @@ export class MbgSelectMultiListController {
117
108
  this.dataModel.push(copyRow)
118
109
  this.data.splice(index, 1)
119
110
  this.$timeout(() => {
120
- ; (this.ngModel || []).forEach((model) => {
111
+ ;(this.ngModel || []).forEach((model) => {
121
112
  delete model._uid
122
113
  })
123
114
  }, 500)
@@ -138,12 +129,10 @@ export class MbgSelectMultiListController {
138
129
 
139
130
  searchNgModel() {
140
131
  this.$timeout(() => {
141
- const search = (this.selectOptionRight !== "all" ? this.selectOptionRight : this.label).split(',')
132
+ const search = (this.label || '').split(',')
142
133
  const keys = search.map((word) => word.trim())
143
134
  const dataModel = JSON.parse(JSON.stringify(this.ngModel))
144
135
  const options = {
145
- isCaseSensitive: false,
146
- includeScore: false,
147
136
  shouldSort: true,
148
137
  threshold: 0.3,
149
138
  location: 0,
@@ -154,10 +143,7 @@ export class MbgSelectMultiListController {
154
143
  }
155
144
  const fuse = new Fuse(dataModel, options)
156
145
  const result = fuse.search(this.inputValueResult)
157
- this.dataModel = result.length > 0 ? result : this.inputValueResult ? [] : dataModel
158
- if (this.dataModel.length === 0) {
159
- this.message = `Nenhum resultado encontrado pela pesquisa: "${this.inputValueResult}"`
160
- }
146
+ this.dataModel = result.length > 0 ? result : dataModel
161
147
  })
162
148
  }
163
149
 
@@ -186,7 +172,7 @@ export class MbgSelectMultiListController {
186
172
  }
187
173
  }
188
174
 
189
- MbgSelectMultiListController['$inject'] = [
175
+ MbgSelectMultiListController.$inject = [
190
176
  '$scope',
191
177
  '$element',
192
178
  '$attrs',
@@ -209,7 +195,6 @@ const mbgSelectMultiList = {
209
195
  data: '=?',
210
196
  isLoading: '=?',
211
197
  pagination: '=?',
212
- selectOptions: '=?',
213
198
  },
214
199
  template,
215
200
  controller: MbgSelectMultiListController,