@progress/kendo-vue-grid 7.1.0-develop.7 → 8.0.0-develop.2

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.
@@ -5,34 +5,54 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- function k(s) {
9
- const { cellModels: l, columns: o = [], tableViewPortWidth: u, scrollLeft: c } = s;
10
- let n = 0, t = l.length - 1, i = 0, d = 0;
11
- for (let e = 0; e < l.length; e++)
12
- if (!o[l[e].columnIndex].locked && (i = d, d += l[e].width || 10, d >= c)) {
13
- n = e;
8
+ function m(u) {
9
+ const { cellsToRender: n, columns: c, rowIndex: f, enableVirtualization: s } = u;
10
+ if (!s || f !== 0 || !n || n.length === 0)
11
+ return { columnsToRender: [], colSpans: [] };
12
+ const t = [], o = [];
13
+ let i = -1, d = -1;
14
+ for (let l = 0; l < n.length; l++)
15
+ c[n[l].columnIndex].locked || (i === -1 && (i = l), d = l);
16
+ return n.forEach((l, r) => {
17
+ if (t.push(l.columnIndex), r === i)
18
+ o.push(l.colSpan);
19
+ else if (r === d)
20
+ o.push(l.colSpan);
21
+ else {
22
+ const a = c[l.columnIndex];
23
+ o.push(a.headerColSpan || 1);
24
+ }
25
+ }), { columnsToRender: t, colSpans: o };
26
+ }
27
+ function p(u) {
28
+ const { cellModels: n, columns: c = [], tableViewPortWidth: f, scrollLeft: s } = u;
29
+ let t = 0, o = n.length - 1, i = 0, d = 0;
30
+ for (let e = 0; e < n.length; e++)
31
+ if (!c[n[e].columnIndex].locked && (i = d, d += n[e].width || 10, d >= s)) {
32
+ t = e;
14
33
  break;
15
34
  }
16
- for (let e = n; e < l.length; e++)
17
- if (!o[l[e].columnIndex].locked)
18
- if (i < u + c)
19
- i += l[e].width || 10, t = e;
35
+ for (let e = t; e < n.length; e++)
36
+ if (!c[n[e].columnIndex].locked)
37
+ if (i < f + s)
38
+ i += n[e].width || 10, o = e;
20
39
  else
21
40
  break;
22
- n > 0 && n--, t < l.length - 1 && t++;
23
- let r = 0, f = 0;
24
- for (let e = 0; e < n; e++)
25
- o[l[e].columnIndex].locked || (r += l[e].colSpan);
26
- for (let e = t + 1; e < l.length; e++)
27
- o[l[e].columnIndex].locked || (f += l[e].colSpan);
28
- l[n].colSpan += r, l[t].colSpan += f;
29
- const a = l.slice(0, n).filter((e) => o[e.columnIndex].locked), h = l.slice(t + 1).filter((e) => o[e.columnIndex].locked);
41
+ t > 0 && t--, o < n.length - 1 && o++;
42
+ let l = 0, r = 0;
43
+ for (let e = 0; e < t; e++)
44
+ c[n[e].columnIndex].locked || (l += n[e].colSpan);
45
+ for (let e = o + 1; e < n.length; e++)
46
+ c[n[e].columnIndex].locked || (r += n[e].colSpan);
47
+ n[t].colSpan += l, n[o].colSpan += r;
48
+ const a = n.slice(0, t).filter((e) => c[e.columnIndex].locked), h = n.slice(o + 1).filter((e) => c[e.columnIndex].locked);
30
49
  return [
31
50
  ...a,
32
- ...l.slice(n, t + 1),
51
+ ...n.slice(t, o + 1),
33
52
  ...h
34
53
  ];
35
54
  }
36
55
  export {
37
- k as getVirtualCellsToRender
56
+ p as getVirtualCellsToRender,
57
+ m as getVirtualHeaderCellsToRender
38
58
  };