@kigi/components 1.27.7-alpha → 1.27.8-alpha
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,7 +1,6 @@
|
|
|
1
1
|
<div class="mbg-btn-form-wrapper"
|
|
2
2
|
ng-click="$ctrl.handleClick($event)">
|
|
3
3
|
<button type="button"
|
|
4
|
-
ng-class="{'btn-tray': $ctrl.trayIntegration}"
|
|
5
4
|
ng-disabled="$ctrl.ngDisabled || $ctrl.loading || $ctrl.virtualDisable">
|
|
6
5
|
<span ng-if="!$ctrl.loading && !$ctrl.virtualDisable">
|
|
7
6
|
{{$ctrl.label}}
|
|
@@ -7,7 +7,6 @@ class MbgBtnFormController {
|
|
|
7
7
|
private ngDisabled: boolean
|
|
8
8
|
private loading: boolean
|
|
9
9
|
private virtualDisable = false
|
|
10
|
-
private trayIntegration: boolean = false
|
|
11
10
|
|
|
12
11
|
constructor(public $scope, public $element, public $attrs, public $timeout) {}
|
|
13
12
|
|
|
@@ -33,7 +32,6 @@ const mbgBtnForm = {
|
|
|
33
32
|
loading: '=?',
|
|
34
33
|
ngClick: '&?',
|
|
35
34
|
virtualDisable: `=?`,
|
|
36
|
-
trayIntegration: '=?',
|
|
37
35
|
},
|
|
38
36
|
template,
|
|
39
37
|
controller: MbgBtnFormController,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import './mbg-list.scss'
|
|
2
2
|
import * as angular from 'angular'
|
|
3
3
|
import template from './mbg-list.html'
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import {MbgListColumnController} from './components/mbg-list-column/mbg-list-column'
|
|
5
|
+
import {MbgListRowController} from './components/mbg-list-row/mbg-list-row'
|
|
6
6
|
|
|
7
7
|
export class MbgListController {
|
|
8
8
|
public rows: Array<any>
|
|
@@ -28,7 +28,8 @@ export class MbgListController {
|
|
|
28
28
|
public indexToPush
|
|
29
29
|
private movementManual
|
|
30
30
|
|
|
31
|
-
constructor(public $scope, public $element, public $attrs, public $timeout, public $transclude) {
|
|
31
|
+
constructor(public $scope, public $element, public $attrs, public $timeout, public $transclude) {
|
|
32
|
+
}
|
|
32
33
|
|
|
33
34
|
$onInit() {
|
|
34
35
|
this.enableOnSelectByRow =
|
|
@@ -95,6 +96,7 @@ export class MbgListController {
|
|
|
95
96
|
removeCircularJson(json) {
|
|
96
97
|
const parsed = JSON.parse(json)
|
|
97
98
|
delete parsed.$json
|
|
99
|
+
delete parsed.$$hashKey
|
|
98
100
|
return JSON.stringify(parsed)
|
|
99
101
|
}
|
|
100
102
|
|
|
@@ -193,7 +195,7 @@ export class MbgListController {
|
|
|
193
195
|
|
|
194
196
|
isAllSelected() {
|
|
195
197
|
if (this.checkboxIf) {
|
|
196
|
-
const possibleActive = this.list.filter((row) => this.checkboxIf({
|
|
198
|
+
const possibleActive = this.list.filter((row) => this.checkboxIf({$row: row}))
|
|
197
199
|
return (
|
|
198
200
|
possibleActive.filter(
|
|
199
201
|
(row) => !this.selectedMap[this.removeCircularJson(JSON.stringify(row))],
|
|
@@ -209,7 +211,7 @@ export class MbgListController {
|
|
|
209
211
|
toogleAll(selectAll) {
|
|
210
212
|
this.list.forEach((row) => {
|
|
211
213
|
if (this.checkboxIf) {
|
|
212
|
-
if (this.checkboxIf({
|
|
214
|
+
if (this.checkboxIf({$row: row})) {
|
|
213
215
|
this.selectedMap[this.removeCircularJson(JSON.stringify(row))] = selectAll
|
|
214
216
|
}
|
|
215
217
|
} else {
|
|
@@ -240,7 +242,7 @@ export class MbgListController {
|
|
|
240
242
|
if (this.rowsAdicional !== index && (this.checkbox || this.radio) && this.enableOnSelectByRow) {
|
|
241
243
|
if (this.radio) {
|
|
242
244
|
if (this.checkboxIf) {
|
|
243
|
-
if (this.checkboxIf({
|
|
245
|
+
if (this.checkboxIf({$row: row})) {
|
|
244
246
|
this.toogleRadio(row.$json)
|
|
245
247
|
}
|
|
246
248
|
} else {
|
|
@@ -248,7 +250,7 @@ export class MbgListController {
|
|
|
248
250
|
}
|
|
249
251
|
} else {
|
|
250
252
|
if (this.checkboxIf) {
|
|
251
|
-
if (this.checkboxIf({
|
|
253
|
+
if (this.checkboxIf({$row: row})) {
|
|
252
254
|
this.selectedMap[row.$json] = !this.selectedMap[row.$json]
|
|
253
255
|
this.toogleCheckbox()
|
|
254
256
|
}
|
|
@@ -259,7 +261,7 @@ export class MbgListController {
|
|
|
259
261
|
}
|
|
260
262
|
}
|
|
261
263
|
if (this.onClickRow) {
|
|
262
|
-
this.onClickRow({
|
|
264
|
+
this.onClickRow({$row: row})
|
|
263
265
|
}
|
|
264
266
|
}
|
|
265
267
|
|
|
@@ -282,7 +284,7 @@ export class MbgListController {
|
|
|
282
284
|
getRowStripedStyle(row, index) {
|
|
283
285
|
if (row.isAdicional) {
|
|
284
286
|
const background = this.$element.find(`table tr`)[index].style.backgroundColor
|
|
285
|
-
return {
|
|
287
|
+
return {background}
|
|
286
288
|
}
|
|
287
289
|
|
|
288
290
|
return {
|
|
@@ -293,7 +295,7 @@ export class MbgListController {
|
|
|
293
295
|
r.$json ? r.$json : JSON.stringify(r),
|
|
294
296
|
)
|
|
295
297
|
}) %
|
|
296
|
-
|
|
298
|
+
2 ===
|
|
297
299
|
0
|
|
298
300
|
? '#eaeaea'
|
|
299
301
|
: '#F5F5F5',
|
|
@@ -325,4 +327,4 @@ const mbgList = {
|
|
|
325
327
|
controller: MbgListController,
|
|
326
328
|
}
|
|
327
329
|
|
|
328
|
-
export {
|
|
330
|
+
export {mbgList}
|