@progress/kendo-react-grid 8.2.0-develop.3 → 8.2.0-develop.30
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 +228 -219
- package/cells/GridEditCell.js +1 -1
- package/cells/GridEditCell.mjs +27 -27
- package/dist/cdn/js/kendo-react-grid.js +1 -1
- package/footer/Footer.js +1 -1
- package/footer/Footer.mjs +7 -7
- package/header/FilterRow.js +1 -1
- package/header/FilterRow.mjs +1 -1
- package/header/Header.js +1 -1
- package/header/Header.mjs +1 -1
- package/index.d.mts +25 -9
- package/index.d.ts +25 -9
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/utils/index.js +1 -1
- package/utils/index.mjs +82 -82
package/utils/index.mjs
CHANGED
|
@@ -6,99 +6,99 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import { gridDefaultProps as
|
|
10
|
-
import { tableKeyboardNavigationTools as
|
|
11
|
-
function
|
|
9
|
+
import { gridDefaultProps as x } from "../GridColumn.mjs";
|
|
10
|
+
import { tableKeyboardNavigationTools as p } from "@progress/kendo-react-data-tools";
|
|
11
|
+
function l(e, r) {
|
|
12
12
|
const a = (e || "").split(".");
|
|
13
|
-
let
|
|
14
|
-
return a.forEach((
|
|
15
|
-
|
|
16
|
-
}),
|
|
13
|
+
let o = r;
|
|
14
|
+
return a.forEach((d) => {
|
|
15
|
+
o = o ? o[d] : void 0;
|
|
16
|
+
}), o;
|
|
17
17
|
}
|
|
18
|
-
function g(e, r, a,
|
|
19
|
-
let
|
|
20
|
-
for (let
|
|
21
|
-
if (!
|
|
18
|
+
function g(e, r, a, o, d, s, h = 0) {
|
|
19
|
+
let t = h;
|
|
20
|
+
for (let n = 0; n < r.length; n++) {
|
|
21
|
+
if (!d || r[n].value === void 0 || r[n].items === void 0) {
|
|
22
22
|
e[e.length] = {
|
|
23
|
-
dataIndex:
|
|
24
|
-
dataItem: r[
|
|
23
|
+
dataIndex: o.index,
|
|
24
|
+
dataItem: r[n],
|
|
25
25
|
rowType: "data",
|
|
26
|
-
level:
|
|
27
|
-
expanded:
|
|
28
|
-
},
|
|
26
|
+
level: h,
|
|
27
|
+
expanded: s === void 0 || l(s, r[n])
|
|
28
|
+
}, o.index++;
|
|
29
29
|
continue;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
const
|
|
31
|
+
t = Math.max(t, h + 1);
|
|
32
|
+
const i = s === void 0 || l(s, r[n]) === void 0 || l(s, r[n]);
|
|
33
33
|
e[e.length] = {
|
|
34
34
|
dataIndex: -1,
|
|
35
|
-
dataItem: r[
|
|
36
|
-
level:
|
|
35
|
+
dataItem: r[n],
|
|
36
|
+
level: h,
|
|
37
37
|
rowType: "groupHeader",
|
|
38
|
-
expanded:
|
|
39
|
-
},
|
|
40
|
-
g(e, r[
|
|
41
|
-
|
|
42
|
-
)), (a === "always" ||
|
|
38
|
+
expanded: i
|
|
39
|
+
}, i && (t = Math.max(
|
|
40
|
+
g(e, r[n].items, a, o, d, s, h + 1),
|
|
41
|
+
t
|
|
42
|
+
)), (a === "always" || i && a === "visible") && (e[e.length] = {
|
|
43
43
|
dataIndex: -1,
|
|
44
|
-
dataItem: r[
|
|
44
|
+
dataItem: r[n],
|
|
45
45
|
rowType: "groupFooter",
|
|
46
|
-
level:
|
|
47
|
-
expanded:
|
|
46
|
+
level: h,
|
|
47
|
+
expanded: i
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
|
-
return
|
|
50
|
+
return t;
|
|
51
51
|
}
|
|
52
|
-
function I(e, r, a,
|
|
53
|
-
let
|
|
52
|
+
function I(e, r, a, o = 0) {
|
|
53
|
+
let d = [];
|
|
54
54
|
if (!e)
|
|
55
55
|
return [];
|
|
56
|
-
e && e.length === void 0 && (e = [e]), e.forEach((
|
|
57
|
-
|
|
58
|
-
const
|
|
59
|
-
|
|
56
|
+
e && e.length === void 0 && (e = [e]), e.filter((t) => t && t.props ? !t.props.hidden : !t.hidden).forEach((t, n) => {
|
|
57
|
+
t = t.props ? t.props : t;
|
|
58
|
+
const i = r[n] || null, f = I(t.children, i && i.children || [], a, o + 1);
|
|
59
|
+
d.push(
|
|
60
60
|
Object.assign(
|
|
61
|
-
{ depth:
|
|
62
|
-
|
|
61
|
+
{ depth: o },
|
|
62
|
+
x,
|
|
63
63
|
f.length ? { cell: () => null, filterCell: () => null } : {},
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
i ? { width: i.width, orderIndex: i.orderIndex } : {},
|
|
65
|
+
t,
|
|
66
66
|
{
|
|
67
|
-
id:
|
|
68
|
-
declarationIndex:
|
|
67
|
+
id: t.id ? t.id : p.generateNavigatableId(`${a.prevId++}`, a.idPrefix, "column"),
|
|
68
|
+
declarationIndex: d.length,
|
|
69
69
|
children: f,
|
|
70
70
|
rowSpan: 0,
|
|
71
71
|
colSpan: 0,
|
|
72
72
|
isAccessible: !0,
|
|
73
|
-
left:
|
|
74
|
-
right:
|
|
73
|
+
left: i && Math.floor(i.left),
|
|
74
|
+
right: i && Math.floor(i.right)
|
|
75
75
|
}
|
|
76
76
|
)
|
|
77
77
|
);
|
|
78
78
|
});
|
|
79
|
-
const h = (
|
|
80
|
-
if (
|
|
81
|
-
let
|
|
82
|
-
const
|
|
83
|
-
|
|
79
|
+
const h = (t, n) => t.orderIndex === n.orderIndex ? t.declarationIndex - n.declarationIndex : (t.orderIndex || 0) - (n.orderIndex || 0);
|
|
80
|
+
if (d.sort(h), o === 0) {
|
|
81
|
+
let t = [];
|
|
82
|
+
const n = (i, f) => i.forEach((c) => {
|
|
83
|
+
c.parentIndex = f, n(c.children, t.push(c) - 1);
|
|
84
84
|
});
|
|
85
|
-
return d
|
|
85
|
+
return n(d, -1), t;
|
|
86
86
|
}
|
|
87
|
-
return
|
|
87
|
+
return d;
|
|
88
88
|
}
|
|
89
|
-
function
|
|
90
|
-
let
|
|
91
|
-
Array.isArray(e) ?
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
94
|
-
let
|
|
89
|
+
function b(e, r, a, o) {
|
|
90
|
+
let d = [];
|
|
91
|
+
Array.isArray(e) ? d = e : e && (d = e.data);
|
|
92
|
+
const s = [];
|
|
93
|
+
if (d.length > 0) {
|
|
94
|
+
let h = d[0];
|
|
95
95
|
if (r)
|
|
96
|
-
for (let
|
|
97
|
-
|
|
98
|
-
Object.getOwnPropertyNames(
|
|
99
|
-
|
|
96
|
+
for (let n = 0; n < r.length; n++)
|
|
97
|
+
h = h.items && h.items[0];
|
|
98
|
+
Object.getOwnPropertyNames(h).forEach((n) => {
|
|
99
|
+
n !== a && s.push(Object.assign(
|
|
100
100
|
{
|
|
101
|
-
id:
|
|
101
|
+
id: p.generateNavigatableId(`${o.prevId++}`, o.idPrefix, "column"),
|
|
102
102
|
declarationIndex: -1,
|
|
103
103
|
parentIndex: -1,
|
|
104
104
|
depth: 0,
|
|
@@ -112,14 +112,14 @@ function y(e, r, a, i) {
|
|
|
112
112
|
ariaColumnIndex: 0,
|
|
113
113
|
isAccessible: !0
|
|
114
114
|
},
|
|
115
|
-
|
|
116
|
-
{ field:
|
|
115
|
+
x,
|
|
116
|
+
{ field: n }
|
|
117
117
|
));
|
|
118
118
|
});
|
|
119
119
|
}
|
|
120
|
-
return
|
|
120
|
+
return s;
|
|
121
121
|
}
|
|
122
|
-
const
|
|
122
|
+
const v = (e, r) => {
|
|
123
123
|
let a = e[r.parentIndex];
|
|
124
124
|
for (; a; ) {
|
|
125
125
|
if (a.footerCell)
|
|
@@ -127,22 +127,22 @@ const p = (e, r) => {
|
|
|
127
127
|
a = e[a.parentIndex];
|
|
128
128
|
}
|
|
129
129
|
return !1;
|
|
130
|
-
},
|
|
130
|
+
}, S = (e) => e.filter((r) => v(e, r) ? !1 : !!r.footerCell || !(r.children && r.children.length > 0)), m = (e) => e.width !== void 0 ? Math.floor(parseFloat(e.width.toString())) + "px" : void 0, w = (e) => (e.sort((r, a) => r.declarationIndex - a.declarationIndex), e.map((r) => {
|
|
131
131
|
const {
|
|
132
132
|
declarationIndex: a,
|
|
133
|
-
parentIndex:
|
|
134
|
-
depth:
|
|
135
|
-
colSpan:
|
|
136
|
-
rowSpan:
|
|
137
|
-
index:
|
|
138
|
-
kFirst:
|
|
139
|
-
children:
|
|
140
|
-
...
|
|
133
|
+
parentIndex: o,
|
|
134
|
+
depth: d,
|
|
135
|
+
colSpan: s,
|
|
136
|
+
rowSpan: h,
|
|
137
|
+
index: t,
|
|
138
|
+
kFirst: n,
|
|
139
|
+
children: i,
|
|
140
|
+
...f
|
|
141
141
|
} = r;
|
|
142
|
-
return
|
|
143
|
-
children: w(
|
|
144
|
-
...
|
|
145
|
-
} :
|
|
142
|
+
return i.length ? {
|
|
143
|
+
children: w(i),
|
|
144
|
+
...f
|
|
145
|
+
} : f;
|
|
146
146
|
})), F = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), M = 17895697, A = (e, r) => {
|
|
147
147
|
if (!(!e && !r))
|
|
148
148
|
return r ? e ? {
|
|
@@ -167,13 +167,13 @@ const p = (e, r) => {
|
|
|
167
167
|
} : r : e;
|
|
168
168
|
};
|
|
169
169
|
export {
|
|
170
|
-
|
|
170
|
+
b as autoGenerateColumns,
|
|
171
171
|
F as firefox,
|
|
172
172
|
M as firefoxMaxHeight,
|
|
173
173
|
g as flatData,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
S as footerColumns,
|
|
175
|
+
m as getColumnWidth,
|
|
176
|
+
l as getNestedValue,
|
|
177
177
|
I as readColumns,
|
|
178
178
|
A as resolveCells,
|
|
179
179
|
w as sanitizeColumns
|