@progress/kendo-vue-grid 8.0.0-develop.1 → 8.0.0-develop.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/Grid.js +1 -1
- package/Grid.mjs +192 -187
- package/GridSearchBox.js +1 -1
- package/GridSearchBox.mjs +10 -9
- package/common.js +1 -1
- package/common.mjs +1 -1
- package/dist/cdn/js/kendo-vue-grid.js +1 -1
- package/index.d.mts +14 -11
- package/index.d.ts +14 -11
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +12 -12
- package/rows/GridRow.js +1 -1
- package/rows/GridRow.mjs +13 -10
- package/utils/main.js +1 -1
- package/utils/main.mjs +145 -145
package/utils/main.mjs
CHANGED
|
@@ -5,93 +5,93 @@
|
|
|
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 S, canUseDOM as
|
|
10
|
-
import { gridDefaultProps as
|
|
8
|
+
import { findGroupExpand as T, updateLeft as k, updateRight as L, tableKeyboardNavigationTools as A } from "@progress/kendo-vue-data-tools";
|
|
9
|
+
import { getter as S, canUseDOM as b } from "@progress/kendo-vue-common";
|
|
10
|
+
import { gridDefaultProps as R } from "../GridColumn.mjs";
|
|
11
11
|
const u = "string";
|
|
12
12
|
function y(e, t) {
|
|
13
13
|
const n = e.split(".");
|
|
14
14
|
let i = t;
|
|
15
|
-
return n.forEach((
|
|
16
|
-
i = i ? i[
|
|
15
|
+
return n.forEach((a) => {
|
|
16
|
+
i = i ? i[a] : void 0;
|
|
17
17
|
}), i;
|
|
18
18
|
}
|
|
19
|
-
function N(e, t, n, i,
|
|
20
|
-
let
|
|
21
|
-
for (let
|
|
22
|
-
let
|
|
23
|
-
if (!
|
|
24
|
-
const C =
|
|
19
|
+
function N(e, t, n, i, a, s, r, d, o, h, p = 0, f) {
|
|
20
|
+
let c = p;
|
|
21
|
+
for (let g = 0; g < t.length; g++) {
|
|
22
|
+
let l;
|
|
23
|
+
if (!a || t[g].value === void 0 || t[g].items === void 0) {
|
|
24
|
+
const C = o ? !!(s != null && s[S(o)(t[g])]) : !1;
|
|
25
25
|
e[e.length] = {
|
|
26
26
|
dataIndex: i.index,
|
|
27
|
-
dataItem: t[
|
|
27
|
+
dataItem: t[g],
|
|
28
28
|
rowType: "data",
|
|
29
|
-
level:
|
|
30
|
-
group:
|
|
29
|
+
level: p,
|
|
30
|
+
group: f,
|
|
31
31
|
// This is related to detail-row expansion
|
|
32
|
-
expanded:
|
|
32
|
+
expanded: h !== void 0 ? y(h, t[g]) : C != null ? C : !1
|
|
33
33
|
}, i.index++;
|
|
34
34
|
continue;
|
|
35
35
|
} else {
|
|
36
36
|
let C;
|
|
37
|
-
|
|
38
|
-
field: t[
|
|
39
|
-
value: t[
|
|
37
|
+
f != null && f.parents ? C = [{ field: f.field, value: f.value }, ...f.parents] : f ? C = [f] : C = [], l = {
|
|
38
|
+
field: t[g].field,
|
|
39
|
+
value: t[g].value,
|
|
40
40
|
parents: C
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
|
-
|
|
44
|
-
let
|
|
45
|
-
const w =
|
|
46
|
-
|
|
43
|
+
c = Math.max(c, p + 1);
|
|
44
|
+
let x = !1;
|
|
45
|
+
const w = T(r || [], l);
|
|
46
|
+
h ? x = h === void 0 || y(h, t[g]) === void 0 || y(h, t[g]) : x = w ? w.expanded !== !1 : d !== !1, e[e.length] = {
|
|
47
47
|
dataIndex: -1,
|
|
48
|
-
dataItem: t[
|
|
49
|
-
level:
|
|
50
|
-
group:
|
|
48
|
+
dataItem: t[g],
|
|
49
|
+
level: p,
|
|
50
|
+
group: l,
|
|
51
51
|
rowType: "groupHeader",
|
|
52
|
-
expanded:
|
|
53
|
-
},
|
|
52
|
+
expanded: x
|
|
53
|
+
}, x && (l.expanded = x, c = Math.max(
|
|
54
54
|
N(
|
|
55
55
|
e,
|
|
56
|
-
t[
|
|
56
|
+
t[g].items,
|
|
57
57
|
n,
|
|
58
58
|
i,
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
a,
|
|
60
|
+
s,
|
|
61
61
|
r,
|
|
62
|
+
d,
|
|
62
63
|
o,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
x
|
|
64
|
+
h,
|
|
65
|
+
p + 1,
|
|
66
|
+
l
|
|
67
67
|
),
|
|
68
|
-
|
|
69
|
-
)), (n === "always" ||
|
|
68
|
+
c
|
|
69
|
+
)), (n === "always" || x && n === "visible") && (e[e.length] = {
|
|
70
70
|
dataIndex: -1,
|
|
71
|
-
dataItem: t[
|
|
71
|
+
dataItem: t[g],
|
|
72
72
|
rowType: "groupFooter",
|
|
73
|
-
level:
|
|
74
|
-
expanded:
|
|
73
|
+
level: p,
|
|
74
|
+
expanded: x
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
|
-
return
|
|
77
|
+
return c;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function U(e) {
|
|
80
80
|
return e && getComputedStyle(e).direction === "rtl" || !1;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
83
|
-
if (!t || !e || !e.originalEvent || !
|
|
82
|
+
function V(e, t) {
|
|
83
|
+
if (!t || !e || !e.originalEvent || !b)
|
|
84
84
|
return -1;
|
|
85
85
|
let n = document.elementFromPoint(e.clientX, e.originalEvent.clientY);
|
|
86
86
|
for (; n && n.parentElement !== t; )
|
|
87
87
|
n = n.parentElement;
|
|
88
88
|
const i = t.children;
|
|
89
|
-
for (let
|
|
90
|
-
if (i[
|
|
91
|
-
return
|
|
89
|
+
for (let a = 0; a < i.length; a++)
|
|
90
|
+
if (i[a] === n)
|
|
91
|
+
return a;
|
|
92
92
|
return -1;
|
|
93
93
|
}
|
|
94
|
-
const
|
|
94
|
+
const E = [
|
|
95
95
|
"sortChange",
|
|
96
96
|
"filterChange",
|
|
97
97
|
"groupChange",
|
|
@@ -105,9 +105,9 @@ const v = [
|
|
|
105
105
|
"columnResize",
|
|
106
106
|
"columnReorder"
|
|
107
107
|
], O = (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
|
-
function
|
|
109
|
-
for (let t = 0; t <
|
|
110
|
-
const n =
|
|
108
|
+
function P(e) {
|
|
109
|
+
for (let t = 0; t < E.length; t++) {
|
|
110
|
+
const n = E[t];
|
|
111
111
|
if (e[n] !== void 0) {
|
|
112
112
|
const i = "on" + n.charAt(0).toUpperCase() + n.slice(1);
|
|
113
113
|
console.warn(O(n, i));
|
|
@@ -119,92 +119,92 @@ function W(e, t) {
|
|
|
119
119
|
let i = 0;
|
|
120
120
|
for (let r = e.length - 1; r >= 0; r--)
|
|
121
121
|
i = Math.max(i, e[r].depth), e[r].headerColSpan = e[r].headerColSpan || 1, e[r].children.length > 0 && (e[r].headerColSpan = e[r].children.reduce(
|
|
122
|
-
(
|
|
122
|
+
(d, o) => o.hidden ? d : d + o.headerColSpan,
|
|
123
123
|
0
|
|
124
124
|
));
|
|
125
|
-
const
|
|
126
|
-
let
|
|
127
|
-
return e.forEach((r,
|
|
125
|
+
const a = [];
|
|
126
|
+
let s = 1;
|
|
127
|
+
return e.forEach((r, d) => {
|
|
128
128
|
n[r.depth] = n[r.depth] || [];
|
|
129
|
-
let
|
|
130
|
-
n[r.depth].length === 0 && (
|
|
131
|
-
let
|
|
132
|
-
const
|
|
133
|
-
let
|
|
134
|
-
for (;
|
|
135
|
-
c.unshift(
|
|
136
|
-
for (let
|
|
137
|
-
const x =
|
|
138
|
-
for (let I = 0; I <
|
|
139
|
-
const
|
|
140
|
-
|
|
129
|
+
let o = !1;
|
|
130
|
+
n[r.depth].length === 0 && (s <= 1 ? s = 1 + (r.children.length > 0 ? 0 : i - r.depth) : (s--, o = !0)), r.rowSpan = 1 + (r.children.length > 0 ? 0 : i - r.depth), r.kFirst = o, r.index = n[r.depth].length, r.ariaColumnIndex = a[r.depth] ? a[r.depth] + 1 : 1;
|
|
131
|
+
let h = 0;
|
|
132
|
+
const p = [], f = /* @__PURE__ */ new Set();
|
|
133
|
+
let c = r.parentIndex;
|
|
134
|
+
for (; c >= 0 && !f.has(c); )
|
|
135
|
+
f.add(c), p.unshift(c), c = e[c].parentIndex;
|
|
136
|
+
for (let l = 0; l < p.length; l++) {
|
|
137
|
+
const x = p[l], w = e[x], C = n[w.depth], v = C.indexOf(x);
|
|
138
|
+
for (let I = 0; I < v; I++) {
|
|
139
|
+
const F = C[I];
|
|
140
|
+
h += e[F].headerColSpan;
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
|
-
for (let
|
|
144
|
-
const x = n[
|
|
145
|
-
for (
|
|
146
|
-
const
|
|
147
|
-
C.depth + C.rowSpan - 1 >= r.depth && (
|
|
143
|
+
for (let l = 0; l < r.depth; l++) {
|
|
144
|
+
const x = n[l] || [];
|
|
145
|
+
for (const w of x) {
|
|
146
|
+
const C = e[w];
|
|
147
|
+
C.depth + C.rowSpan - 1 >= r.depth && (p.includes(w) || (h += C.headerColSpan));
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
|
-
const
|
|
151
|
-
for (
|
|
152
|
-
const x =
|
|
153
|
-
|
|
150
|
+
const g = n[r.depth];
|
|
151
|
+
for (const l of g) {
|
|
152
|
+
const x = e[l];
|
|
153
|
+
x.parentIndex === r.parentIndex && (h += x.headerColSpan);
|
|
154
154
|
}
|
|
155
|
-
r.virtualColumnOffset =
|
|
156
|
-
for (let
|
|
157
|
-
|
|
158
|
-
}),
|
|
155
|
+
r.virtualColumnOffset = h, n[r.depth].push(d);
|
|
156
|
+
for (let l = r.depth; l < r.depth + r.rowSpan; l++)
|
|
157
|
+
a[l] = (a[l] || 0) + r.headerColSpan;
|
|
158
|
+
}), k(n, e, t), L(n, e, t), n;
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
const
|
|
160
|
+
function H(e, t, n, i = 0, a = !1) {
|
|
161
|
+
const s = [];
|
|
162
162
|
if (!e)
|
|
163
163
|
return [];
|
|
164
|
-
e && e.length === void 0 && (e = [e]), e.forEach((
|
|
165
|
-
|
|
166
|
-
const
|
|
167
|
-
|
|
164
|
+
e && e.length === void 0 && (e = [e]), e.forEach((d, o) => {
|
|
165
|
+
d = d;
|
|
166
|
+
const h = d.id ? d.id : A.generateNavigatableId(`${n.prevId++}`, n.idPrefix, "column"), p = b && d.media && window.matchMedia ? !window.matchMedia(d.media).matches : !1, f = a || p || d.hidden, c = t == null ? void 0 : t.find((l) => l.id === h), g = H(d.children, (c == null ? void 0 : c.children) || [], n, i + 1, f);
|
|
167
|
+
s.push(
|
|
168
168
|
{
|
|
169
169
|
depth: i,
|
|
170
|
-
...
|
|
171
|
-
...
|
|
172
|
-
...
|
|
173
|
-
id:
|
|
174
|
-
declarationIndex:
|
|
175
|
-
children:
|
|
170
|
+
...R,
|
|
171
|
+
...g.length ? { cell: () => null, filterCell: () => null } : {},
|
|
172
|
+
...d,
|
|
173
|
+
id: h,
|
|
174
|
+
declarationIndex: s.length,
|
|
175
|
+
children: g,
|
|
176
176
|
headerColSpan: 0,
|
|
177
177
|
rowSpan: 0,
|
|
178
|
-
columnType:
|
|
179
|
-
colSpan:
|
|
178
|
+
columnType: d.columnType || "data",
|
|
179
|
+
colSpan: d.colSpan || 1,
|
|
180
180
|
isAccessible: !0,
|
|
181
|
-
hidden:
|
|
181
|
+
hidden: f,
|
|
182
182
|
left: null,
|
|
183
183
|
right: null,
|
|
184
|
-
rowSpannable:
|
|
185
|
-
...
|
|
184
|
+
rowSpannable: d.rowSpannable,
|
|
185
|
+
...c ? { width: c.width, orderIndex: c.orderIndex } : {}
|
|
186
186
|
}
|
|
187
187
|
);
|
|
188
188
|
});
|
|
189
|
-
const r = (
|
|
190
|
-
if (
|
|
191
|
-
const
|
|
192
|
-
|
|
189
|
+
const r = (d, o) => d.orderIndex === o.orderIndex ? d.declarationIndex - o.declarationIndex : (d.orderIndex || 0) - (o.orderIndex || 0);
|
|
190
|
+
if (s.sort(r), i === 0) {
|
|
191
|
+
const d = [], o = (h, p) => h.forEach((f) => {
|
|
192
|
+
f.parentIndex = p, o(f.children, d.push(f) - 1);
|
|
193
193
|
});
|
|
194
|
-
return s
|
|
194
|
+
return o(s, -1), d;
|
|
195
195
|
}
|
|
196
|
-
return
|
|
196
|
+
return s;
|
|
197
197
|
}
|
|
198
|
-
const
|
|
198
|
+
const j = (e) => Array.isArray(e) ? e : e ? e.data : [];
|
|
199
199
|
function X(e, t, n, i) {
|
|
200
|
-
const
|
|
201
|
-
if (
|
|
202
|
-
let r =
|
|
200
|
+
const a = j(e), s = [];
|
|
201
|
+
if (a.length > 0) {
|
|
202
|
+
let r = a[0];
|
|
203
203
|
if (t)
|
|
204
|
-
for (let
|
|
204
|
+
for (let o = 0; o < t.length; o++)
|
|
205
205
|
r = r.items && r.items[0];
|
|
206
|
-
Object.getOwnPropertyNames(r).forEach((
|
|
207
|
-
|
|
206
|
+
Object.getOwnPropertyNames(r).forEach((o) => {
|
|
207
|
+
o !== n.column && s.push(
|
|
208
208
|
{
|
|
209
209
|
id: A.generateNavigatableId(`${i.prevId++}`, i.idPrefix, "column"),
|
|
210
210
|
declarationIndex: -1,
|
|
@@ -221,15 +221,15 @@ function X(e, t, n, i) {
|
|
|
221
221
|
children: [],
|
|
222
222
|
ariaColumnIndex: 0,
|
|
223
223
|
isAccessible: !0,
|
|
224
|
-
...
|
|
225
|
-
field:
|
|
224
|
+
...R,
|
|
225
|
+
field: o
|
|
226
226
|
}
|
|
227
227
|
);
|
|
228
228
|
});
|
|
229
229
|
}
|
|
230
|
-
return
|
|
230
|
+
return s;
|
|
231
231
|
}
|
|
232
|
-
const
|
|
232
|
+
const $ = (e, t) => {
|
|
233
233
|
let n = e[t.parentIndex];
|
|
234
234
|
for (; n; ) {
|
|
235
235
|
if (n.footerCell)
|
|
@@ -237,7 +237,7 @@ const H = (e, t) => {
|
|
|
237
237
|
n = e[n.parentIndex];
|
|
238
238
|
}
|
|
239
239
|
return !1;
|
|
240
|
-
}, Y = (e) => e.filter((t) =>
|
|
240
|
+
}, Y = (e) => e.filter((t) => $(e, t) ? !1 : !!t.footerCell || !(t.children && t.children.length > 0)), J = {
|
|
241
241
|
number: function(e, t, n) {
|
|
242
242
|
return typeof e === u && e.toLowerCase() === "null" ? null : t.parseNumber(e, n);
|
|
243
243
|
},
|
|
@@ -255,11 +255,11 @@ const H = (e, t) => {
|
|
|
255
255
|
}
|
|
256
256
|
};
|
|
257
257
|
function M(e, t, n, i) {
|
|
258
|
-
return e.forEach((
|
|
259
|
-
|
|
258
|
+
return e.forEach((a) => {
|
|
259
|
+
a.expanded = t[i] && !t[i].includes(D(a, n)), a.items && a.items.length && (a.items = M(a.items, t, n, i + 1));
|
|
260
260
|
}), e;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function Q(e, t, n) {
|
|
263
263
|
return t && t.length && e.data.forEach((i) => {
|
|
264
264
|
i.expanded = i.expanded !== void 0 ? i.expanded : t[0] && !t[0].includes(D(i, n)), i.items && i.items.length && (i.items = M(i.items, t, n, 1));
|
|
265
265
|
}), e;
|
|
@@ -270,22 +270,22 @@ function D(e, t) {
|
|
|
270
270
|
n = n.items[0];
|
|
271
271
|
return t ? n[t] : e.value;
|
|
272
272
|
}
|
|
273
|
-
const
|
|
274
|
-
const t = [], n = (i) => i == null ? void 0 : i.forEach((
|
|
275
|
-
t.push(
|
|
273
|
+
const Z = (e) => {
|
|
274
|
+
const t = [], n = (i) => i == null ? void 0 : i.forEach((a) => {
|
|
275
|
+
t.push(a), n(a.children);
|
|
276
276
|
});
|
|
277
277
|
return n(e), t;
|
|
278
|
-
},
|
|
279
|
-
const { declarationIndex: n, parentIndex: i, depth:
|
|
280
|
-
return
|
|
281
|
-
children:
|
|
282
|
-
...
|
|
283
|
-
} :
|
|
284
|
-
})),
|
|
285
|
-
var i,
|
|
286
|
-
const t = typeof e == "object" ? (i = e.enabled) != null ? i : !0 : e != null ? e : !1, n = typeof e == "object" ? (
|
|
278
|
+
}, _ = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), q = 17895697, G = (e) => e.width !== void 0 ? Math.floor(parseFloat(e.width.toString())) + "px" : void 0, ee = (e, t) => t && t.filter((n) => n.field === e).length > 0, B = (e) => (e.sort((t, n) => t.declarationIndex - n.declarationIndex), e.map((t) => {
|
|
279
|
+
const { declarationIndex: n, parentIndex: i, depth: a, headerColSpan: s, rowSpan: r, index: d, kFirst: o, children: h, ...p } = t;
|
|
280
|
+
return h.length ? {
|
|
281
|
+
children: B(h),
|
|
282
|
+
...p
|
|
283
|
+
} : p;
|
|
284
|
+
})), te = (e, t) => typeof e.colSpan == "function" ? e.colSpan({ dataItem: t, column: e }) : e.colSpan || 1, ne = (e) => {
|
|
285
|
+
var i, a;
|
|
286
|
+
const t = typeof e == "object" ? (i = e.enabled) != null ? i : !0 : e != null ? e : !1, n = typeof e == "object" ? (a = e.valueGetter) != null ? a : (s, r) => S(r)(s) : (s, r) => S(r)(s);
|
|
287
287
|
return { enabled: t, valueGetter: n };
|
|
288
|
-
},
|
|
288
|
+
}, re = (e) => {
|
|
289
289
|
let t = 0;
|
|
290
290
|
if (e) {
|
|
291
291
|
const n = e.insertRow(0), i = n.insertCell(0);
|
|
@@ -294,26 +294,26 @@ const Q = (e) => {
|
|
|
294
294
|
return t;
|
|
295
295
|
};
|
|
296
296
|
export {
|
|
297
|
-
|
|
297
|
+
Q as applyExpandedState,
|
|
298
298
|
X as autoGenerateColumns,
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
299
|
+
re as calcRowHeight,
|
|
300
|
+
P as checkPropCompatibility,
|
|
301
|
+
_ as firefox,
|
|
302
|
+
q as firefoxMaxHeight,
|
|
303
303
|
N as flatData,
|
|
304
304
|
Y as footerColumns,
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
305
|
+
te as getColSpan,
|
|
306
|
+
G as getColumnWidth,
|
|
307
|
+
j as getDataAsArray,
|
|
308
|
+
Z as getFlatColumnsState,
|
|
309
|
+
V as getIndex,
|
|
310
310
|
y as getNestedValue,
|
|
311
|
-
|
|
311
|
+
ne as getRowSpanOptions,
|
|
312
312
|
D as groupedFirstItemValue,
|
|
313
|
-
|
|
314
|
-
|
|
313
|
+
U as isRtl,
|
|
314
|
+
ee as isSorted,
|
|
315
315
|
W as mapColumns,
|
|
316
316
|
J as parsers,
|
|
317
|
-
|
|
318
|
-
|
|
317
|
+
H as readColumns,
|
|
318
|
+
B as sanitizeColumns
|
|
319
319
|
};
|