@progress/kendo-react-grid 9.0.0-develop.1 → 9.0.0-develop.10

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/utils/index.mjs CHANGED
@@ -8,7 +8,7 @@
8
8
  "use client";
9
9
  import { gridDefaultProps as x } from "../GridColumn.mjs";
10
10
  import { tableKeyboardNavigationTools as g } from "@progress/kendo-react-data-tools";
11
- function c(e, r) {
11
+ function l(e, r) {
12
12
  const i = (e || "").split(".");
13
13
  let o = r;
14
14
  return i.forEach((d) => {
@@ -24,12 +24,12 @@ function p(e, r, i, o, d, s, h = 0) {
24
24
  dataItem: r[n],
25
25
  rowType: "data",
26
26
  level: h,
27
- expanded: s === void 0 || c(s, r[n])
27
+ expanded: s === void 0 || l(s, r[n])
28
28
  }, o.index++;
29
29
  continue;
30
30
  }
31
31
  t = Math.max(t, h + 1);
32
- const a = s === void 0 || c(s, r[n]) === void 0 || c(s, r[n]);
32
+ const a = s === void 0 || l(s, r[n]) === void 0 || l(s, r[n]);
33
33
  e[e.length] = {
34
34
  dataIndex: -1,
35
35
  dataItem: r[n],
@@ -50,12 +50,17 @@ function p(e, r, i, o, d, s, h = 0) {
50
50
  return t;
51
51
  }
52
52
  function I(e, r, i, o = 0) {
53
- let d = [];
53
+ const d = [];
54
54
  if (!e)
55
55
  return [];
56
56
  e && e.length === void 0 && (e = [e]), e.filter((t) => t && t.props ? !t.props.hidden : !t.hidden).forEach((t, n) => {
57
57
  t = t.props ? t.props : t;
58
- const a = r[n] || null, f = I(t.children, a && a.children || [], i, o + 1);
58
+ const a = r[n] || null, f = I(
59
+ t.children,
60
+ a && a.children || [],
61
+ i,
62
+ o + 1
63
+ );
59
64
  d.push(
60
65
  Object.assign(
61
66
  { depth: o },
@@ -78,9 +83,8 @@ function I(e, r, i, o = 0) {
78
83
  });
79
84
  const h = (t, n) => t.orderIndex === n.orderIndex ? t.declarationIndex - n.declarationIndex : (t.orderIndex || 0) - (n.orderIndex || 0);
80
85
  if (d.sort(h), o === 0) {
81
- let t = [];
82
- const n = (a, f) => a.forEach((l) => {
83
- l.parentIndex = f, n(l.children, t.push(l) - 1);
86
+ const t = [], n = (a, f) => a.forEach((c) => {
87
+ c.parentIndex = f, n(c.children, t.push(c) - 1);
84
88
  });
85
89
  return n(d, -1), t;
86
90
  }
@@ -96,25 +100,27 @@ function b(e, r, i, o) {
96
100
  for (let n = 0; n < r.length; n++)
97
101
  h = h.items && h.items[0];
98
102
  Object.getOwnPropertyNames(h).forEach((n) => {
99
- n !== i && s.push(Object.assign(
100
- {
101
- id: g.generateNavigatableId(`${o.prevId++}`, o.idPrefix, "column"),
102
- declarationIndex: -1,
103
- parentIndex: -1,
104
- depth: 0,
105
- colSpan: 0,
106
- rowSpan: 0,
107
- index: 0,
108
- left: 0,
109
- right: 0,
110
- rightBorder: !1,
111
- children: [],
112
- ariaColumnIndex: 0,
113
- isAccessible: !0
114
- },
115
- x,
116
- { field: n }
117
- ));
103
+ n !== i && s.push(
104
+ Object.assign(
105
+ {
106
+ id: g.generateNavigatableId(`${o.prevId++}`, o.idPrefix, "column"),
107
+ declarationIndex: -1,
108
+ parentIndex: -1,
109
+ depth: 0,
110
+ colSpan: 0,
111
+ rowSpan: 0,
112
+ index: 0,
113
+ left: 0,
114
+ right: 0,
115
+ rightBorder: !1,
116
+ children: [],
117
+ ariaColumnIndex: 0,
118
+ isAccessible: !0
119
+ },
120
+ x,
121
+ { field: n }
122
+ )
123
+ );
118
124
  });
119
125
  }
120
126
  return s;
@@ -128,17 +134,7 @@ const v = (e, r) => {
128
134
  }
129
135
  return !1;
130
136
  }, 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, F = (e, r) => r && r.filter((i) => i.field === e).length > 0, w = (e) => (e.sort((r, i) => r.declarationIndex - i.declarationIndex), e.map((r) => {
131
- const {
132
- declarationIndex: i,
133
- parentIndex: o,
134
- depth: d,
135
- colSpan: s,
136
- rowSpan: h,
137
- index: t,
138
- kFirst: n,
139
- children: a,
140
- ...f
141
- } = r;
137
+ const { declarationIndex: i, parentIndex: o, depth: d, colSpan: s, rowSpan: h, index: t, kFirst: n, children: a, ...f } = r;
142
138
  return a.length ? {
143
139
  children: w(a),
144
140
  ...f
@@ -173,7 +169,7 @@ export {
173
169
  p as flatData,
174
170
  S as footerColumns,
175
171
  m as getColumnWidth,
176
- c as getNestedValue,
172
+ l as getNestedValue,
177
173
  F as isSorted,
178
174
  I as readColumns,
179
175
  N as resolveCells,