@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/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 F, updateLeft as T, updateRight as L, tableKeyboardNavigationTools as A } from "@progress/kendo-vue-data-tools";
9
- import { getter as S, canUseDOM as R } from "@progress/kendo-vue-common";
10
- import { gridDefaultProps as b } from "../GridColumn.mjs";
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((d) => {
16
- i = i ? i[d] : void 0;
15
+ return n.forEach((a) => {
16
+ i = i ? i[a] : void 0;
17
17
  }), i;
18
18
  }
19
- function N(e, t, n, i, d, l, r, o, s, f, c = 0, h) {
20
- let p = c;
21
- for (let a = 0; a < t.length; a++) {
22
- let x;
23
- if (!d || t[a].value === void 0 || t[a].items === void 0) {
24
- const C = s ? !!(l != null && l[S(s)(t[a])]) : !1;
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[a],
27
+ dataItem: t[g],
28
28
  rowType: "data",
29
- level: c,
30
- group: h,
29
+ level: p,
30
+ group: f,
31
31
  // This is related to detail-row expansion
32
- expanded: f !== void 0 ? y(f, t[a]) : C != null ? C : !1
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
- h != null && h.parents ? C = [{ field: h.field, value: h.value }, ...h.parents] : h ? C = [h] : C = [], x = {
38
- field: t[a].field,
39
- value: t[a].value,
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
- p = Math.max(p, c + 1);
44
- let g = !1;
45
- const w = F(r || [], x);
46
- f ? g = f === void 0 || y(f, t[a]) === void 0 || y(f, t[a]) : g = w ? w.expanded !== !1 : o !== !1, e[e.length] = {
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[a],
49
- level: c,
50
- group: x,
48
+ dataItem: t[g],
49
+ level: p,
50
+ group: l,
51
51
  rowType: "groupHeader",
52
- expanded: g
53
- }, g && (x.expanded = g, p = Math.max(
52
+ expanded: x
53
+ }, x && (l.expanded = x, c = Math.max(
54
54
  N(
55
55
  e,
56
- t[a].items,
56
+ t[g].items,
57
57
  n,
58
58
  i,
59
- d,
60
- l,
59
+ a,
60
+ s,
61
61
  r,
62
+ d,
62
63
  o,
63
- s,
64
- f,
65
- c + 1,
66
- x
64
+ h,
65
+ p + 1,
66
+ l
67
67
  ),
68
- p
69
- )), (n === "always" || g && n === "visible") && (e[e.length] = {
68
+ c
69
+ )), (n === "always" || x && n === "visible") && (e[e.length] = {
70
70
  dataIndex: -1,
71
- dataItem: t[a],
71
+ dataItem: t[g],
72
72
  rowType: "groupFooter",
73
- level: c,
74
- expanded: g
73
+ level: p,
74
+ expanded: x
75
75
  });
76
76
  }
77
- return p;
77
+ return c;
78
78
  }
79
- function z(e) {
79
+ function U(e) {
80
80
  return e && getComputedStyle(e).direction === "rtl" || !1;
81
81
  }
82
- function U(e, t) {
83
- if (!t || !e || !e.originalEvent || !R)
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 d = 0; d < i.length; d++)
90
- if (i[d] === n)
91
- return d;
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 v = [
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 V(e) {
109
- for (let t = 0; t < v.length; t++) {
110
- const n = v[t];
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
- (o, s) => s.hidden ? o : o + s.headerColSpan,
122
+ (d, o) => o.hidden ? d : d + o.headerColSpan,
123
123
  0
124
124
  ));
125
- const d = [];
126
- let l = 1;
127
- return e.forEach((r, o) => {
125
+ const a = [];
126
+ let s = 1;
127
+ return e.forEach((r, d) => {
128
128
  n[r.depth] = n[r.depth] || [];
129
- let s = !1;
130
- n[r.depth].length === 0 && (l <= 1 ? l = 1 + (r.children.length > 0 ? 0 : i - r.depth) : (l--, s = !0)), r.rowSpan = 1 + (r.children.length > 0 ? 0 : i - r.depth), r.kFirst = s, r.index = n[r.depth].length, r.ariaColumnIndex = d[r.depth] ? d[r.depth] + 1 : 1;
131
- let f = 0;
132
- const c = [];
133
- let h = r.parentIndex;
134
- for (; h >= 0; )
135
- c.unshift(h), h = e[h].parentIndex;
136
- for (let a = 0; a < c.length; a++) {
137
- const x = c[a], g = e[x], w = n[g.depth], C = w.indexOf(x);
138
- for (let I = 0; I < C; I++) {
139
- const E = w[I];
140
- f += e[E].headerColSpan;
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 a = 0; a < r.depth; a++) {
144
- const x = n[a] || [];
145
- for (let g = 0; g < x.length; g++) {
146
- const w = x[g], C = e[w];
147
- C.depth + C.rowSpan - 1 >= r.depth && (c.includes(w) || (f += C.headerColSpan));
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 p = n[r.depth];
151
- for (let a = 0; a < p.length; a++) {
152
- const x = p[a], g = e[x];
153
- g.parentIndex === r.parentIndex && (f += g.headerColSpan);
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 = f, n[r.depth].push(o);
156
- for (let a = r.depth; a < r.depth + r.rowSpan; a++)
157
- d[a] = (d[a] || 0) + r.headerColSpan;
158
- }), T(n, e, t), L(n, e, t), n;
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 j(e, t, n, i = 0, d = !1) {
161
- const l = [];
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((o, s) => {
165
- o = o;
166
- const f = o.id ? o.id : A.generateNavigatableId(`${n.prevId++}`, n.idPrefix, "column"), c = R && o.media && window.matchMedia ? !window.matchMedia(o.media).matches : !1, h = d || c || o.hidden, p = t == null ? void 0 : t.find((x) => x.id === f), a = j(o.children, (p == null ? void 0 : p.children) || [], n, i + 1, h);
167
- l.push(
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
- ...b,
171
- ...a.length ? { cell: () => null, filterCell: () => null } : {},
172
- ...o,
173
- id: f,
174
- declarationIndex: l.length,
175
- children: a,
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: o.columnType || "data",
179
- colSpan: o.colSpan || 1,
178
+ columnType: d.columnType || "data",
179
+ colSpan: d.colSpan || 1,
180
180
  isAccessible: !0,
181
- hidden: h,
181
+ hidden: f,
182
182
  left: null,
183
183
  right: null,
184
- rowSpannable: o.rowSpannable,
185
- ...p ? { width: p.width, orderIndex: p.orderIndex } : {}
184
+ rowSpannable: d.rowSpannable,
185
+ ...c ? { width: c.width, orderIndex: c.orderIndex } : {}
186
186
  }
187
187
  );
188
188
  });
189
- const r = (o, s) => o.orderIndex === s.orderIndex ? o.declarationIndex - s.declarationIndex : (o.orderIndex || 0) - (s.orderIndex || 0);
190
- if (l.sort(r), i === 0) {
191
- const o = [], s = (f, c) => f.forEach((h) => {
192
- h.parentIndex = c, s(h.children, o.push(h) - 1);
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(l, -1), o;
194
+ return o(s, -1), d;
195
195
  }
196
- return l;
196
+ return s;
197
197
  }
198
- const k = (e) => Array.isArray(e) ? e : e ? e.data : [];
198
+ const j = (e) => Array.isArray(e) ? e : e ? e.data : [];
199
199
  function X(e, t, n, i) {
200
- const d = k(e), l = [];
201
- if (d.length > 0) {
202
- let r = d[0];
200
+ const a = j(e), s = [];
201
+ if (a.length > 0) {
202
+ let r = a[0];
203
203
  if (t)
204
- for (let s = 0; s < t.length; s++)
204
+ for (let o = 0; o < t.length; o++)
205
205
  r = r.items && r.items[0];
206
- Object.getOwnPropertyNames(r).forEach((s) => {
207
- s !== n.column && l.push(
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
- ...b,
225
- field: s
224
+ ...R,
225
+ field: o
226
226
  }
227
227
  );
228
228
  });
229
229
  }
230
- return l;
230
+ return s;
231
231
  }
232
- const H = (e, t) => {
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) => H(e, t) ? !1 : !!t.footerCell || !(t.children && t.children.length > 0)), J = {
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((d) => {
259
- d.expanded = t[i] && !t[i].includes(D(d, n)), d.items && d.items.length && (d.items = M(d.items, t, n, i + 1));
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 P(e, t, n) {
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 Q = (e) => {
274
- const t = [], n = (i) => i == null ? void 0 : i.forEach((d) => {
275
- t.push(d), n(d.children);
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
- }, Z = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), _ = 17895697, q = (e) => e.width !== void 0 ? Math.floor(parseFloat(e.width.toString())) + "px" : void 0, G = (e, t) => t && t.filter((n) => n.field === e).length > 0, $ = (e) => (e.sort((t, n) => t.declarationIndex - n.declarationIndex), e.map((t) => {
279
- const { declarationIndex: n, parentIndex: i, depth: d, headerColSpan: l, rowSpan: r, index: o, kFirst: s, children: f, ...c } = t;
280
- return f.length ? {
281
- children: $(f),
282
- ...c
283
- } : c;
284
- })), ee = (e, t) => typeof e.colSpan == "function" ? e.colSpan({ dataItem: t, column: e }) : e.colSpan || 1, te = (e) => {
285
- var i, d;
286
- const t = typeof e == "object" ? (i = e.enabled) != null ? i : !0 : e != null ? e : !1, n = typeof e == "object" ? (d = e.valueGetter) != null ? d : (l, r) => S(r)(l) : (l, r) => S(r)(l);
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
- }, ne = (e) => {
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
- P as applyExpandedState,
297
+ Q as applyExpandedState,
298
298
  X as autoGenerateColumns,
299
- ne as calcRowHeight,
300
- V as checkPropCompatibility,
301
- Z as firefox,
302
- _ as firefoxMaxHeight,
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
- ee as getColSpan,
306
- q as getColumnWidth,
307
- k as getDataAsArray,
308
- Q as getFlatColumnsState,
309
- U as getIndex,
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
- te as getRowSpanOptions,
311
+ ne as getRowSpanOptions,
312
312
  D as groupedFirstItemValue,
313
- z as isRtl,
314
- G as isSorted,
313
+ U as isRtl,
314
+ ee as isSorted,
315
315
  W as mapColumns,
316
316
  J as parsers,
317
- j as readColumns,
318
- $ as sanitizeColumns
317
+ H as readColumns,
318
+ B as sanitizeColumns
319
319
  };