@kigi/components 1.19.1 → 1.19.2-beta.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.1",
3
+ "version": "1.19.2-beta.1",
4
4
  "description": "@kigi/components",
5
5
  "main": "src/components/index.ts",
6
6
  "scripts": {
@@ -244,6 +244,9 @@ class MbgAddressController {
244
244
  this.ngModel.state
245
245
  }, ${this.ngModel.country}`
246
246
  }
247
+ console.log('this.address.neighbourhood', this.address.neighbourhood);
248
+ console.log('this.address.neighbourhood', this.ngModel.neighbourhood);
249
+
247
250
  }
248
251
 
249
252
  getPremisseType(str) {
@@ -41,7 +41,9 @@
41
41
  ng-click="$ctrl.handleDisplayValues()"><i class="fas fa-eye-slash"></i> <span>Esconder valores</span></a>
42
42
  </div>
43
43
  </div>
44
-
44
+ <a target="_self" ng-click="$ctrl.redirectReport()" class="link">
45
+ Gerar extrato
46
+ </a>
45
47
  <div class="mbg-h-card-container">
46
48
  <mbg-card-typeone ng-repeat="card in $ctrl.cards"
47
49
  allowed-to-see="$ctrl.allowedToSee"
@@ -140,5 +140,14 @@ mbg-homescreen {
140
140
  }
141
141
  }
142
142
  }
143
+ .link {
144
+ color: #9c9c9c;
145
+ display: flex;
146
+ justify-content: center;
147
+ top: 40px;
148
+ position: relative;
149
+ width: 10%;
150
+ left: 40.5%;
151
+ }
143
152
  }
144
153
  }
@@ -15,7 +15,7 @@ class MbgHomescreenController {
15
15
  private activeIndex: number
16
16
  private activeFilter: any
17
17
 
18
- constructor(public $scope, public $element, public $attrs, public $timeout) {}
18
+ constructor(public $scope, public $element, public $attrs, public $timeout, public $state) {}
19
19
 
20
20
  $onInit() {
21
21
  this.$scope.$watch('$ctrl.config', (data) => {
@@ -37,6 +37,12 @@ class MbgHomescreenController {
37
37
  })
38
38
  }
39
39
 
40
+ redirectReport() {
41
+ this.$state.go('app.mobiage-report.list-extract', {
42
+ report: 'sales-and-payments',
43
+ })
44
+ }
45
+
40
46
  selectFilter(item) {
41
47
  if (this.tabs[this.activeIndex]) {
42
48
  this.tabs[this.activeIndex].filters = this.tabs[this.activeIndex].filters.map((tab) => {
@@ -75,7 +81,7 @@ class MbgHomescreenController {
75
81
  }
76
82
  }
77
83
 
78
- MbgHomescreenController.$inject = ['$scope', '$element', '$attrs', '$timeout']
84
+ MbgHomescreenController['$inject'] = ['$scope', '$element', '$attrs', '$timeout', '$state']
79
85
 
80
86
  const mbgHomescreen = {
81
87
  bindings: {
@@ -1,9 +1,14 @@
1
1
  <div class="mbg-multi-select-wrapper">
2
- <span ng-if="$ctrl.showScrollArrows" class="arrow-left" ng-click="$ctrl.scrollToLeft()">
2
+
3
+ <span ng-if="$ctrl.showScrollArrows"
4
+ class="arrow-left"
5
+ ng-click="$ctrl.scrollToLeft()">
3
6
  <i class="fas fa-chevron-circle-left"></i>
4
7
  </span>
8
+
5
9
  <div class="mbg-multi-select-scroll"
6
10
  ng-class="{'disabled': $ctrl.ngDisabled, 'inline-mode-wrapper': $ctrl.inlineMode}">
11
+
7
12
  <div class="mbg-multi-select-content">
8
13
  <ul class="items-selected">
9
14
  <li ng-repeat="item in $ctrl.ngModel track by $index"
@@ -37,7 +42,10 @@
37
42
  label="{{ $ctrl.label }}"></mbg-select>
38
43
  </div>
39
44
  </div>
40
- <span ng-if="$ctrl.showScrollArrows" class="arrow-right" ng-click="$ctrl.scrollToRight()">
45
+
46
+ <span ng-if="$ctrl.showScrollArrows"
47
+ class="arrow-right"
48
+ ng-click="$ctrl.scrollToRight()">
41
49
  <i class="fas fa-chevron-circle-right"></i>
42
50
  </span>
43
51
  </div>
@@ -1,7 +1,6 @@
1
1
  .mbg-multi-select-wrapper {
2
2
 
3
3
  position: relative;
4
-
5
4
  display: flex;
6
5
  align-items: center;
7
6
 
@@ -24,188 +23,270 @@
24
23
  }
25
24
 
26
25
  .arrow-left {
27
- left: 0px;
28
- transition: transform .5s;
29
- transform: translateX(-40px);
30
- }
26
+ animation: left-exit .2s linear forwards ;
27
+ }
31
28
 
32
29
  .arrow-right {
33
- right: 0px;
34
- transition: transform .5s;
35
- transform: translateX(40px);
30
+ animation: right-exit .2s linear forwards ;
36
31
  }
37
-
38
32
 
39
33
  &:hover {
40
34
  .arrow-left {
41
- transition: transform .3s;
42
- transform: translateX(8px);
35
+ animation: left-enter .3s linear forwards;
36
+
43
37
  }
44
38
  .arrow-right {
45
- transition: transform .3s;
46
- transform: translateX(-8px);
39
+ animation: right-enter .3s linear forwards;
47
40
  }
48
41
  }
49
42
 
50
- .mbg-multi-select-scroll {
51
- border: 1px solid #ddd;
52
- background: #fff;
53
- border-radius: 5px;
54
- padding: 8px;
55
- -ms-flex: 1 1;
56
- flex: 1 1;
57
- outline: none;
58
- width: inherit;
59
- display: inline-flex;
60
- height: 44px;
61
- align-items: center;
62
- overflow: visible;
63
- max-width: 100%;
64
- overflow: scroll;
65
- overflow: -moz-scrollbars-none;
66
- -ms-overflow-style: none;
67
- scrollbar-width: none;
68
- padding-top: 0;
69
- padding-bottom: 0;
70
- width: 100%;
43
+ .mbg-multi-select-scroll {
44
+ border: 1px solid #ddd;
45
+ background: #fff;
46
+ border-radius: 5px;
47
+ padding: 8px;
48
+ -ms-flex: 1 1;
49
+ flex: 1 1;
50
+ outline: none;
51
+ width: inherit;
52
+ display: inline-flex;
53
+ height: 44px;
54
+ align-items: center;
55
+ overflow: visible;
56
+ max-width: 100%;
57
+ overflow: scroll;
58
+ overflow: -moz-scrollbars-none;
59
+ -ms-overflow-style: none;
60
+ scrollbar-width: none;
61
+ padding-top: 0;
62
+ padding-bottom: 0;
63
+ width: 100%;
71
64
 
72
- &.inline-mode-wrapper {
73
- height: auto;
74
- max-height: 284px;
65
+ &.inline-mode-wrapper {
66
+ height: auto;
67
+ max-height: 284px;
75
68
 
76
- .mbg-multi-select-content {
69
+ .mbg-multi-select-content {
70
+ flex-direction: column;
71
+ width: 100%;
72
+
73
+ mbg-select {
74
+ width: 100%;
75
+ }
76
+
77
+ ul {
77
78
  flex-direction: column;
78
79
  width: 100%;
80
+ max-height: 234px;
81
+ overflow-y: auto;
82
+ overflow-x: hidden;
79
83
 
80
- mbg-select {
84
+ li {
81
85
  width: 100%;
82
- }
86
+ margin-top: 4px;
87
+ position: relative;
88
+ min-height: 28px;
83
89
 
84
- ul {
85
- flex-direction: column;
86
- width: 100%;
87
- max-height: 234px;
88
- overflow-y: auto;
89
- overflow-x: hidden;
90
-
91
- li {
92
- width: 100%;
93
- margin-top: 4px;
94
- position: relative;
95
- min-height: 28px;
96
-
97
- svg {
98
- position: absolute;
99
- right: 6px;
100
- }
90
+ svg {
91
+ position: absolute;
92
+ right: 6px;
93
+ }
94
+
95
+ label {
96
+ white-space: nowrap;
97
+ overflow: hidden;
98
+ text-overflow: ellipsis;
99
+ padding-right: 14px;
101
100
 
102
- label {
103
- white-space: nowrap;
104
- overflow: hidden;
105
- text-overflow: ellipsis;
106
- padding-right: 14px;
107
-
108
- &:hover {
109
- &::after {
110
- content: attr(data-text);
111
- overflow: visible;
112
- text-overflow: inherit;
113
- background: #fff;
114
- position: absolute;
115
- width: auto;
116
- max-width: 25rem;
117
- border: 1px solid #eaebec;
118
- border-radius: 4px;
119
- padding: 0 1rem;
120
- box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
121
- white-space: normal;
122
- word-wrap: break-word;
123
- display: block;
124
- color: #666;
125
- font-weight: 500;
126
- margin-top: -20px;
127
- z-index: 100;
128
- }
101
+ &:hover {
102
+ &::after {
103
+ content: attr(data-text);
104
+ overflow: visible;
105
+ text-overflow: inherit;
106
+ background: #fff;
107
+ position: absolute;
108
+ width: auto;
109
+ max-width: 25rem;
110
+ border: 1px solid #eaebec;
111
+ border-radius: 4px;
112
+ padding: 0 1rem;
113
+ box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.1);
114
+ white-space: normal;
115
+ word-wrap: break-word;
116
+ display: block;
117
+ color: #666;
118
+ font-weight: 500;
119
+ margin-top: -20px;
120
+ z-index: 100;
129
121
  }
130
122
  }
131
123
  }
132
124
  }
133
125
  }
134
126
  }
127
+ }
135
128
 
136
- &.disabled {
137
- background-color: #f5f5f5;
138
- border: 1px solid #ddd !important;
139
- }
129
+ &.disabled {
130
+ background-color: #f5f5f5;
131
+ border: 1px solid #ddd !important;
132
+ }
140
133
 
141
- &::-webkit-scrollbar {
142
- display: none;
143
- }
144
- .mbg-multi-select-content {
145
- display: inline-flex;
146
- align-items: center;
147
- }
148
- input {
149
- width: 100%;
150
- border: none;
151
- background-color: transparent;
152
- padding: 0 0 0 10px;
153
- &:focus {
154
- outline: none;
155
- box-shadow: none;
156
- }
134
+ &::-webkit-scrollbar {
135
+ display: none;
136
+ }
137
+ .mbg-multi-select-content {
138
+ display: inline-flex;
139
+ align-items: center;
140
+ }
141
+ input {
142
+ width: 100%;
143
+ border: none;
144
+ background-color: transparent;
145
+ padding: 0 0 0 10px;
146
+ &:focus {
147
+ outline: none;
148
+ box-shadow: none;
157
149
  }
158
- ul {
159
- &.items-selected {
160
- margin: 0;
161
- padding: 0;
162
- list-style: none;
163
- display: flex;
164
- width: fit-content;
150
+ }
151
+ ul {
152
+ &.items-selected {
153
+ margin: 0;
154
+ padding: 0;
155
+ list-style: none;
156
+ display: flex;
157
+ width: fit-content;
158
+ min-width: fit-content;
159
+ li {
165
160
  min-width: fit-content;
166
- li {
167
- min-width: fit-content;
168
- background: #e6e6e6;
169
- border-radius: 4px;
170
- height: 28px;
161
+ background: #e6e6e6;
162
+ border-radius: 4px;
163
+ height: 28px;
164
+ display: flex;
165
+ align-items: center;
166
+ justify-content: center;
167
+ padding: 0px 5px 0px 8px;
168
+ color: #666;
169
+ margin-right: 8px;
170
+ font-size: 14px;
171
+ width: max-content;
172
+ cursor: move;
173
+ font-weight: 500;
174
+ * {
175
+ user-select: none;
176
+ }
177
+ svg {
178
+ cursor: pointer;
179
+ width: 14px;
180
+ fill: currentColor;
181
+ margin-left: 4px;
171
182
  display: flex;
172
183
  align-items: center;
173
- justify-content: center;
174
- padding: 0px 5px 0px 8px;
175
- color: #666;
176
- margin-right: 8px;
177
- font-size: 14px;
178
- width: max-content;
179
- cursor: move;
180
- font-weight: 500;
181
- * {
182
- user-select: none;
183
- }
184
- svg {
185
- cursor: pointer;
186
- width: 14px;
187
- fill: currentColor;
188
- margin-left: 4px;
189
- display: flex;
190
- align-items: center;
191
- pointer-events: all;
192
- }
193
- &.dragging {
194
- opacity: 0.6;
195
- }
196
- &.over {
197
- background: red;
198
- }
184
+ pointer-events: all;
185
+ }
186
+ &.dragging {
187
+ opacity: 0.6;
188
+ }
189
+ &.over {
190
+ background: red;
199
191
  }
200
192
  }
201
193
  }
202
- .mbg-select-input-fake {
203
- flex: 1;
204
- min-width: 191.03px;
205
- border: none;
206
- }
207
- .mbg-select-wrapper .mbg-icon-select {
208
- display: none;
209
- }
194
+ }
195
+ .mbg-select-input-fake {
196
+ flex: 1;
197
+ min-width: 191.03px;
198
+ border: none;
199
+ }
200
+ .mbg-select-wrapper .mbg-icon-select {
201
+ display: none;
202
+ }
203
+ }
204
+
205
+ @keyframes right-enter {
206
+ 0% {
207
+ opacity: 0;
208
+ right: 0px;
209
+ }
210
+ 25% {
211
+ right: 2px;
212
+ }
213
+ 50% {
214
+ right: 4px;
215
+ }
216
+ 75% {
217
+ right: 6px;
218
+ }
219
+ 100% {
220
+ opacity: 1;
221
+ right: 8px;
222
+ }
223
+ }
224
+
225
+ @keyframes right-exit {
226
+ 0% {
227
+ opacity: 0;
228
+ right: 8px;
229
+ }
230
+ 25% {
231
+ right: 6px;
232
+ opacity: .5;
233
+ }
234
+ 50% {
235
+ right: 4px;
236
+ opacity: .3;
237
+ }
238
+ 75% {
239
+ right: 2px;
240
+ opacity: .1;
241
+
242
+ }
243
+ 100% {
244
+ right: 0px;
245
+ opacity: 0;
246
+ }
247
+ }
248
+
249
+ @keyframes left-enter {
250
+ 0% {
251
+ opacity: 0;
252
+ left: 0px;
253
+ }
254
+ 25% {
255
+ left: 2px;
256
+ }
257
+ 50% {
258
+ left: 4px;
259
+ }
260
+ 75% {
261
+ left: 6px;
262
+ }
263
+ 100% {
264
+ opacity: 1;
265
+ left: 8px;
266
+ }
267
+ }
268
+
269
+ @keyframes left-exit {
270
+ 0% {
271
+ opacity: 0;
272
+ left: 8px;
273
+ }
274
+ 25% {
275
+ left: 6px;
276
+ opacity: .5;
277
+ }
278
+ 50% {
279
+ left: 4px;
280
+ opacity: .3;
281
+ }
282
+ 75% {
283
+ left: 2px;
284
+ opacity: .1;
285
+
286
+ }
287
+ 100% {
288
+ left: 0px;
289
+ opacity: 0;
210
290
  }
211
291
  }
292
+ }
@@ -266,6 +266,10 @@ class MbgMultiSelectController {
266
266
  this.ngModel = Array.from(this.$element.find('ul.items-selected li')).map(
267
267
  (liElement: HTMLElement) => angular.element(liElement).scope().item,
268
268
  )
269
+
270
+ if (this.ngChange) {
271
+ this.ngChange({ value: this.ngModel })
272
+ }
269
273
  })
270
274
  }
271
275
  }
@@ -12,7 +12,15 @@
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()"></mbg-input-search>
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>
16
24
  <div ng-if="$ctrl.listHeaderDataTransclude"
17
25
  mbg-dynamic-html="$ctrl.listHeaderDataTransclude"></div>
18
26
  <div class="mbg-multi-list-wrapper"
@@ -48,9 +56,22 @@
48
56
  <mbg-input-search ng-model="$ctrl.inputValueResult"
49
57
  ng-model-options="{ debounce: 300 }"
50
58
  placeholder="$ctrl.placeholderRight"
51
- ng-change="$ctrl.searchNgModel()"></mbg-input-search>
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>
52
68
  <div ng-if="$ctrl.listHeaderResultTransclude"
53
69
  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>
54
75
  <div class="mbg-multi-list-wrapper result-multi-list-wrapper"
55
76
  ng-show="$ctrl.dataModel.length > 0">
56
77
  <div ng-if="$ctrl.listRowTransclude"
@@ -1,4 +1,12 @@
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
+
2
10
  mbg-input-search .mbg-input-search-wrapper .input-group-search {
3
11
  border: none;
4
12
  border-radius: 5px;
@@ -22,6 +22,10 @@ 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
25
29
 
26
30
  constructor(
27
31
  public $scope,
@@ -30,9 +34,14 @@ export class MbgSelectMultiListController {
30
34
  public $timeout,
31
35
  public $compile,
32
36
  public $transclude,
33
- ) {}
37
+ ) { }
34
38
 
35
39
  $onInit() {
40
+ if (this.selectOptions && !!this.selectOptions.length) {
41
+ this.selectOptionRight = this.selectOptions[0].key
42
+ this.selectOptionLeft = this.selectOptions[0].key
43
+ }
44
+
36
45
  this.placeholderLeft = this.placeholderLeft || ''
37
46
  this.placeholderRight = this.placeholderRight || ''
38
47
  this.$scope.$c = this.$scope.$parent
@@ -87,7 +96,7 @@ export class MbgSelectMultiListController {
87
96
 
88
97
  executeFetch() {
89
98
  this.$timeout(() => {
90
- this.fetch({ query: this.inputValue || '' })
99
+ this.fetch({ query: this.inputValue || '', selectOption: this.selectOptionLeft })
91
100
  })
92
101
  }
93
102
 
@@ -108,7 +117,7 @@ export class MbgSelectMultiListController {
108
117
  this.dataModel.push(copyRow)
109
118
  this.data.splice(index, 1)
110
119
  this.$timeout(() => {
111
- ;(this.ngModel || []).forEach((model) => {
120
+ ; (this.ngModel || []).forEach((model) => {
112
121
  delete model._uid
113
122
  })
114
123
  }, 500)
@@ -129,10 +138,12 @@ export class MbgSelectMultiListController {
129
138
 
130
139
  searchNgModel() {
131
140
  this.$timeout(() => {
132
- const search = (this.label || '').split(',')
141
+ const search = (this.selectOptionRight !== "all" ? this.selectOptionRight : this.label).split(',')
133
142
  const keys = search.map((word) => word.trim())
134
143
  const dataModel = JSON.parse(JSON.stringify(this.ngModel))
135
144
  const options = {
145
+ isCaseSensitive: false,
146
+ includeScore: false,
136
147
  shouldSort: true,
137
148
  threshold: 0.3,
138
149
  location: 0,
@@ -143,7 +154,10 @@ export class MbgSelectMultiListController {
143
154
  }
144
155
  const fuse = new Fuse(dataModel, options)
145
156
  const result = fuse.search(this.inputValueResult)
146
- this.dataModel = result.length > 0 ? result : dataModel
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
+ }
147
161
  })
148
162
  }
149
163
 
@@ -172,7 +186,7 @@ export class MbgSelectMultiListController {
172
186
  }
173
187
  }
174
188
 
175
- MbgSelectMultiListController.$inject = [
189
+ MbgSelectMultiListController['$inject'] = [
176
190
  '$scope',
177
191
  '$element',
178
192
  '$attrs',
@@ -195,6 +209,7 @@ const mbgSelectMultiList = {
195
209
  data: '=?',
196
210
  isLoading: '=?',
197
211
  pagination: '=?',
212
+ selectOptions: '=?',
198
213
  },
199
214
  template,
200
215
  controller: MbgSelectMultiListController,