@kigi/components 1.58.0-beta.1 → 1.58.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.58.0-beta.1",
3
+ "version": "1.58.0-beta.3",
4
4
  "description": "@kigi/components",
5
5
  "main": "src/components/index.ts",
6
6
  "scripts": {
@@ -67,7 +67,7 @@
67
67
  ng-style="{width: $ctrl.uploadProgress + '%'}"></div>
68
68
  <div class="uploading-content">
69
69
  <div class="left">
70
- <label>Enviando o arquivo</label>
70
+ <label>{{$ctrl.sendMessage ? 'Carregando arquivo' : 'Enviando o arquivo'}}</label>
71
71
  <p>• {{ $ctrl.uploadProgress }}%</p>
72
72
  </div>
73
73
  <div class="right">
@@ -1,6 +1,6 @@
1
- import './mbg-input-file.scss'
2
- import template from './mbg-input-file.html'
3
1
  import { ImageUploadFirebase } from '../mbg-image-upload/helpers/firebase'
2
+ import template from './mbg-input-file.html'
3
+ import './mbg-input-file.scss'
4
4
 
5
5
  class MbgInputFileController {
6
6
  public inputElement
@@ -77,10 +77,7 @@ class MbgInputFileController {
77
77
 
78
78
  processFiles(files) {
79
79
  this.uploading = true
80
- this.$timeout(() => {
81
- if (this.onFileSelect) {
82
- this.onFileSelect({ file: files[0] })
83
- }
80
+ this.$timeout(async () => {
84
81
  if (this.disableFirebase) {
85
82
  this.$timeout(() => {
86
83
  this.uploadingError = false
@@ -94,7 +91,7 @@ class MbgInputFileController {
94
91
  })
95
92
  return
96
93
  }
97
- this.uploadTask = ImageUploadFirebase.uploadFile(files[0], {
94
+ this.uploadTask = await ImageUploadFirebase.uploadFile(files[0], {
98
95
  onResume: () => {
99
96
  this.$timeout(() => (this.uploadPaused = false))
100
97
  },
@@ -120,6 +117,9 @@ class MbgInputFileController {
120
117
  })
121
118
  },
122
119
  })
120
+ if (this.onFileSelect) {
121
+ this.onFileSelect({ file: files[0] })
122
+ }
123
123
  })
124
124
  }
125
125
 
@@ -157,7 +157,7 @@ class MbgInputFileController {
157
157
  }
158
158
  }
159
159
 
160
- MbgInputFileController.$inject = ['$scope', '$element', '$attrs', '$timeout']
160
+ MbgInputFileController['$inject'] = ['$scope', '$element', '$attrs', '$timeout']
161
161
 
162
162
  const mbgInputFile = {
163
163
  bindings: {
@@ -165,6 +165,7 @@ const mbgInputFile = {
165
165
  type: '@?',
166
166
  onFileSelect: '&?',
167
167
  disableFirebase: '=?',
168
+ sendMessage: '=?',
168
169
  },
169
170
  template,
170
171
  controller: MbgInputFileController,
@@ -1,8 +1,8 @@
1
- import './mbg-list.scss'
2
1
  import * as angular from 'angular'
2
+ import { MbgListColumnController } from './components/mbg-list-column/mbg-list-column'
3
+ import { MbgListRowController } from './components/mbg-list-row/mbg-list-row'
3
4
  import template from './mbg-list.html'
4
- import {MbgListColumnController} from './components/mbg-list-column/mbg-list-column'
5
- import {MbgListRowController} from './components/mbg-list-row/mbg-list-row'
5
+ import './mbg-list.scss'
6
6
 
7
7
  export class MbgListController {
8
8
  public rows: Array<any>
@@ -27,9 +27,10 @@ export class MbgListController {
27
27
  public staticColumns: Array<any>
28
28
  public indexToPush
29
29
  private movementManual
30
+ private selectedAll: Function
31
+ private listCompletePerson: Array<any> = []
30
32
 
31
- constructor(public $scope, public $element, public $attrs, public $timeout, public $transclude) {
32
- }
33
+ constructor(public $scope, public $element, public $attrs, public $timeout, public $transclude) {}
33
34
 
34
35
  $onInit() {
35
36
  this.enableOnSelectByRow =
@@ -195,7 +196,7 @@ export class MbgListController {
195
196
 
196
197
  isAllSelected() {
197
198
  if (this.checkboxIf) {
198
- const possibleActive = this.list.filter((row) => this.checkboxIf({$row: row}))
199
+ const possibleActive = this.list.filter((row) => this.checkboxIf({ $row: row }))
199
200
  return (
200
201
  possibleActive.filter(
201
202
  (row) => !this.selectedMap[this.removeCircularJson(JSON.stringify(row))],
@@ -209,9 +210,24 @@ export class MbgListController {
209
210
  }
210
211
 
211
212
  toogleAll(selectAll) {
213
+ if (this.selectedAll && this.listCompletePerson.length) {
214
+ this.listCompletePerson.forEach((row) => {
215
+ if (this.checkboxIf) {
216
+ if (this.checkboxIf({ $row: row })) {
217
+ this.selectedMap[this.removeCircularJson(JSON.stringify(row))] = selectAll
218
+ }
219
+ } else {
220
+ this.selectedMap[this.removeCircularJson(JSON.stringify(row))] = selectAll
221
+ }
222
+ })
223
+ this.selectedAll({ selectAll: selectAll })
224
+ this.handlingSelectedValues()
225
+ return
226
+ }
227
+
212
228
  this.list.forEach((row) => {
213
229
  if (this.checkboxIf) {
214
- if (this.checkboxIf({$row: row})) {
230
+ if (this.checkboxIf({ $row: row })) {
215
231
  this.selectedMap[this.removeCircularJson(JSON.stringify(row))] = selectAll
216
232
  }
217
233
  } else {
@@ -242,7 +258,7 @@ export class MbgListController {
242
258
  if (this.rowsAdicional !== index && (this.checkbox || this.radio) && this.enableOnSelectByRow) {
243
259
  if (this.radio) {
244
260
  if (this.checkboxIf) {
245
- if (this.checkboxIf({$row: row})) {
261
+ if (this.checkboxIf({ $row: row })) {
246
262
  this.toogleRadio(row.$json)
247
263
  }
248
264
  } else {
@@ -250,7 +266,7 @@ export class MbgListController {
250
266
  }
251
267
  } else {
252
268
  if (this.checkboxIf) {
253
- if (this.checkboxIf({$row: row})) {
269
+ if (this.checkboxIf({ $row: row })) {
254
270
  this.selectedMap[row.$json] = !this.selectedMap[row.$json]
255
271
  this.toogleCheckbox()
256
272
  }
@@ -261,7 +277,7 @@ export class MbgListController {
261
277
  }
262
278
  }
263
279
  if (this.onClickRow) {
264
- this.onClickRow({$row: row})
280
+ this.onClickRow({ $row: row })
265
281
  }
266
282
  }
267
283
 
@@ -284,7 +300,7 @@ export class MbgListController {
284
300
  getRowStripedStyle(row, index) {
285
301
  if (row.isAdicional) {
286
302
  const background = this.$element.find(`table tr`)[index].style.backgroundColor
287
- return {background}
303
+ return { background }
288
304
  }
289
305
 
290
306
  return {
@@ -295,7 +311,7 @@ export class MbgListController {
295
311
  r.$json ? r.$json : JSON.stringify(r),
296
312
  )
297
313
  }) %
298
- 2 ===
314
+ 2 ===
299
315
  0
300
316
  ? '#eaeaea'
301
317
  : '#F5F5F5',
@@ -322,9 +338,11 @@ const mbgList = {
322
338
  dinamicColumns: '=?',
323
339
  hideSelectAll: '=?',
324
340
  movementManual: '=?',
341
+ selectedAll: '&?',
342
+ listCompletePerson: '=?',
325
343
  },
326
344
  template,
327
345
  controller: MbgListController,
328
346
  }
329
347
 
330
- export {mbgList}
348
+ export { mbgList }