frozen-columns-mixin.js
3.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = {
computed: {
frozenCols: function frozenCols() {
return this.internalColumns.filter(function (x) {
return x.isFrozen === true;
});
},
noFrozenCols: function noFrozenCols() {
return this.internalColumns.filter(function (x) {
return x.isFrozen !== true;
});
},
frozenTitleCols: function frozenTitleCols() {
var frozenTitleCols = [],
self = this;
if (this.internalTitleRows.length > 0) {
var frozenFields = this.frozenCols.map(function (x) {
return x.field;
});
this.internalTitleRows.forEach(function (rows) {
var frozenTitleRows = rows.filter(function (row) {
if (Array.isArray(row.fields)) {
if (row.fields.every(function (field) {
return frozenFields.indexOf(field) !== -1;
})) {
return true;
}
}
});
if (frozenTitleRows.length > 0) {
frozenTitleCols.push(frozenTitleRows);
var minRowspan = self.getMinRowspan(frozenTitleRows);
if (minRowspan && minRowspan > 0) {
for (var i = 0; i < minRowspan; i++) {
frozenTitleCols.push([]);
}
}
}
});
}
return frozenTitleCols;
},
noFrozenTitleCols: function noFrozenTitleCols() {
var noFrozenTitleCols = [],
self = this;
if (this.internalTitleRows.length > 0) {
var noFrozenFields = this.noFrozenCols.map(function (x) {
return x.field;
});
this.internalTitleRows.forEach(function (rows) {
var noFrozenTitleRows = rows.filter(function (row) {
if (Array.isArray(row.fields)) {
return row.fields.every(function (field) {
return noFrozenFields.indexOf(field) !== -1;
});
}
});
if (noFrozenTitleRows.length > 0) {
noFrozenTitleCols.push(noFrozenTitleRows);
var minRowspan = self.getMinRowspan(noFrozenTitleRows);
if (minRowspan && minRowspan > 0) {
for (var i = 0; i < minRowspan; i++) {
noFrozenTitleCols.push([]);
}
}
}
});
}
return noFrozenTitleCols;
}
}
};