@progress/kendo-vue-grid 8.1.0-develop.5 → 8.1.0-develop.7
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/Grid.d.ts +32 -17
- package/Grid.js +1 -1
- package/Grid.mjs +568 -449
- package/GridState.d.ts +17 -1
- package/GridState.js +1 -1
- package/GridState.mjs +84 -71
- package/RootGrid.d.ts +29 -0
- package/RootGrid.js +1 -1
- package/RootGrid.mjs +23 -8
- package/cells/GridCell.d.ts +2 -0
- package/cells/GridCell.js +1 -1
- package/cells/GridCell.mjs +35 -30
- package/cells/GridDetailCell.js +1 -1
- package/cells/GridDetailCell.mjs +20 -20
- package/cells/GridFilterCell.js +1 -1
- package/cells/GridFilterCell.mjs +42 -37
- package/cells/GridGroupCell.d.ts +2 -0
- package/cells/GridGroupCell.js +1 -1
- package/cells/GridGroupCell.mjs +69 -55
- package/cells/GridHierarchyCell.d.ts +2 -0
- package/cells/GridHierarchyCell.js +1 -1
- package/cells/GridHierarchyCell.mjs +51 -41
- package/cells/GridSelectionCell.d.ts +2 -0
- package/cells/GridSelectionCell.js +1 -1
- package/cells/GridSelectionCell.mjs +35 -24
- package/cells/pincell/GridPinCell.d.ts +72 -0
- package/cells/pincell/GridPinCell.js +8 -0
- package/cells/pincell/GridPinCell.mjs +111 -0
- package/cells/pincell/GridPinDropdownButton.d.ts +27 -0
- package/cells/pincell/GridPinDropdownButton.js +8 -0
- package/cells/pincell/GridPinDropdownButton.mjs +111 -0
- package/common.d.ts +6 -0
- package/common.js +1 -1
- package/common.mjs +8 -2
- package/components/PinnedRowsTable.d.ts +62 -0
- package/components/PinnedRowsTable.js +8 -0
- package/components/PinnedRowsTable.mjs +135 -0
- package/components/StickyGroupTable.d.ts +0 -1
- package/components/StickyGroupTable.js +1 -1
- package/components/StickyGroupTable.mjs +24 -30
- package/constants/main.d.ts +15 -0
- package/dist/cdn/js/kendo-vue-grid.js +1 -1
- package/drag/ColumnResize.d.ts +2 -0
- package/drag/ColumnResize.js +1 -1
- package/drag/ColumnResize.mjs +139 -123
- package/footer/FooterCell.js +1 -1
- package/footer/FooterCell.mjs +22 -20
- package/getRowContents.js +1 -1
- package/getRowContents.mjs +50 -48
- package/header/FilterRow.d.ts +4 -0
- package/header/FilterRow.js +1 -1
- package/header/FilterRow.mjs +52 -50
- package/header/HeaderRow.d.ts +4 -0
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +114 -105
- package/index.js +1 -1
- package/index.mjs +15 -14
- package/interfaces/ColumnType.d.ts +1 -1
- package/interfaces/GridCellProps.d.ts +5 -0
- package/interfaces/GridCellsSettings.d.ts +23 -0
- package/interfaces/GridColumnProps.d.ts +2 -2
- package/interfaces/GridProps.d.ts +102 -31
- package/interfaces/GridRowProps.d.ts +13 -4
- package/interfaces/GridRowsSettings.d.ts +48 -0
- package/interfaces/events.d.ts +19 -2
- package/messages/main.d.ts +30 -0
- package/messages/main.js +2 -2
- package/messages/main.mjs +108 -96
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +13 -12
- package/rows/GridRow.d.ts +6 -10
- package/rows/GridRow.js +1 -1
- package/rows/GridRow.mjs +31 -26
- package/utils/main.d.ts +5 -0
- package/utils/main.js +1 -1
- package/utils/main.mjs +199 -167
- package/utils/virtualColumns.js +1 -1
- package/utils/virtualColumns.mjs +121 -105
package/utils/main.mjs
CHANGED
|
@@ -5,72 +5,72 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
import { findGroupExpand as
|
|
9
|
-
import { getter as E, canUseDOM as
|
|
10
|
-
import { gridDefaultProps as
|
|
11
|
-
const
|
|
8
|
+
import { findGroupExpand as H, updateLeft as T, updateRight as O, tableKeyboardNavigationTools as R } from "@progress/kendo-vue-data-tools";
|
|
9
|
+
import { getter as E, canUseDOM as F } from "@progress/kendo-vue-common";
|
|
10
|
+
import { gridDefaultProps as b } from "../GridColumn.mjs";
|
|
11
|
+
const S = "string";
|
|
12
12
|
function v(e, t) {
|
|
13
|
-
const
|
|
14
|
-
let
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
}),
|
|
13
|
+
const r = e.split(".");
|
|
14
|
+
let n = t;
|
|
15
|
+
return r.forEach((a) => {
|
|
16
|
+
n = n ? n[a] : void 0;
|
|
17
|
+
}), n;
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
let c =
|
|
21
|
-
for (let
|
|
22
|
-
let
|
|
23
|
-
if (!a || t[
|
|
24
|
-
const
|
|
19
|
+
function k(e, t, r, n, a, d, i, o, h, f, g = 0, l) {
|
|
20
|
+
let c = g;
|
|
21
|
+
for (let p = 0; p < t.length; p++) {
|
|
22
|
+
let s;
|
|
23
|
+
if (!a || t[p].value === void 0 || t[p].items === void 0) {
|
|
24
|
+
const w = h ? !!(d != null && d[E(h)(t[p])]) : !1;
|
|
25
25
|
e[e.length] = {
|
|
26
|
-
dataIndex:
|
|
27
|
-
dataItem: t[
|
|
26
|
+
dataIndex: n.index,
|
|
27
|
+
dataItem: t[p],
|
|
28
28
|
rowType: "data",
|
|
29
|
-
level:
|
|
30
|
-
group:
|
|
29
|
+
level: g,
|
|
30
|
+
group: l,
|
|
31
31
|
// This is related to detail-row expansion
|
|
32
|
-
expanded:
|
|
33
|
-
},
|
|
32
|
+
expanded: f !== void 0 ? v(f, t[p]) : w != null ? w : !1
|
|
33
|
+
}, n.index++;
|
|
34
34
|
continue;
|
|
35
35
|
} else {
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
field: t[
|
|
39
|
-
value: t[
|
|
40
|
-
parents:
|
|
36
|
+
let w;
|
|
37
|
+
l != null && l.parents ? w = [{ field: l.field, value: l.value }, ...l.parents] : l ? w = [l] : w = [], s = {
|
|
38
|
+
field: t[p].field,
|
|
39
|
+
value: t[p].value,
|
|
40
|
+
parents: w
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
c = Math.max(c,
|
|
43
|
+
c = Math.max(c, g + 1);
|
|
44
44
|
let x = !1;
|
|
45
|
-
const u =
|
|
46
|
-
|
|
45
|
+
const u = H(i || [], s);
|
|
46
|
+
f ? x = f === void 0 || v(f, t[p]) === void 0 || v(f, t[p]) : x = u ? u.expanded !== !1 : o !== !1, e[e.length] = {
|
|
47
47
|
dataIndex: -1,
|
|
48
|
-
dataItem: t[
|
|
49
|
-
level:
|
|
50
|
-
group:
|
|
48
|
+
dataItem: t[p],
|
|
49
|
+
level: g,
|
|
50
|
+
group: s,
|
|
51
51
|
rowType: "groupHeader",
|
|
52
52
|
expanded: x
|
|
53
|
-
}, x && (
|
|
54
|
-
|
|
53
|
+
}, x && (s.expanded = x, c = Math.max(
|
|
54
|
+
k(
|
|
55
55
|
e,
|
|
56
|
-
t[
|
|
57
|
-
n,
|
|
56
|
+
t[p].items,
|
|
58
57
|
r,
|
|
58
|
+
n,
|
|
59
59
|
a,
|
|
60
|
-
|
|
60
|
+
d,
|
|
61
61
|
i,
|
|
62
62
|
o,
|
|
63
|
-
d,
|
|
64
63
|
h,
|
|
65
|
-
|
|
66
|
-
|
|
64
|
+
f,
|
|
65
|
+
g + 1,
|
|
66
|
+
s
|
|
67
67
|
),
|
|
68
68
|
c
|
|
69
|
-
)), (
|
|
69
|
+
)), (r === "always" || x && r === "visible") && (e[e.length] = {
|
|
70
70
|
dataIndex: -1,
|
|
71
|
-
dataItem: t[
|
|
71
|
+
dataItem: t[p],
|
|
72
72
|
rowType: "groupFooter",
|
|
73
|
-
level:
|
|
73
|
+
level: g,
|
|
74
74
|
expanded: x
|
|
75
75
|
});
|
|
76
76
|
}
|
|
@@ -80,14 +80,14 @@ function W(e) {
|
|
|
80
80
|
return e && getComputedStyle(e).direction === "rtl" || !1;
|
|
81
81
|
}
|
|
82
82
|
function X(e, t) {
|
|
83
|
-
if (!t || !e || !e.originalEvent || !
|
|
83
|
+
if (!t || !e || !e.originalEvent || !F)
|
|
84
84
|
return -1;
|
|
85
|
-
let
|
|
86
|
-
for (;
|
|
87
|
-
|
|
88
|
-
const
|
|
89
|
-
for (let a = 0; a <
|
|
90
|
-
if (
|
|
85
|
+
let r = document.elementFromPoint(e.clientX, e.originalEvent.clientY);
|
|
86
|
+
for (; r && r.parentElement !== t; )
|
|
87
|
+
r = r.parentElement;
|
|
88
|
+
const n = t.children;
|
|
89
|
+
for (let a = 0; a < n.length; a++)
|
|
90
|
+
if (n[a] === r)
|
|
91
91
|
return a;
|
|
92
92
|
return -1;
|
|
93
93
|
}
|
|
@@ -104,82 +104,82 @@ const A = [
|
|
|
104
104
|
"dataStateChange",
|
|
105
105
|
"columnResize",
|
|
106
106
|
"columnReorder"
|
|
107
|
-
],
|
|
107
|
+
], L = (e, t) => `The ${e} event handler property is deprecated, use https://www.telerik.com/kendo-vue-ui/components/grid/api/GridProps/#toc-${t} instead`;
|
|
108
108
|
function Y(e) {
|
|
109
109
|
for (let t = 0; t < A.length; t++) {
|
|
110
|
-
const
|
|
111
|
-
if (e[
|
|
112
|
-
const
|
|
113
|
-
console.warn(
|
|
110
|
+
const r = A[t];
|
|
111
|
+
if (e[r] !== void 0) {
|
|
112
|
+
const n = "on" + r.charAt(0).toUpperCase() + r.slice(1);
|
|
113
|
+
console.warn(L(r, n));
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
function
|
|
118
|
-
const
|
|
119
|
-
let
|
|
117
|
+
function J(e, t) {
|
|
118
|
+
const r = [[]];
|
|
119
|
+
let n = 0;
|
|
120
120
|
for (let i = e.length - 1; i >= 0; i--)
|
|
121
|
-
|
|
122
|
-
(o,
|
|
121
|
+
n = Math.max(n, e[i].depth), e[i].headerColSpan = e[i].headerColSpan || 1, e[i].children.length > 0 && (e[i].headerColSpan = e[i].children.reduce(
|
|
122
|
+
(o, h) => h.hidden ? o : o + h.headerColSpan,
|
|
123
123
|
0
|
|
124
124
|
));
|
|
125
125
|
const a = [];
|
|
126
|
-
let
|
|
126
|
+
let d = 1;
|
|
127
127
|
return e.forEach((i, o) => {
|
|
128
|
-
|
|
129
|
-
let
|
|
130
|
-
|
|
131
|
-
let
|
|
132
|
-
const
|
|
128
|
+
r[i.depth] = r[i.depth] || [];
|
|
129
|
+
let h = !1;
|
|
130
|
+
r[i.depth].length === 0 && (d <= 1 ? d = 1 + (i.children.length > 0 ? 0 : n - i.depth) : (d--, h = !0)), i.rowSpan = 1 + (i.children.length > 0 ? 0 : n - i.depth), i.kFirst = h, i.index = r[i.depth].length, i.ariaColumnIndex = a[i.depth] ? a[i.depth] + 1 : 1;
|
|
131
|
+
let f = 0;
|
|
132
|
+
const g = [], l = /* @__PURE__ */ new Set();
|
|
133
133
|
let c = i.parentIndex;
|
|
134
|
-
for (; c >= 0 && !
|
|
135
|
-
|
|
136
|
-
for (let
|
|
137
|
-
const x =
|
|
138
|
-
for (let
|
|
139
|
-
const
|
|
140
|
-
|
|
134
|
+
for (; c >= 0 && !l.has(c); )
|
|
135
|
+
l.add(c), g.unshift(c), c = e[c].parentIndex;
|
|
136
|
+
for (let s = 0; s < g.length; s++) {
|
|
137
|
+
const x = g[s], u = e[x], w = r[u.depth], y = w.indexOf(x);
|
|
138
|
+
for (let I = 0; I < y; I++) {
|
|
139
|
+
const C = w[I];
|
|
140
|
+
f += e[C].headerColSpan;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
for (let
|
|
144
|
-
const x =
|
|
145
|
-
let
|
|
146
|
-
for (const
|
|
147
|
-
const
|
|
148
|
-
|
|
143
|
+
for (let s = 0; s < i.depth; s++) {
|
|
144
|
+
const x = r[s] || [], w = (r[i.depth] || []).indexOf(o);
|
|
145
|
+
let y = 0;
|
|
146
|
+
for (const I of x) {
|
|
147
|
+
const C = e[I];
|
|
148
|
+
y < w && C.depth + C.rowSpan - 1 >= i.depth && (g.includes(I) || (f += C.headerColSpan)), y += C.headerColSpan;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
const
|
|
152
|
-
for (const
|
|
153
|
-
const x = e[
|
|
154
|
-
x.parentIndex === i.parentIndex && (
|
|
151
|
+
const p = r[i.depth];
|
|
152
|
+
for (const s of p) {
|
|
153
|
+
const x = e[s];
|
|
154
|
+
x.parentIndex === i.parentIndex && (f += x.headerColSpan);
|
|
155
155
|
}
|
|
156
|
-
i.virtualColumnOffset =
|
|
157
|
-
for (let
|
|
158
|
-
a[
|
|
159
|
-
}),
|
|
156
|
+
i.virtualColumnOffset = f, r[i.depth].push(o);
|
|
157
|
+
for (let s = i.depth; s < i.depth + i.rowSpan; s++)
|
|
158
|
+
a[s] = (a[s] || 0) + i.headerColSpan;
|
|
159
|
+
}), T(r, e, t), O(r, e, t), r;
|
|
160
160
|
}
|
|
161
|
-
function
|
|
162
|
-
const
|
|
161
|
+
function N(e, t, r, n = 0, a = !1) {
|
|
162
|
+
const d = [];
|
|
163
163
|
if (!e)
|
|
164
164
|
return [];
|
|
165
|
-
e && e.length === void 0 && (e = [e]), e.forEach((o,
|
|
165
|
+
e && e.length === void 0 && (e = [e]), e.forEach((o, h) => {
|
|
166
166
|
o = o;
|
|
167
|
-
const
|
|
168
|
-
|
|
167
|
+
const f = o.id ? o.id : R.generateNavigatableId(`${r.prevId++}`, r.idPrefix, "column"), g = F && o.media && window.matchMedia ? !window.matchMedia(o.media).matches : !1, l = a || g || o.hidden, c = t == null ? void 0 : t.find((s) => s.id === f), p = N(o.children, (c == null ? void 0 : c.children) || [], r, n + 1, l);
|
|
168
|
+
d.push(
|
|
169
169
|
{
|
|
170
|
-
depth:
|
|
171
|
-
...
|
|
172
|
-
...
|
|
170
|
+
depth: n,
|
|
171
|
+
...b,
|
|
172
|
+
...p.length ? { cell: () => null, filterCell: () => null } : {},
|
|
173
173
|
...o,
|
|
174
|
-
id:
|
|
175
|
-
declarationIndex:
|
|
176
|
-
children:
|
|
174
|
+
id: f,
|
|
175
|
+
declarationIndex: d.length,
|
|
176
|
+
children: p,
|
|
177
177
|
headerColSpan: 0,
|
|
178
178
|
rowSpan: 0,
|
|
179
179
|
columnType: o.columnType || "data",
|
|
180
180
|
colSpan: o.colSpan || 1,
|
|
181
181
|
isAccessible: !0,
|
|
182
|
-
hidden:
|
|
182
|
+
hidden: l,
|
|
183
183
|
left: null,
|
|
184
184
|
right: null,
|
|
185
185
|
rowSpannable: o.rowSpannable,
|
|
@@ -187,27 +187,27 @@ function H(e, t, n, r = 0, a = !1) {
|
|
|
187
187
|
}
|
|
188
188
|
);
|
|
189
189
|
});
|
|
190
|
-
const i = (o,
|
|
191
|
-
if (
|
|
192
|
-
const o = [],
|
|
193
|
-
|
|
190
|
+
const i = (o, h) => o.orderIndex === h.orderIndex ? o.declarationIndex - h.declarationIndex : (o.orderIndex || 0) - (h.orderIndex || 0);
|
|
191
|
+
if (d.sort(i), n === 0) {
|
|
192
|
+
const o = [], h = (f, g) => f.forEach((l) => {
|
|
193
|
+
l.parentIndex = g, h(l.children, o.push(l) - 1);
|
|
194
194
|
});
|
|
195
|
-
return d
|
|
195
|
+
return h(d, -1), o;
|
|
196
196
|
}
|
|
197
|
-
return
|
|
197
|
+
return d;
|
|
198
198
|
}
|
|
199
199
|
const j = (e) => Array.isArray(e) ? e : e ? e.data : [];
|
|
200
|
-
function
|
|
201
|
-
const a = j(e),
|
|
200
|
+
function Q(e, t, r, n) {
|
|
201
|
+
const a = j(e), d = [];
|
|
202
202
|
if (a.length > 0) {
|
|
203
203
|
let i = a[0];
|
|
204
204
|
if (t)
|
|
205
|
-
for (let
|
|
205
|
+
for (let h = 0; h < t.length; h++)
|
|
206
206
|
i = i.items && i.items[0];
|
|
207
|
-
Object.getOwnPropertyNames(i).forEach((
|
|
208
|
-
|
|
207
|
+
Object.getOwnPropertyNames(i).forEach((h) => {
|
|
208
|
+
h !== r.column && d.push(
|
|
209
209
|
{
|
|
210
|
-
id: R.generateNavigatableId(`${
|
|
210
|
+
id: R.generateNavigatableId(`${n.prevId++}`, n.idPrefix, "column"),
|
|
211
211
|
declarationIndex: -1,
|
|
212
212
|
parentIndex: -1,
|
|
213
213
|
depth: 0,
|
|
@@ -222,103 +222,135 @@ function J(e, t, n, r) {
|
|
|
222
222
|
children: [],
|
|
223
223
|
ariaColumnIndex: 0,
|
|
224
224
|
isAccessible: !0,
|
|
225
|
-
...
|
|
226
|
-
field:
|
|
225
|
+
...b,
|
|
226
|
+
field: h
|
|
227
227
|
}
|
|
228
228
|
);
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
|
-
return
|
|
231
|
+
return d;
|
|
232
232
|
}
|
|
233
233
|
const $ = (e, t) => {
|
|
234
|
-
var
|
|
235
|
-
let
|
|
236
|
-
for (;
|
|
237
|
-
if (
|
|
234
|
+
var n;
|
|
235
|
+
let r = e[t.parentIndex];
|
|
236
|
+
for (; r; ) {
|
|
237
|
+
if (r.footerCell || (n = r.cells) != null && n.footerCell)
|
|
238
238
|
return !0;
|
|
239
|
-
|
|
239
|
+
r = e[r.parentIndex];
|
|
240
240
|
}
|
|
241
241
|
return !1;
|
|
242
|
-
},
|
|
243
|
-
var
|
|
244
|
-
return $(e, t) ? !1 : !!(t.footerCell || (
|
|
245
|
-
}),
|
|
246
|
-
number: function(e, t,
|
|
247
|
-
return typeof e ===
|
|
242
|
+
}, Z = (e) => e.filter((t) => {
|
|
243
|
+
var r;
|
|
244
|
+
return $(e, t) ? !1 : !!(t.footerCell || (r = t.cells) != null && r.footerCell) || !(t.children && t.children.length > 0);
|
|
245
|
+
}), _ = {
|
|
246
|
+
number: function(e, t, r) {
|
|
247
|
+
return typeof e === S && e.toLowerCase() === "null" ? null : t.parseNumber(e, r);
|
|
248
248
|
},
|
|
249
|
-
date: function(e, t,
|
|
250
|
-
return typeof e ===
|
|
249
|
+
date: function(e, t, r) {
|
|
250
|
+
return typeof e === S && e.toLowerCase() === "null" ? null : t.parseDate(e, r);
|
|
251
251
|
},
|
|
252
252
|
boolean: function(e) {
|
|
253
|
-
return typeof e ===
|
|
253
|
+
return typeof e === S ? e.toLowerCase() === "null" ? null : e.toLowerCase() === "true" : e != null ? !!e : e;
|
|
254
254
|
},
|
|
255
255
|
string: function(e) {
|
|
256
|
-
return typeof e ===
|
|
256
|
+
return typeof e === S && e.toLowerCase() === "null" ? null : e != null ? e + "" : e;
|
|
257
257
|
},
|
|
258
258
|
default: function(e) {
|
|
259
259
|
return e;
|
|
260
260
|
}
|
|
261
261
|
};
|
|
262
|
-
function
|
|
262
|
+
function M(e, t, r, n) {
|
|
263
263
|
return e.forEach((a) => {
|
|
264
|
-
a.expanded = t[
|
|
264
|
+
a.expanded = t[n] && !t[n].includes(D(a, r)), a.items && a.items.length && (a.items = M(a.items, t, r, n + 1));
|
|
265
265
|
}), e;
|
|
266
266
|
}
|
|
267
|
-
function
|
|
268
|
-
return t && t.length && e.data.forEach((
|
|
269
|
-
|
|
267
|
+
function q(e, t, r) {
|
|
268
|
+
return t && t.length && e.data.forEach((n) => {
|
|
269
|
+
n.expanded = n.expanded !== void 0 ? n.expanded : t[0] && !t[0].includes(D(n, r)), n.items && n.items.length && (n.items = M(n.items, t, r, 1));
|
|
270
270
|
}), e;
|
|
271
271
|
}
|
|
272
|
-
function
|
|
273
|
-
let
|
|
274
|
-
for (;
|
|
275
|
-
|
|
276
|
-
return t ?
|
|
272
|
+
function D(e, t) {
|
|
273
|
+
let r = e;
|
|
274
|
+
for (; r.items && r.items.length; )
|
|
275
|
+
r = r.items[0];
|
|
276
|
+
return t ? r[t] : e.value;
|
|
277
277
|
}
|
|
278
|
-
const
|
|
279
|
-
const t = [],
|
|
280
|
-
t.push(a),
|
|
278
|
+
const G = (e) => {
|
|
279
|
+
const t = [], r = (n) => n == null ? void 0 : n.forEach((a) => {
|
|
280
|
+
t.push(a), r(a.children);
|
|
281
281
|
});
|
|
282
|
-
return
|
|
283
|
-
},
|
|
284
|
-
const { declarationIndex:
|
|
285
|
-
return
|
|
286
|
-
children: B(
|
|
287
|
-
...
|
|
288
|
-
} :
|
|
289
|
-
})),
|
|
290
|
-
var
|
|
291
|
-
const t = typeof e == "object" ? (
|
|
292
|
-
return { enabled: t, valueGetter:
|
|
282
|
+
return r(e), t;
|
|
283
|
+
}, m = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), ee = 17895697, te = (e) => e.width !== void 0 ? Math.floor(parseFloat(e.width.toString())) + "px" : void 0, re = (e, t) => t && t.filter((r) => r.field === e).length > 0, B = (e) => (e.sort((t, r) => t.declarationIndex - r.declarationIndex), e.map((t) => {
|
|
284
|
+
const { declarationIndex: r, parentIndex: n, depth: a, headerColSpan: d, rowSpan: i, index: o, kFirst: h, children: f, ...g } = t;
|
|
285
|
+
return f.length ? {
|
|
286
|
+
children: B(f),
|
|
287
|
+
...g
|
|
288
|
+
} : g;
|
|
289
|
+
})), ne = (e, t) => typeof e.colSpan == "function" ? e.colSpan({ dataItem: t, column: e }) : e.colSpan || 1, ie = (e) => {
|
|
290
|
+
var n, a;
|
|
291
|
+
const t = typeof e == "object" ? (n = e.enabled) != null ? n : !0 : e != null ? e : !1, r = typeof e == "object" ? (a = e.valueGetter) != null ? a : ((d, i) => E(i)(d)) : (d, i) => E(i)(d);
|
|
292
|
+
return { enabled: t, valueGetter: r };
|
|
293
293
|
}, ae = (e) => {
|
|
294
294
|
let t = 0;
|
|
295
295
|
if (e) {
|
|
296
|
-
const
|
|
297
|
-
|
|
296
|
+
const r = e.insertRow(0), n = r.insertCell(0);
|
|
297
|
+
n.textContent = " ", t = r.getBoundingClientRect().height, e.deleteRow(0);
|
|
298
298
|
}
|
|
299
299
|
return t;
|
|
300
|
+
}, oe = (e, t) => {
|
|
301
|
+
var r, n, a, d, i, o;
|
|
302
|
+
if (!(!e && !t))
|
|
303
|
+
return t ? e ? {
|
|
304
|
+
headerCell: (r = t.headerCell) != null ? r : e.headerCell,
|
|
305
|
+
filterCell: (n = t.filterCell) != null ? n : e.filterCell,
|
|
306
|
+
footerCell: (a = t.footerCell) != null ? a : e.footerCell,
|
|
307
|
+
groupHeader: (d = t.groupHeader) != null ? d : e.groupHeader,
|
|
308
|
+
data: (i = t.data) != null ? i : e.data,
|
|
309
|
+
groupFooter: (o = t.groupFooter) != null ? o : e.groupFooter,
|
|
310
|
+
select: {
|
|
311
|
+
...e.select || {},
|
|
312
|
+
...t.select || {}
|
|
313
|
+
},
|
|
314
|
+
hierarchy: {
|
|
315
|
+
...e.hierarchy || {},
|
|
316
|
+
...t.hierarchy || {}
|
|
317
|
+
},
|
|
318
|
+
group: {
|
|
319
|
+
...e.group || {},
|
|
320
|
+
...t.group || {}
|
|
321
|
+
},
|
|
322
|
+
edit: {
|
|
323
|
+
...e.edit || {},
|
|
324
|
+
...t.edit || {}
|
|
325
|
+
},
|
|
326
|
+
pin: {
|
|
327
|
+
...e.pin || {},
|
|
328
|
+
...t.pin || {}
|
|
329
|
+
}
|
|
330
|
+
} : t : e;
|
|
300
331
|
};
|
|
301
332
|
export {
|
|
302
|
-
|
|
303
|
-
|
|
333
|
+
q as applyExpandedState,
|
|
334
|
+
Q as autoGenerateColumns,
|
|
304
335
|
ae as calcRowHeight,
|
|
305
336
|
Y as checkPropCompatibility,
|
|
306
|
-
|
|
337
|
+
m as firefox,
|
|
307
338
|
ee as firefoxMaxHeight,
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
339
|
+
k as flatData,
|
|
340
|
+
Z as footerColumns,
|
|
341
|
+
ne as getColSpan,
|
|
311
342
|
te as getColumnWidth,
|
|
312
343
|
j as getDataAsArray,
|
|
313
|
-
|
|
344
|
+
G as getFlatColumnsState,
|
|
314
345
|
X as getIndex,
|
|
315
346
|
v as getNestedValue,
|
|
316
347
|
ie as getRowSpanOptions,
|
|
317
|
-
|
|
348
|
+
D as groupedFirstItemValue,
|
|
318
349
|
W as isRtl,
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
350
|
+
re as isSorted,
|
|
351
|
+
J as mapColumns,
|
|
352
|
+
_ as parsers,
|
|
353
|
+
N as readColumns,
|
|
354
|
+
oe as resolveCells,
|
|
323
355
|
B as sanitizeColumns
|
|
324
356
|
};
|
package/utils/virtualColumns.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function B(d,n,e){let s=0,p=!1;if(e>0&&n)for(let t=0;t<e;t++){const c=n[t]||[];for(let u=0;u<c.length;u++){const h=c[u],S=d[h];(S.rowSpan||1)>e-t&&(s+=S.headerColSpan||1,u===0&&(p=!0))}}return{emptyColSpan:s,skipOffset:p}}function w(d,n){const e=d[n];return!e||e.parentIndex<0?[]:[e.parentIndex,...w(d,e.parentIndex)]}function L(d,n,e){n.forEach(s=>{w(d,s).forEach(t=>e.add(t))})}function b(d,n,e){var p;const s=d[n];((p=s==null?void 0:s.children)==null?void 0:p.length)>0&&s.children.forEach(t=>{let c=typeof t=="number"?t:d.indexOf(t);c>=0&&!e.has(c)&&(e.add(c),b(d,c,e))})}function j(d){const{cellsToRender:n,columns:e,rowIndex:s,enableVirtualization:p,columnsMap:t}=d;if(!p||!n||n.length===0)return{columnsToRender:[],colSpans:[]};const c=[],u=[];let h=-1,S=-1;function I(o,r){let a=-1,i=-1;for(let f=0;f<r.length;f++)o[r[f]].locked||(a===-1&&(a=f),i=f);return{first:a,last:i}}const E=n.reduce((o,r)=>o+r.colSpan,0);let R=0;for(const o of n){const r=e[o.columnIndex];if(r!=null&&r.locked)R+=o.colSpan;else break}const l=E-R;let V=[],x=[];const P=e.filter(o=>o.children.length===0),A=new Map;e.forEach((o,r)=>{if(o.children.length===0){const a=P.findIndex(i=>i===o);a>=0&&A.set(a,r)}});const k=new Set;if(n.forEach(o=>{const r=A.get(o.columnIndex);if(r!==void 0){k.add(r);const a=w(e,r);a.forEach(i=>k.add(i)),L(e,a,k),b(e,r,k),a.forEach(i=>{b(e,i,k)})}}),t&&Array.isArray(t)){for(let o=0;o<t.length;o++)V[o]=t[o].filter(r=>k.has(r));x=V[s]||[]}const M=I(e,x);h=M.first,S=M.last;let U=0;for(let o=0;o<h;o++){const r=e[x[o]];r!=null&&r.locked&&(U+=r.headerColSpan||1)}let v=0,y=0,F=!1;return x.forEach((o,r)=>{c.push(o);const a=e[o],i=(a==null?void 0:a.headerColSpan)||1;let f;if(h===S)f=l;else if(r===h){const T=a.virtualColumnOffset?a.virtualColumnOffset:0,{emptyColSpan:C,skipOffset:g}=B(e,V,s);y+=C;const m=Math.max(0,T-U);g&&(y+=m,F=!0),m>0&&!g?f=i+m:f=i}else if(r===S){let T=r===x.length-1;if(t!=null&&t[s]){const C=t[s],g=o;let m=-1;for(let O=C.length-1;O>=0;O--)if(!e[C[O]].locked){m=C[O];break}T=g===m}if(T)f=i;else{const C=l-v-y;if(f=Math.max(C,i),i>C&&u.length>0){const g=i-C;u[0]-=g}}}else f=i;u.push(f),v+=f}),{columnsToRender:c,colSpans:u,skipOffset:F}}function D(d){const{cellModels:n,columns:e=[],tableViewPortWidth:s,scrollLeft:p}=d;let t=0,c=n.length-1,u=0,h=0;for(let l=0;l<n.length;l++)if(!e[n[l].columnIndex].locked&&(u=h,h+=n[l].width||10,h>=p)){t=l;break}for(let l=t;l<n.length;l++)if(!e[n[l].columnIndex].locked)if(u<s+p)u+=n[l].width||10,c=l;else break;t>0&&t--,c<n.length-1&&c++;let S=0,I=0;for(let l=0;l<t;l++)e[n[l].columnIndex].locked||(S+=n[l].colSpan);for(let l=c+1;l<n.length;l++)e[n[l].columnIndex].locked||(I+=n[l].colSpan);n[t].colSpan+=S,n[c].colSpan+=I;const E=n.slice(0,t).filter(l=>e[l.columnIndex].locked),R=n.slice(c+1).filter(l=>e[l.columnIndex].locked);return[...E,...n.slice(t,c+1),...R]}exports.addAllAncestors=L;exports.addDescendants=b;exports.getParentIndices=w;exports.getVirtualCellsToRender=D;exports.getVirtualHeaderCellsToRender=j;
|