@progress/kendo-react-grid 15.0.1-develop.9 → 15.1.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,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../utils/index.js"),m=1,x=20;class S{constructor(a){this.columns=[],this.columnsState=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=s=>{this.isRtl=s},this.initWidths=()=>{var c;const s=((c=this.colGroupMain)==null?void 0:c.children)||[],h=p.getFlatColumnsState(this.columnsState),o=this.columns.filter(e=>{var l;return!((l=e.children)!=null&&l.length)});for(let e=0;e<s.length;e++){const l=o[e];let t="";const i=h.find(d=>d.id===o[e].id);i&&(t=this.applyWidthConstraints(i,l)),this.colGroups.forEach(d=>{d.children[e].width=t})}},this.dragHandler=(s,h,o,c)=>{const e=s.originalEvent;c||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation());const l=o.closest("th");if(!l||!l)return;const t=l.clientWidth;let i=t;if(this.isRtl?i+=o.getBoundingClientRect().right-o.offsetWidth/2-s.clientX:i+=s.clientX-o.getBoundingClientRect().left-o.offsetWidth/2,!c&&Math.abs(i-t)<1)return;this.fixateInitialWidths(l.parentElement.clientWidth),this.setWidths(h,Math.floor(i)/t);const d=this.columns.filter(n=>!n.children.length).findIndex(n=>n.id===h.id);this.onResize(d,t,i,e,c,this.columnsState,h.id)},this.dblClickHandler=(s,h)=>{const o=this.columns.filter(r=>h.indexOf(r.id)>-1),c=p.getFlatColumnsState(this.columnsState);if(!this.colGroupMain||!o.length)return;const e={},l=o;for(;l.length>0;){const r=l.pop();if(!r)break;r.children.length?l.push(...r.children):e[r.id]=r}const t=this.columns.filter(r=>!r.children.length),i=[];t.forEach((r,u)=>{e[r.id]&&i.push(u)});const d=this.colGroups,n=d.map(r=>r.parentElement);n.forEach(r=>r.classList.add("k-autofitting"));const f=[];d.forEach(r=>{i.forEach(u=>{r.children[u]&&(r.children[u].width="",f[u]=Math.max(f[u]||0,r.children[u].offsetWidth+m))})}),d.forEach(r=>{i.forEach(u=>{if(r.children[u]){r.children[u].width=f[u]+"px";const g=c.find(W=>W.id===t[u].id);g&&(g.width=f[u])}})}),n.forEach(r=>r.classList.remove("k-autofitting")),this.onResize(i[0],0,0,s,!0,this.columnsState,h[0])},this.updateColElements=s=>{const h=this.columns.filter(c=>!c.hidden&&!c.children.length);let o=1e-10;for(let c=0;c<s.length;c++){const e=s[c],l=h.findIndex(f=>f.id===e.id),t=parseFloat((e.width||0).toString()),i=Math.floor(t);o+=t-i;const d=i+Math.floor(o);o-=Math.floor(o);const n=h.find(f=>f.id===e.id);if(!n)return;this.colGroups.forEach(f=>{if(f.children[l]){const r=parseInt(f.children[l].width,10);f.children[l].width=d+"px",this.updateNextLockedCol(f.parentElement,n,r-d)}})}},this.onResize=a}get colGroups(){return[this.colGroupMain,this.colGroupHeader,this.colGroupFooter,this.colGroupStickyHeader,this.colGroupStickyFooter,this.colGroupPinnedTop,this.colGroupPinnedBottom].filter(Boolean)}applyWidthConstraints(a,s,h=1){if(!a.width)return a.width||"";const o=a.width.toString();if(o.includes("%")){const f=parseFloat(o)*h,r=Math.max(0,Math.min(100,f));return a.width=r+"%",a.width}let e=parseFloat(o)*h;const l=s.minResizableWidth===void 0?10:s.minResizableWidth,t=s==null?void 0:s.minWidth,i=t!==void 0?Math.max(l,t):l,d=s==null?void 0:s.maxWidth;return e<i&&(e=i),d!==void 0&&e>d&&(e=d),a.width=e,e}fixateInitialWidths(a){var l;let s=0;const h=((l=this.colGroupMain)==null?void 0:l.children)||[];for(let t=0;t<h.length;t++)h[t].width?a-=h[t].clientWidth:s++;if(s===0)return;const o=Math.floor(a/s),c=p.getFlatColumnsState(this.columnsState),e=this.columns.filter(t=>!t.children.length);for(let t=0;t<h.length;t++){const i=h[t],d=i.width?i.clientWidth:o,n=c.find(f=>f.id===e[t].id);n&&(n.width=d.toString()),this.colGroups.forEach(f=>{f.children[t].width=d})}}setWidths(a,s){const h=p.getFlatColumnsState(this.columnsState),o=this.columns.findIndex(t=>t.id===a.id),c=[];let e=a.children.filter(t=>!t.hidden).length;for(let t=o+1;t<this.columns.length&&!(e<=0);t++){const i=this.columns[t];i.children.length?e+=i.children.filter(d=>!d.hidden).length:c.push(i),e--}c.length===0&&c.push(a);const l=[];c.forEach(t=>{const i=h.find(d=>d.id===t.id);i&&(this.applyWidthConstraints(i,t,s),l.push(i))}),this.updateColElements(l)}updateNextLockedCol(a,s,h){const o=s.index,c=this.colGroupMain.parentElement.closest(".k-grid"),e=c==null?void 0:c.clientWidth,l=this.columns.filter(t=>t.locked).map(t=>parseInt(t.width+"",10)).reduce((t,i)=>t+i,0);!s.locked||e<=l+x||this.columns.forEach(t=>{if(t!=null&&t.locked&&h){const i=a==null?void 0:a.querySelectorAll('[aria-colindex="'+t.ariaColumnIndex+'"]');i==null||i.forEach(d=>{const n=d.style;this.isRtl?(t.index>o&&n&&n.right&&(n.right=parseInt(n.right,10)-h+"px"),t.index<o&&n&&n.left&&(n.left=parseInt(n.left,10)-h+"px")):(t.index>o&&n&&n.left&&(n.left=parseInt(n.left,10)-h+"px"),t.index<o&&n&&n.right&&(n.right=parseInt(n.right,10)-h+"px"))})}})}}exports.ColumnResize=S;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("../utils/index.js"),W=1,x=20;class S{constructor(a){this.columns=[],this.columnsState=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=c=>{this.isRtl=c},this.initWidths=()=>{var l;const c=((l=this.colGroupMain)==null?void 0:l.children)||[],o=p.getFlatColumnsState(this.columnsState),n=this.columns.filter(e=>{var r;return!((r=e.children)!=null&&r.length)});for(let e=0;e<c.length;e++){const r=n[e];let t="";const i=o.find(d=>d.id===n[e].id);i&&(t=this.applyWidthConstraints(i,r)),this.colGroups.forEach(d=>{d.children[e].width=t})}},this.dragHandler=(c,o,n,l)=>{const e=c.originalEvent;l||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation());const r=n.closest("th");if(!r)return;const t=r.clientWidth;let i=t;if(this.isRtl?i+=n.getBoundingClientRect().right-n.offsetWidth/2-c.clientX:i+=c.clientX-n.getBoundingClientRect().left-n.offsetWidth/2,!l&&Math.abs(i-t)<1)return;this.fixateInitialWidths(r.parentElement.clientWidth),this.setWidths(o,Math.floor(i)/t);const d=this.columns.filter(s=>!s.children.length).findIndex(s=>s.id===o.id);this.onResize(d,t,i,e,l,this.columnsState,o.id)},this.dblClickHandler=(c,o)=>{const n=this.columns.filter(h=>o.indexOf(h.id)>-1),l=p.getFlatColumnsState(this.columnsState);if(!this.colGroupMain||!n.length)return;const e={},r=n;for(;r.length>0;){const h=r.pop();if(!h)break;h.children.length?r.push(...h.children):e[h.id]=h}const t=this.columns.filter(h=>!h.children.length),i=[];t.forEach((h,u)=>{e[h.id]&&i.push(u)});const d=this.colGroups,s=d.map(h=>h.parentElement);s.forEach(h=>h.classList.add("k-autofitting"));const f=[];d.forEach(h=>{i.forEach(u=>{h.children[u]&&(h.children[u].width="",f[u]=Math.max(f[u]||0,h.children[u].offsetWidth+W))})}),d.forEach(h=>{i.forEach(u=>{if(h.children[u]){h.children[u].width=f[u]+"px";const g=l.find(m=>m.id===t[u].id);g&&(g.width=f[u])}})}),s.forEach(h=>h.classList.remove("k-autofitting")),this.onResize(i[0],0,0,c,!0,this.columnsState,o[0])},this.updateColElements=c=>{const o=this.columns.filter(l=>!l.hidden&&!l.children.length);let n=1e-10;for(let l=0;l<c.length;l++){const e=c[l],r=o.findIndex(f=>f.id===e.id),t=parseFloat((e.width||0).toString()),i=Math.floor(t);n+=t-i;const d=i+Math.floor(n);n-=Math.floor(n);const s=o.find(f=>f.id===e.id);if(!s)return;this.colGroups.forEach(f=>{if(f.children[r]){const h=parseInt(f.children[r].width,10);f.children[r].width=d+"px",this.updateNextLockedCol(f.parentElement,s,h-d)}})}},this.onResize=a}get colGroups(){return[this.colGroupMain,this.colGroupHeader,this.colGroupFooter,this.colGroupStickyHeader,this.colGroupStickyFooter,this.colGroupPinnedTop,this.colGroupPinnedBottom].filter(Boolean)}applyWidthConstraints(a,c,o=1){if(!a.width)return a.width||"";const n=a.width.toString();if(n.includes("%")){const f=parseFloat(n)*o,h=Math.max(0,Math.min(100,f));return a.width=h+"%",a.width}let e=parseFloat(n)*o;const r=c.minResizableWidth===void 0?10:c.minResizableWidth,t=c.minWidth,i=t!==void 0?Math.max(r,t):r,d=c.maxWidth;return e<i&&(e=i),d!==void 0&&e>d&&(e=d),a.width=e,e}fixateInitialWidths(a){var r;let c=0;const o=((r=this.colGroupMain)==null?void 0:r.children)||[];for(let t=0;t<o.length;t++)o[t].width?a-=o[t].clientWidth:c++;if(c===0)return;const n=Math.floor(a/c),l=p.getFlatColumnsState(this.columnsState),e=this.columns.filter(t=>!t.children.length);for(let t=0;t<o.length;t++){const i=o[t],d=i.width?i.clientWidth:n,s=l.find(f=>f.id===e[t].id);s&&(s.width=d.toString()),this.colGroups.forEach(f=>{f.children[t].width=d})}}setWidths(a,c){const o=p.getFlatColumnsState(this.columnsState),n=this.columns.findIndex(t=>t.id===a.id),l=[];let e=a.children.filter(t=>!t.hidden).length;for(let t=n+1;t<this.columns.length&&!(e<=0);t++){const i=this.columns[t];i.children.length?e+=i.children.filter(d=>!d.hidden).length:l.push(i),e--}l.length===0&&l.push(a);const r=[];l.forEach(t=>{const i=o.find(d=>d.id===t.id);i&&(this.applyWidthConstraints(i,t,c),r.push(i))}),this.updateColElements(r)}updateNextLockedCol(a,c,o){const n=c.index,l=this.colGroupMain.parentElement.closest(".k-grid"),e=l==null?void 0:l.clientWidth,r=this.columns.filter(t=>t.locked).map(t=>parseInt(t.width+"",10)).reduce((t,i)=>t+i,0);!c.locked||e<=r+x||this.columns.forEach(t=>{if(t!=null&&t.locked&&o){const i=a==null?void 0:a.querySelectorAll('[aria-colindex="'+t.ariaColumnIndex+'"]');i==null||i.forEach(d=>{const s=d.style;this.isRtl?(t.index>n&&s&&s.right&&(s.right=parseInt(s.right,10)-o+"px"),t.index<n&&s&&s.left&&(s.left=parseInt(s.left,10)-o+"px")):(t.index>n&&s&&s.left&&(s.left=parseInt(s.left,10)-o+"px"),t.index<n&&s&&s.right&&(s.right=parseInt(s.right,10)-o+"px"))})}})}}exports.ColumnResize=S;
@@ -5,88 +5,88 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- import { getFlatColumnsState as u } from "../utils/index.mjs";
9
- const x = 1, m = 20;
8
+ import { getFlatColumnsState as p } from "../utils/index.mjs";
9
+ const W = 1, x = 20;
10
10
  class S {
11
11
  constructor(a) {
12
- this.columns = [], this.columnsState = [], this.resizable = !1, this.isRtl = !1, this.setIsRtl = (s) => {
13
- this.isRtl = s;
12
+ this.columns = [], this.columnsState = [], this.resizable = !1, this.isRtl = !1, this.setIsRtl = (c) => {
13
+ this.isRtl = c;
14
14
  }, this.initWidths = () => {
15
- var c;
16
- const s = ((c = this.colGroupMain) == null ? void 0 : c.children) || [], h = u(this.columnsState), o = this.columns.filter((e) => {
15
+ var l;
16
+ const c = ((l = this.colGroupMain) == null ? void 0 : l.children) || [], o = p(this.columnsState), n = this.columns.filter((e) => {
17
17
  var r;
18
18
  return !((r = e.children) != null && r.length);
19
19
  });
20
- for (let e = 0; e < s.length; e++) {
21
- const r = o[e];
20
+ for (let e = 0; e < c.length; e++) {
21
+ const r = n[e];
22
22
  let t = "";
23
- const i = h.find((d) => d.id === o[e].id);
23
+ const i = o.find((d) => d.id === n[e].id);
24
24
  i && (t = this.applyWidthConstraints(i, r)), this.colGroups.forEach((d) => {
25
25
  d.children[e].width = t;
26
26
  });
27
27
  }
28
- }, this.dragHandler = (s, h, o, c) => {
29
- const e = s.originalEvent;
30
- c || (e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation());
31
- const r = o.closest("th");
32
- if (!r || !r)
28
+ }, this.dragHandler = (c, o, n, l) => {
29
+ const e = c.originalEvent;
30
+ l || (e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation());
31
+ const r = n.closest("th");
32
+ if (!r)
33
33
  return;
34
34
  const t = r.clientWidth;
35
35
  let i = t;
36
- if (this.isRtl ? i += o.getBoundingClientRect().right - o.offsetWidth / 2 - s.clientX : i += s.clientX - o.getBoundingClientRect().left - o.offsetWidth / 2, !c && Math.abs(i - t) < 1)
36
+ if (this.isRtl ? i += n.getBoundingClientRect().right - n.offsetWidth / 2 - c.clientX : i += c.clientX - n.getBoundingClientRect().left - n.offsetWidth / 2, !l && Math.abs(i - t) < 1)
37
37
  return;
38
- this.fixateInitialWidths(r.parentElement.clientWidth), this.setWidths(h, Math.floor(i) / t);
39
- const d = this.columns.filter((n) => !n.children.length).findIndex((n) => n.id === h.id);
40
- this.onResize(d, t, i, e, c, this.columnsState, h.id);
41
- }, this.dblClickHandler = (s, h) => {
42
- const o = this.columns.filter((l) => h.indexOf(l.id) > -1), c = u(this.columnsState);
43
- if (!this.colGroupMain || !o.length)
38
+ this.fixateInitialWidths(r.parentElement.clientWidth), this.setWidths(o, Math.floor(i) / t);
39
+ const d = this.columns.filter((s) => !s.children.length).findIndex((s) => s.id === o.id);
40
+ this.onResize(d, t, i, e, l, this.columnsState, o.id);
41
+ }, this.dblClickHandler = (c, o) => {
42
+ const n = this.columns.filter((h) => o.indexOf(h.id) > -1), l = p(this.columnsState);
43
+ if (!this.colGroupMain || !n.length)
44
44
  return;
45
- const e = {}, r = o;
45
+ const e = {}, r = n;
46
46
  for (; r.length > 0; ) {
47
- const l = r.pop();
48
- if (!l)
47
+ const h = r.pop();
48
+ if (!h)
49
49
  break;
50
- l.children.length ? r.push(...l.children) : e[l.id] = l;
50
+ h.children.length ? r.push(...h.children) : e[h.id] = h;
51
51
  }
52
- const t = this.columns.filter((l) => !l.children.length), i = [];
53
- t.forEach((l, p) => {
54
- e[l.id] && i.push(p);
52
+ const t = this.columns.filter((h) => !h.children.length), i = [];
53
+ t.forEach((h, u) => {
54
+ e[h.id] && i.push(u);
55
55
  });
56
- const d = this.colGroups, n = d.map((l) => l.parentElement);
57
- n.forEach((l) => l.classList.add("k-autofitting"));
56
+ const d = this.colGroups, s = d.map((h) => h.parentElement);
57
+ s.forEach((h) => h.classList.add("k-autofitting"));
58
58
  const f = [];
59
- d.forEach((l) => {
60
- i.forEach((p) => {
61
- l.children[p] && (l.children[p].width = "", f[p] = Math.max(
62
- f[p] || 0,
63
- l.children[p].offsetWidth + x
59
+ d.forEach((h) => {
60
+ i.forEach((u) => {
61
+ h.children[u] && (h.children[u].width = "", f[u] = Math.max(
62
+ f[u] || 0,
63
+ h.children[u].offsetWidth + W
64
64
  ));
65
65
  });
66
- }), d.forEach((l) => {
67
- i.forEach((p) => {
68
- if (l.children[p]) {
69
- l.children[p].width = f[p] + "px";
70
- const g = c.find((W) => W.id === t[p].id);
71
- g && (g.width = f[p]);
66
+ }), d.forEach((h) => {
67
+ i.forEach((u) => {
68
+ if (h.children[u]) {
69
+ h.children[u].width = f[u] + "px";
70
+ const g = l.find((m) => m.id === t[u].id);
71
+ g && (g.width = f[u]);
72
72
  }
73
73
  });
74
- }), n.forEach((l) => l.classList.remove("k-autofitting")), this.onResize(i[0], 0, 0, s, !0, this.columnsState, h[0]);
75
- }, this.updateColElements = (s) => {
76
- const h = this.columns.filter((c) => !c.hidden && !c.children.length);
77
- let o = 1e-10;
78
- for (let c = 0; c < s.length; c++) {
79
- const e = s[c], r = h.findIndex((f) => f.id === e.id), t = parseFloat((e.width || 0).toString()), i = Math.floor(t);
80
- o += t - i;
81
- const d = i + Math.floor(o);
82
- o -= Math.floor(o);
83
- const n = h.find((f) => f.id === e.id);
84
- if (!n)
74
+ }), s.forEach((h) => h.classList.remove("k-autofitting")), this.onResize(i[0], 0, 0, c, !0, this.columnsState, o[0]);
75
+ }, this.updateColElements = (c) => {
76
+ const o = this.columns.filter((l) => !l.hidden && !l.children.length);
77
+ let n = 1e-10;
78
+ for (let l = 0; l < c.length; l++) {
79
+ const e = c[l], r = o.findIndex((f) => f.id === e.id), t = parseFloat((e.width || 0).toString()), i = Math.floor(t);
80
+ n += t - i;
81
+ const d = i + Math.floor(n);
82
+ n -= Math.floor(n);
83
+ const s = o.find((f) => f.id === e.id);
84
+ if (!s)
85
85
  return;
86
86
  this.colGroups.forEach((f) => {
87
87
  if (f.children[r]) {
88
- const l = parseInt(f.children[r].width, 10);
89
- f.children[r].width = d + "px", this.updateNextLockedCol(f.parentElement, n, l - d);
88
+ const h = parseInt(f.children[r].width, 10);
89
+ f.children[r].width = d + "px", this.updateNextLockedCol(f.parentElement, s, h - d);
90
90
  }
91
91
  });
92
92
  }
@@ -103,56 +103,56 @@ class S {
103
103
  this.colGroupPinnedBottom
104
104
  ].filter(Boolean);
105
105
  }
106
- applyWidthConstraints(a, s, h = 1) {
106
+ applyWidthConstraints(a, c, o = 1) {
107
107
  if (!a.width)
108
108
  return a.width || "";
109
- const o = a.width.toString();
110
- if (o.includes("%")) {
111
- const f = parseFloat(o) * h, l = Math.max(0, Math.min(100, f));
112
- return a.width = l + "%", a.width;
109
+ const n = a.width.toString();
110
+ if (n.includes("%")) {
111
+ const f = parseFloat(n) * o, h = Math.max(0, Math.min(100, f));
112
+ return a.width = h + "%", a.width;
113
113
  }
114
- let e = parseFloat(o) * h;
115
- const r = s.minResizableWidth === void 0 ? 10 : s.minResizableWidth, t = s == null ? void 0 : s.minWidth, i = t !== void 0 ? Math.max(r, t) : r, d = s == null ? void 0 : s.maxWidth;
114
+ let e = parseFloat(n) * o;
115
+ const r = c.minResizableWidth === void 0 ? 10 : c.minResizableWidth, t = c.minWidth, i = t !== void 0 ? Math.max(r, t) : r, d = c.maxWidth;
116
116
  return e < i && (e = i), d !== void 0 && e > d && (e = d), a.width = e, e;
117
117
  }
118
118
  fixateInitialWidths(a) {
119
119
  var r;
120
- let s = 0;
121
- const h = ((r = this.colGroupMain) == null ? void 0 : r.children) || [];
122
- for (let t = 0; t < h.length; t++)
123
- h[t].width ? a -= h[t].clientWidth : s++;
124
- if (s === 0)
120
+ let c = 0;
121
+ const o = ((r = this.colGroupMain) == null ? void 0 : r.children) || [];
122
+ for (let t = 0; t < o.length; t++)
123
+ o[t].width ? a -= o[t].clientWidth : c++;
124
+ if (c === 0)
125
125
  return;
126
- const o = Math.floor(a / s), c = u(this.columnsState), e = this.columns.filter((t) => !t.children.length);
127
- for (let t = 0; t < h.length; t++) {
128
- const i = h[t], d = i.width ? i.clientWidth : o, n = c.find((f) => f.id === e[t].id);
129
- n && (n.width = d.toString()), this.colGroups.forEach((f) => {
126
+ const n = Math.floor(a / c), l = p(this.columnsState), e = this.columns.filter((t) => !t.children.length);
127
+ for (let t = 0; t < o.length; t++) {
128
+ const i = o[t], d = i.width ? i.clientWidth : n, s = l.find((f) => f.id === e[t].id);
129
+ s && (s.width = d.toString()), this.colGroups.forEach((f) => {
130
130
  f.children[t].width = d;
131
131
  });
132
132
  }
133
133
  }
134
- setWidths(a, s) {
135
- const h = u(this.columnsState), o = this.columns.findIndex((t) => t.id === a.id), c = [];
134
+ setWidths(a, c) {
135
+ const o = p(this.columnsState), n = this.columns.findIndex((t) => t.id === a.id), l = [];
136
136
  let e = a.children.filter((t) => !t.hidden).length;
137
- for (let t = o + 1; t < this.columns.length && !(e <= 0); t++) {
137
+ for (let t = n + 1; t < this.columns.length && !(e <= 0); t++) {
138
138
  const i = this.columns[t];
139
- i.children.length ? e += i.children.filter((d) => !d.hidden).length : c.push(i), e--;
139
+ i.children.length ? e += i.children.filter((d) => !d.hidden).length : l.push(i), e--;
140
140
  }
141
- c.length === 0 && c.push(a);
141
+ l.length === 0 && l.push(a);
142
142
  const r = [];
143
- c.forEach((t) => {
144
- const i = h.find((d) => d.id === t.id);
145
- i && (this.applyWidthConstraints(i, t, s), r.push(i));
143
+ l.forEach((t) => {
144
+ const i = o.find((d) => d.id === t.id);
145
+ i && (this.applyWidthConstraints(i, t, c), r.push(i));
146
146
  }), this.updateColElements(r);
147
147
  }
148
- updateNextLockedCol(a, s, h) {
149
- const o = s.index, c = this.colGroupMain.parentElement.closest(".k-grid"), e = c == null ? void 0 : c.clientWidth, r = this.columns.filter((t) => t.locked).map((t) => parseInt(t.width + "", 10)).reduce((t, i) => t + i, 0);
150
- !s.locked || e <= r + m || this.columns.forEach((t) => {
151
- if (t != null && t.locked && h) {
148
+ updateNextLockedCol(a, c, o) {
149
+ const n = c.index, l = this.colGroupMain.parentElement.closest(".k-grid"), e = l == null ? void 0 : l.clientWidth, r = this.columns.filter((t) => t.locked).map((t) => parseInt(t.width + "", 10)).reduce((t, i) => t + i, 0);
150
+ !c.locked || e <= r + x || this.columns.forEach((t) => {
151
+ if (t != null && t.locked && o) {
152
152
  const i = a == null ? void 0 : a.querySelectorAll('[aria-colindex="' + t.ariaColumnIndex + '"]');
153
153
  i == null || i.forEach((d) => {
154
- const n = d.style;
155
- this.isRtl ? (t.index > o && n && n.right && (n.right = parseInt(n.right, 10) - h + "px"), t.index < o && n && n.left && (n.left = parseInt(n.left, 10) - h + "px")) : (t.index > o && n && n.left && (n.left = parseInt(n.left, 10) - h + "px"), t.index < o && n && n.right && (n.right = parseInt(n.right, 10) - h + "px"));
154
+ const s = d.style;
155
+ this.isRtl ? (t.index > n && s && s.right && (s.right = parseInt(s.right, 10) - o + "px"), t.index < n && s && s.left && (s.left = parseInt(s.left, 10) - o + "px")) : (t.index > n && s && s.left && (s.left = parseInt(s.left, 10) - o + "px"), t.index < n && s && s.right && (s.right = parseInt(s.right, 10) - o + "px"));
156
156
  });
157
157
  }
158
158
  });
package/getRowContents.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("react"),s=require("@progress/kendo-react-common"),W=require("@progress/kendo-react-data-tools"),G=require("./utils/index.js"),X=require("./cells/datacell/GridCell.js"),Y=require("./cells/datacell/GridCellServer.js"),Z=require("./cells/editcell/GridEditCell.js"),ee=require("./cells/editcell/GridEditCellServer.js");function te(l){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const t in l)if(t!=="default"){const g=Object.getOwnPropertyDescriptor(l,t);Object.defineProperty(d,t,g.get?g:{enumerable:!0,get:()=>l[t]})}}return d.default=l,Object.freeze(d)}const le=te(U);function oe(l,d,t,g,O,q,i){const{leafColumns:C,columnsState:R,idPrefix:_,gridClasses:A,unstyled:D,localization:N,intl:P,cells:j,isRowReorderable:x,sort:H,editable:K,isClient:v,isEditDialog:V,dataItemKey:o,select:b,highlight:S}=l;let T=!1;const c=b&&o&&s.getter(o)(t.dataItem)!==void 0?b[s.getter(o)(t.dataItem)]:void 0,f=S&&o&&s.getter(o)(t.dataItem)!==void 0?S[s.getter(o)(t.dataItem)]:void 0;return{row:(l.hasDynamicColSpan?l.getCellsToRender(t.dataItem):l.cellsToRender).map(({columnIndex:a,colSpan:z})=>{var h,I,k,m,E,w;const e=C[a],y=R[a],B=(I=(h=e.locked)!=null?h:y==null?void 0:y.locked)!=null?I:!1;let u;if((k=e.rowSpannable)!=null&&k.enabled&&t.rowType==="data"&&e.field&&i){const r=e.field?(E=(m=e.rowSpannable).valueGetter)==null?void 0:E.call(m,t.dataItem,e.field):null;u={value:r,count:1},i[e.field]&&((w=i[e.field])==null?void 0:w.value)===r&&i[e.field]!==null?(i[e.field].count++,u.count=null):i[e.field]=u}const M=e.id?e.id:a,$=s.classNames(A.contentSticky({locked:B}),e.className),F=e.left!==void 0?{left:e.left,right:e.right}:{};let p=!1;if(e.editable&&K){const r=d&&o?d[s.getter(o)(t.dataItem)]:void 0;let n;typeof r=="boolean"?n=r:Array.isArray(r)?n=e.field?r.indexOf(e.field)>-1:!1:n=e.field!==void 0&&r===e.field,n&&e.columnType==="data"&&(n===!0||n===e.field)&&(T=!0,V||(p=!0))}const L=e._type==="expand",J={locked:e.locked,id:W.tableKeyboardNavigationTools.generateNavigatableId(`${g}-${String(a)}`,_,L||t.rowType==="groupHeader"||t.rowType==="groupFooter"||e.field==="value"?"nodata":"cell"),colSpan:z,dataItem:t.dataItem,field:e.field,editor:e.editor,format:e.format,columnType:e.columnType,rowReorderable:x,className:$,cells:G.resolveCells(j,e.cells),columnIndex:a,columnsCount:C.length,rowType:t.rowType,level:t.level,expanded:t.expanded,dataIndex:t.dataIndex,rowDataIndex:O,columnPosition:F,style:{},ariaColumnIndex:e.ariaColumnIndex,isSelected:!!((e==null?void 0:e._type)==="edit"?c:Array.isArray(c)&&c.indexOf(a)>-1),isHighlighted:!!((e==null?void 0:e._type)==="edit"?f:Array.isArray(f)&&f.indexOf(a)>-1),isSorted:!!G.isSorted(e.field,H),isInEdit:p,isAlt:q,unstyled:D,group:t.group,localization:N,intl:P,_rowSpan:u},Q=e.defaultCell||p&&(v?Z.GridEditCell:ee.GridEditCellServer)||(v?X.GridCell:Y.GridCellServer);return le.createElement(Q,{key:M,cellProps:J})}),isInEdit:T,isSelected:typeof c=="boolean"&&c,isHighlighted:typeof f=="boolean"&&f}}exports.getRowContents=oe;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const U=require("react"),s=require("@progress/kendo-react-common"),W=require("@progress/kendo-react-data-tools"),G=require("./utils/index.js"),X=require("./cells/datacell/GridCell.js"),Y=require("./cells/datacell/GridCellServer.js"),Z=require("./cells/editcell/GridEditCell.js"),ee=require("./cells/editcell/GridEditCellServer.js");function te(l){const d=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(l){for(const t in l)if(t!=="default"){const g=Object.getOwnPropertyDescriptor(l,t);Object.defineProperty(d,t,g.get?g:{enumerable:!0,get:()=>l[t]})}}return d.default=l,Object.freeze(d)}const le=te(U);function oe(l,d,t,g,O,q,i){const{leafColumns:C,columnsState:R,idPrefix:_,gridClasses:A,unstyled:D,localization:N,intl:P,cells:j,isRowReorderable:x,sort:H,editable:K,isClient:v,isEditDialog:V,dataItemKey:o,select:b,highlight:S}=l;let T=!1;const c=b&&o&&s.getter(o)(t.dataItem)!==void 0?b[s.getter(o)(t.dataItem)]:void 0,f=S&&o&&s.getter(o)(t.dataItem)!==void 0?S[s.getter(o)(t.dataItem)]:void 0;return{row:(l.hasDynamicColSpan?l.getCellsToRender(t.dataItem):l.cellsToRender).map(({columnIndex:a,colSpan:z})=>{var m,h,I,k,E,w;const e=C[a],y=R[a],B=(h=(m=e.locked)!=null?m:y==null?void 0:y.locked)!=null?h:!1;let u;if((I=e.rowSpannable)!=null&&I.enabled&&t.rowType==="data"&&e.field&&i){const r=e.field?(E=(k=e.rowSpannable).valueGetter)==null?void 0:E.call(k,t.dataItem,e.field):null;u={value:r,count:1},i[e.field]&&((w=i[e.field])==null?void 0:w.value)===r&&i[e.field]!==null?(i[e.field].count++,u.count=null):i[e.field]=u}const M=e.id?e.id:a,$=s.classNames(A.contentSticky({locked:B}),e.className),F=e.left!==void 0?{left:e.left,right:e.right}:{};let p=!1;if(e.editable&&K){const r=d&&o?d[s.getter(o)(t.dataItem)]:void 0;let n;typeof r=="boolean"?n=r:Array.isArray(r)?n=e.field?r.indexOf(e.field)>-1:!1:n=e.field!==void 0&&r===e.field,n&&e.columnType==="data"&&(n===!0||n===e.field)&&(T=!0,V||(p=!0))}const L=e._type==="expand",J={locked:e.locked,id:W.tableKeyboardNavigationTools.generateNavigatableId(`${g}-${String(a)}`,_,L||t.rowType==="groupHeader"||t.rowType==="groupFooter"||e.field==="value"?"nodata":"cell"),colSpan:z,dataItem:t.dataItem,field:e.field,editor:e.editor,format:e.format,columnType:e.columnType,rowReorderable:x,className:$,cells:G.resolveCells(j,e.cells),columnIndex:a,columnsCount:C.length,rowType:t.rowType,level:t.level,expanded:t.expanded,dataIndex:t.dataIndex,rowDataIndex:O,columnPosition:F,style:{},ariaColumnIndex:e.ariaColumnIndex,isSelected:!!(e._type==="edit"?c:Array.isArray(c)&&c.indexOf(a)>-1),isHighlighted:!!(e._type==="edit"?f:Array.isArray(f)&&f.indexOf(a)>-1),isSorted:!!G.isSorted(e.field,H),isInEdit:p,isAlt:q,unstyled:D,group:t.group,localization:N,intl:P,_rowSpan:u},Q=e.defaultCell||p&&(v?Z.GridEditCell:ee.GridEditCellServer)||(v?X.GridCell:Y.GridCellServer);return le.createElement(Q,{key:M,cellProps:J})}),isInEdit:T,isSelected:typeof c=="boolean"&&c,isHighlighted:typeof f=="boolean"&&f}}exports.getRowContents=oe;
@@ -33,22 +33,22 @@ function ce(c, y, l, w, A, G, a) {
33
33
  highlight: C
34
34
  } = c;
35
35
  let h = !1;
36
- const d = v && t && f(t)(l.dataItem) !== void 0 ? v[f(t)(l.dataItem)] : void 0, s = C && t && f(t)(l.dataItem) !== void 0 ? C[f(t)(l.dataItem)] : void 0;
36
+ const d = v && t && f(t)(l.dataItem) !== void 0 ? v[f(t)(l.dataItem)] : void 0, n = C && t && f(t)(l.dataItem) !== void 0 ? C[f(t)(l.dataItem)] : void 0;
37
37
  return {
38
38
  row: (c.hasDynamicColSpan ? c.getCellsToRender(l.dataItem) : c.cellsToRender).map(({ columnIndex: i, colSpan: $ }) => {
39
39
  var b, I, S, T, k, E;
40
- const e = g[i], p = N[i], z = (I = (b = e.locked) != null ? b : p == null ? void 0 : p.locked) != null ? I : !1;
41
- let n;
40
+ const e = g[i], u = N[i], z = (I = (b = e.locked) != null ? b : u == null ? void 0 : u.locked) != null ? I : !1;
41
+ let s;
42
42
  if ((S = e.rowSpannable) != null && S.enabled && l.rowType === "data" && e.field && a) {
43
43
  const o = e.field ? (k = (T = e.rowSpannable).valueGetter) == null ? void 0 : k.call(T, l.dataItem, e.field) : null;
44
- n = { value: o, count: 1 }, a[e.field] && ((E = a[e.field]) == null ? void 0 : E.value) === o && a[e.field] !== null ? (a[e.field].count++, n.count = null) : a[e.field] = n;
44
+ s = { value: o, count: 1 }, a[e.field] && ((E = a[e.field]) == null ? void 0 : E.value) === o && a[e.field] !== null ? (a[e.field].count++, s.count = null) : a[e.field] = s;
45
45
  }
46
46
  const F = e.id ? e.id : i, L = U(_.contentSticky({ locked: z }), e.className), j = e.left !== void 0 ? { left: e.left, right: e.right } : {};
47
- let u = !1;
47
+ let p = !1;
48
48
  if (e.editable && V) {
49
49
  const o = y && t ? y[f(t)(l.dataItem)] : void 0;
50
50
  let r;
51
- typeof o == "boolean" ? r = o : Array.isArray(o) ? r = e.field ? o.indexOf(e.field) > -1 : !1 : r = e.field !== void 0 && o === e.field, r && e.columnType === "data" && (r === !0 || r === e.field) && (h = !0, B || (u = !0));
51
+ typeof o == "boolean" ? r = o : Array.isArray(o) ? r = e.field ? o.indexOf(e.field) > -1 : !1 : r = e.field !== void 0 && o === e.field, r && e.columnType === "data" && (r === !0 || r === e.field) && (h = !0, B || (p = !0));
52
52
  }
53
53
  const q = e._type === "expand", J = {
54
54
  locked: e.locked,
@@ -76,22 +76,22 @@ function ce(c, y, l, w, A, G, a) {
76
76
  columnPosition: j,
77
77
  style: {},
78
78
  ariaColumnIndex: e.ariaColumnIndex,
79
- isSelected: !!((e == null ? void 0 : e._type) === "edit" ? d : Array.isArray(d) && d.indexOf(i) > -1),
80
- isHighlighted: !!((e == null ? void 0 : e._type) === "edit" ? s : Array.isArray(s) && s.indexOf(i) > -1),
79
+ isSelected: !!(e._type === "edit" ? d : Array.isArray(d) && d.indexOf(i) > -1),
80
+ isHighlighted: !!(e._type === "edit" ? n : Array.isArray(n) && n.indexOf(i) > -1),
81
81
  isSorted: !!X(e.field, R),
82
- isInEdit: u,
82
+ isInEdit: p,
83
83
  isAlt: G,
84
84
  unstyled: D,
85
85
  group: l.group,
86
86
  localization: H,
87
87
  intl: K,
88
- _rowSpan: n
89
- }, M = e.defaultCell || u && (m ? le : te) || (m ? Z : ee);
88
+ _rowSpan: s
89
+ }, M = e.defaultCell || p && (m ? le : te) || (m ? Z : ee);
90
90
  return /* @__PURE__ */ Q.createElement(M, { key: F, cellProps: J });
91
91
  }),
92
92
  isInEdit: h,
93
93
  isSelected: typeof d == "boolean" && d,
94
- isHighlighted: typeof s == "boolean" && s
94
+ isHighlighted: typeof n == "boolean" && n
95
95
  };
96
96
  }
97
97
  export {
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-grid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1780558566,version:"15.0.1-develop.9",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=Object.freeze({name:"@progress/kendo-react-grid",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate: 1782316181,version:"15.1.0-develop.2",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
@@ -7,7 +7,7 @@ export const packageMetadata = Object.freeze({
7
7
  productName: 'KendoReact',
8
8
  productCode: 'KENDOUIREACT',
9
9
  productCodes: ['KENDOUIREACT'],
10
- publishDate: 1780558566,
11
- version: '15.0.1-develop.9',
10
+ publishDate: 1782316181,
11
+ version: '15.1.0-develop.2',
12
12
  licensingDocsUrl: 'https://www.telerik.com/kendo-react-ui/components/my-license/'
13
13
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-grid",
3
- "version": "15.0.1-develop.9",
3
+ "version": "15.1.0-develop.2",
4
4
  "description": "React Data Grid (Table) provides 100+ ready-to-use data grid features. KendoReact Grid package",
5
5
  "author": "Progress",
6
6
  "license": "SEE LICENSE IN LICENSE.md",
@@ -30,21 +30,21 @@
30
30
  "@progress/kendo-drawing": "^1.21.2",
31
31
  "@progress/kendo-file-saver": "^1.1.1",
32
32
  "@progress/kendo-licensing": "^1.7.2",
33
- "@progress/kendo-react-animation": "15.0.1-develop.9",
34
- "@progress/kendo-react-buttons": "15.0.1-develop.9",
35
- "@progress/kendo-react-common": "15.0.1-develop.9",
36
- "@progress/kendo-react-data-tools": "15.0.1-develop.9",
37
- "@progress/kendo-react-dateinputs": "15.0.1-develop.9",
38
- "@progress/kendo-react-indicators": "15.0.1-develop.9",
39
- "@progress/kendo-react-form": "15.0.1-develop.9",
40
- "@progress/kendo-react-labels": "15.0.1-develop.9",
41
- "@progress/kendo-react-dialogs": "15.0.1-develop.9",
42
- "@progress/kendo-react-dropdowns": "15.0.1-develop.9",
43
- "@progress/kendo-react-inputs": "15.0.1-develop.9",
44
- "@progress/kendo-react-intl": "15.0.1-develop.9",
45
- "@progress/kendo-react-popup": "15.0.1-develop.9",
46
- "@progress/kendo-react-layout": "15.0.1-develop.9",
47
- "@progress/kendo-react-conversational-ui": "15.0.1-develop.9",
33
+ "@progress/kendo-react-animation": "15.1.0-develop.2",
34
+ "@progress/kendo-react-buttons": "15.1.0-develop.2",
35
+ "@progress/kendo-react-common": "15.1.0-develop.2",
36
+ "@progress/kendo-react-data-tools": "15.1.0-develop.2",
37
+ "@progress/kendo-react-dateinputs": "15.1.0-develop.2",
38
+ "@progress/kendo-react-indicators": "15.1.0-develop.2",
39
+ "@progress/kendo-react-form": "15.1.0-develop.2",
40
+ "@progress/kendo-react-labels": "15.1.0-develop.2",
41
+ "@progress/kendo-react-dialogs": "15.1.0-develop.2",
42
+ "@progress/kendo-react-dropdowns": "15.1.0-develop.2",
43
+ "@progress/kendo-react-inputs": "15.1.0-develop.2",
44
+ "@progress/kendo-react-intl": "15.1.0-develop.2",
45
+ "@progress/kendo-react-popup": "15.1.0-develop.2",
46
+ "@progress/kendo-react-layout": "15.1.0-develop.2",
47
+ "@progress/kendo-react-conversational-ui": "15.1.0-develop.2",
48
48
  "@progress/kendo-svg-icons": "^4.9.0 || ^5.0.0",
49
49
  "react": "^18.0.0 || ^19.0.0",
50
50
  "react-dom": "^18.0.0 || ^19.0.0"
@@ -148,7 +148,7 @@
148
148
  "package": {
149
149
  "productName": "KendoReact",
150
150
  "productCode": "KENDOUIREACT",
151
- "publishDate": 1780558566,
151
+ "publishDate": 1782316181,
152
152
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
153
153
  }
154
154
  },
package/utils/index.js CHANGED
@@ -5,4 +5,4 @@
5
5
  * Licensed under commercial license. See LICENSE.md in the package root for more information
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("react"),v=require("../GridColumn.js"),S=require("@progress/kendo-data-query"),y=require("@progress/kendo-react-data-tools"),O=require("./_serverModule.js"),T=require("./_clientModule.js"),h=require("../contextMenu/enums.js"),H=require("@progress/kendo-react-common");function j(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const M=j(k);function u(e,t){const a=(e!=null?e:"").split(".");let r=t;return a.forEach(n=>{r=r?r[n]:void 0}),r}function N(e,t,a,r,n,d,l,i,s,f=0,o){var x;let c=f;for(let g=0;g<t.length;g++){let C;if(!n||t[g].value===void 0||t[g].items===void 0){e[e.length]={dataIndex:r.index,dataItem:t[g],rowType:"data",level:f,group:o,expanded:(x=s?!!(d!=null&&d[S.getter(s)(t[g])]):!1)!=null?x:!1},r.index++;continue}else{let w;o!=null&&o.parents?w=[{field:o.field,value:o.value},...o.parents]:o?w=[o]:w=[],C={field:t[g].field,value:t[g].value,parents:w}}c=Math.max(c,f+1);let I=!1;const b=y.findGroupExpand(l||[],C);b?I=b.expanded!==!1:I=i!==!1,e[e.length]={dataIndex:-1,dataItem:t[g],level:f,group:C,rowType:"groupHeader",expanded:I},I&&(C.expanded=I,c=Math.max(N(e,t[g].items,a,r,n,d,l,i,s,f+1,C),c)),(a==="always"||I&&a==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[g],rowType:"groupFooter",level:f,expanded:I})}return c}function p(e,t){for(let a=0;a<e.length;a++){const r=e[a];if(r.locked===void 0){const n=t[r.index];n&&(r.locked=n.locked)}}}const q=(e,t)=>typeof e.colSpan=="function"?e.colSpan({dataItem:t,column:e}):e.colSpan||1;function B(e,t,a){const r=[[]];let n=0;for(let i=e.length-1;i>=0;i--)n=Math.max(n,e[i].depth),e[i].headerColSpan=e[i].headerColSpan||1,e[i].children.length>0&&(e[i].headerColSpan=e[i].children.reduce((s,f)=>f.hidden?s:s+f.headerColSpan,0));const d=[];let l=1;return e.forEach((i,s)=>{r[i.depth]=r[i.depth]||[];let f=!1;r[i.depth].length===0&&(l<=1?l=1+(i.children.length>0?0:n-i.depth):(l--,f=!0)),i.rowSpan=1+(i.children.length>0?0:n-i.depth),i.kFirst=f,i.index=r[i.depth].length,r[i.depth].push(s),i.ariaColumnIndex=d[i.depth]?d[i.depth]+1:1;for(let o=i.depth;o<i.depth+i.rowSpan;o++)d[o]=(d[o]||0)+i.headerColSpan}),p(e,t),y.updateLeft(r,e,a),y.updateRight(r,e,a),r}function R(e,t,a,r=0,n=!1){const d=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.forEach((i,s)=>{i=i.props?i.props:i;const f=i.id?i.id:y.tableKeyboardNavigationTools.generateNavigatableId(`${a.prevId++}`,a.idPrefix,"column"),o=H.canUseDOM&&i.media&&window.matchMedia?!window.matchMedia(i.media).matches:!1,c=n||o||i.hidden,x=t==null?void 0:t.find(C=>C.id===f),g=R(i.children,(x==null?void 0:x.children)||[],a,r+1,c);d.push(Object.assign({depth:r},v.gridDefaultProps,g.length?{cell:()=>null,filterCell:()=>null}:{},i,{id:f,declarationIndex:d.length,children:g,headerColSpan:0,rowSpan:0,columnType:i.columnType||"data",colSpan:i.colSpan||1,isAccessible:!0,hidden:c,left:null,right:null,rowSpannable:i.rowSpannable},x?{width:x.width,orderIndex:x.orderIndex}:{}))});const l=(i,s)=>i.orderIndex===s.orderIndex?i.declarationIndex-s.declarationIndex:(i.orderIndex||0)-(s.orderIndex||0);if(d.sort(l),r===0){const i=[],s=(f,o)=>f.forEach(c=>{c.parentIndex=o,s(c.children,i.push(c)-1)});return s(d,-1),i}return d}const D=e=>Array.isArray(e)?e:e?e.data:[];function z(e,t,a,r){const n=D(e),d=[];if(n.length>0){let l=n[0];if(t)for(let s=0;s<t.length;s++)l=l.items&&l.items[0];Object.getOwnPropertyNames(l).forEach(s=>{s!==a.column&&d.push(Object.assign({id:y.tableKeyboardNavigationTools.generateNavigatableId(`${r.prevId++}`,r.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,headerColSpan:0,rowSpan:0,index:0,columnType:"data",left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},v.gridDefaultProps,{field:s}))})}return d}const _=(e,t)=>{var r;let a=e[t.parentIndex];for(;a;){if((r=a.cells)!=null&&r.footerCell)return!0;a=e[a.parentIndex]}return!1},L=e=>e.filter(t=>{var a;return _(e,t)?!1:!!((a=t.cells)!=null&&a.footerCell)||!(t.children&&t.children.length>0)}),$=e=>{let t=e.width;return typeof(e==null?void 0:e.width)=="number"&&(e!=null&&e.minResizableWidth)&&(e==null?void 0:e.width)<(e==null?void 0:e.minResizableWidth)&&(t=e==null?void 0:e.minResizableWidth),typeof(e==null?void 0:e.width)=="number"&&(e!=null&&e.minWidth)&&(e==null?void 0:e.width)<(e==null?void 0:e.minWidth)?t=e==null?void 0:e.minWidth:typeof(e==null?void 0:e.width)=="number"&&(e!=null&&e.maxWidth)&&(e==null?void 0:e.width)>(e==null?void 0:e.maxWidth)&&(t=e==null?void 0:e.maxWidth),t!==void 0?Math.floor(parseFloat(t.toString()))+"px":void 0},V=(e,t)=>t&&t.filter(a=>a.field===e).length>0,A=e=>(e.sort((t,a)=>t.declarationIndex-a.declarationIndex),e.map(t=>{const{declarationIndex:a,parentIndex:r,depth:n,headerColSpan:d,rowSpan:l,index:i,kFirst:s,children:f,...o}=t;return f.length?{children:A(f),...o}:o})),E=e=>{const{cells:t,rowSpannable:a,defaultCell:r,...n}=e;return e.children.length?{...n,children:e.children.map(E)}:n},G=e=>({id:e.id,field:e.field,title:e.title,width:e.width,orderIndex:e.orderIndex,hidden:!1,minWidth:e.minWidth,maxWidth:e.maxWidth,isAccessible:e.isAccessible,children:e.children?W(e.children):null}),W=e=>e.map(G),P=e=>{const t=[],a=r=>r==null?void 0:r.forEach(n=>{t.push(n),a(n.children)});return a(e),t},K=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),Q=17895697,U=e=>{let t=[];return e.sortable&&(t=t.concat([h.GridContextMenuItemNames.sortAsc,h.GridContextMenuItemNames.sortDesc])),e.pdf&&(t.length&&(t=t.concat([h.GridContextMenuItemNames.separator])),t=t.concat([h.GridContextMenuItemNames.exportPDF])),t},J=e=>{let t=[];return e.clipboard&&(t=t.concat([h.GridContextMenuItemNames.copySelection,h.GridContextMenuItemNames.copySelectionNoHeaders,h.GridContextMenuItemNames.paste])),e.editable&&(t.length&&(t=t.concat([h.GridContextMenuItemNames.separator])),t=t.concat([h.GridContextMenuItemNames.create,h.GridContextMenuItemNames.edit,h.GridContextMenuItemNames.delete])),e.selectable&&(t.length&&(t=t.concat([h.GridContextMenuItemNames.separator])),t=t.concat([h.GridContextMenuItemNames.select])),e.rowReorderable&&(t.length&&(t=t.concat([h.GridContextMenuItemNames.separator])),t=t.concat([h.GridContextMenuItemNames.reorderRow])),e.pdf&&(t.length&&(t=t.concat([h.GridContextMenuItemNames.separator])),t=t.concat([h.GridContextMenuItemNames.exportPDF])),e.pinnable&&(t.length&&(t=t.concat([h.GridContextMenuItemNames.separator])),t=t.concat([h.GridContextMenuItemNames.pinRow])),t},X=(e,t)=>{if(!(!e&&!t))return t?e?{...e,...t,select:{...e.select||{},...t.select||{}},hierarchy:{...e.hierarchy||{},...t.hierarchy||{}},group:{...e.group||{},...t.group||{}},edit:{...e.edit||{},...t.edit||{}}}:t:e},Y=e=>{var a;return typeof e=="object"?(a=e.enabled)!=null?a:!0:e!=null?e:!1},Z=()=>O.ServerFragment===T.ClientFragment,m=e=>!!(e&&e.$$typeof===Symbol.for("react.client.reference")),ee=e=>({id:e.id,ariaColumnIndex:e.ariaColumnIndex,isSelected:e.isSelected,isHighlighted:e.isHighlighted,isInEdit:e.isInEdit,isSorted:e.isSorted,isAlt:e.isAlt,expanded:e.expanded,className:e.className,style:e.style,field:e.field,dataItem:e.dataItem,format:e.format,colSpan:e.colSpan,dataIndex:e.dataIndex,columnIndex:e.columnIndex,columnsCount:e.columnsCount,rowType:e.rowType,level:e.level,editor:e.editor,locked:e.locked,isRtl:e.isRtl,rowDataIndex:e.rowDataIndex,columnPosition:e.columnPosition,group:e.group}),te=e=>{var r,n;const t=typeof e=="object"?(r=e.enabled)!=null?r:!0:e!=null?e:!1,a=typeof e=="object"?(n=e.valueGetter)!=null?n:((d,l)=>S.getter(l)(d)):(d,l)=>S.getter(l)(d);return{enabled:t,valueGetter:a}},F=e=>{var t;return M.isValidElement(e)?e:(t=M.Children.toArray(e))==null?void 0:t[0]},ie=(e,t)=>{const a=F(e);return a?M.cloneElement(a,t):null},ae=e=>{let t=0;if(e){const a=e.insertRow(0),r=a.insertCell(0);r.textContent="&nbsp;",t=a.getBoundingClientRect().height,e.deleteRow(0)}return t};exports.autoGenerateColumns=z;exports.calcRowHeight=ae;exports.clientColumn=E;exports.cloneReactElement=ie;exports.firefox=K;exports.firefoxMaxHeight=Q;exports.flatData=N;exports.footerColumns=L;exports.getClientCellProps=ee;exports.getColSpan=q;exports.getColumnState=G;exports.getColumnWidth=$;exports.getColumnsState=W;exports.getDataAsArray=D;exports.getDefaultBodyContextMenuItems=J;exports.getDefaultHeadContextMenuItems=U;exports.getFlatColumnsState=P;exports.getNestedValue=u;exports.getReactElement=F;exports.getRowSpanOptions=te;exports.isClient=Z;exports.isClientReference=m;exports.isRowReorderEnabled=Y;exports.isSorted=V;exports.mapColumns=B;exports.readColumns=R;exports.resolveCells=X;exports.sanitizeColumns=A;exports.syncLockedColumns=p;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const W=require("react"),M=require("../GridColumn.js"),y=require("@progress/kendo-data-query"),I=require("@progress/kendo-react-data-tools"),F=require("./_serverModule.js"),k=require("./_clientModule.js"),c=require("../contextMenu/enums.js"),O=require("@progress/kendo-react-common");function T(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const i in e)if(i!=="default"){const a=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,a.get?a:{enumerable:!0,get:()=>e[i]})}}return t.default=e,Object.freeze(t)}const w=T(W);function H(e,t){const i=(e!=null?e:"").split(".");let a=t;return i.forEach(r=>{a=a?a[r]:void 0}),a}function b(e,t,i,a,r,d,f,n,o,s=0,l){var x;let g=s;for(let h=0;h<t.length;h++){let u;if(!r||t[h].value===void 0||t[h].items===void 0){e[e.length]={dataIndex:a.index,dataItem:t[h],rowType:"data",level:s,group:l,expanded:(x=o?!!(d!=null&&d[y.getter(o)(t[h])]):!1)!=null?x:!1},a.index++;continue}else{let m;l!=null&&l.parents?m=[{field:l.field,value:l.value},...l.parents]:l?m=[l]:m=[],u={field:t[h].field,value:t[h].value,parents:m}}g=Math.max(g,s+1);let C=!1;const S=I.findGroupExpand(f||[],u);S?C=S.expanded!==!1:C=n!==!1,e[e.length]={dataIndex:-1,dataItem:t[h],level:s,group:u,rowType:"groupHeader",expanded:C},C&&(u.expanded=C,g=Math.max(b(e,t[h].items,i,a,r,d,f,n,o,s+1,u),g)),(i==="always"||C&&i==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[h],rowType:"groupFooter",level:s,expanded:C})}return g}function v(e,t){for(let i=0;i<e.length;i++){const a=e[i];if(a.locked===void 0){const r=t[a.index];r&&(a.locked=r.locked)}}}const j=(e,t)=>typeof e.colSpan=="function"?e.colSpan({dataItem:t,column:e}):e.colSpan||1;function q(e,t,i){const a=[[]];let r=0;for(let n=e.length-1;n>=0;n--)r=Math.max(r,e[n].depth),e[n].headerColSpan=e[n].headerColSpan||1,e[n].children.length>0&&(e[n].headerColSpan=e[n].children.reduce((o,s)=>s.hidden?o:o+s.headerColSpan,0));const d=[];let f=1;return e.forEach((n,o)=>{a[n.depth]=a[n.depth]||[];let s=!1;a[n.depth].length===0&&(f<=1?f=1+(n.children.length>0?0:r-n.depth):(f--,s=!0)),n.rowSpan=1+(n.children.length>0?0:r-n.depth),n.kFirst=s,n.index=a[n.depth].length,a[n.depth].push(o),n.ariaColumnIndex=d[n.depth]?d[n.depth]+1:1;for(let l=n.depth;l<n.depth+n.rowSpan;l++)d[l]=(d[l]||0)+n.headerColSpan}),v(e,t),I.updateLeft(a,e,i),I.updateRight(a,e,i),a}function N(e,t,i,a=0,r=!1){const d=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.forEach((n,o)=>{n=n.props?n.props:n;const s=n.id?n.id:I.tableKeyboardNavigationTools.generateNavigatableId(`${i.prevId++}`,i.idPrefix,"column"),l=O.canUseDOM&&n.media&&window.matchMedia?!window.matchMedia(n.media).matches:!1,g=r||l||n.hidden,x=t==null?void 0:t.find(u=>u.id===s),h=N(n.children,(x==null?void 0:x.children)||[],i,a+1,g);d.push(Object.assign({depth:a},M.gridDefaultProps,h.length?{cell:()=>null,filterCell:()=>null}:{},n,{id:s,declarationIndex:d.length,children:h,headerColSpan:0,rowSpan:0,columnType:n.columnType||"data",colSpan:n.colSpan||1,isAccessible:!0,hidden:g,left:null,right:null,rowSpannable:n.rowSpannable},x?{width:x.width,orderIndex:x.orderIndex}:{}))});const f=(n,o)=>n.orderIndex===o.orderIndex?n.declarationIndex-o.declarationIndex:(n.orderIndex||0)-(o.orderIndex||0);if(d.sort(f),a===0){const n=[],o=(s,l)=>s.forEach(g=>{g.parentIndex=l,o(g.children,n.push(g)-1)});return o(d,-1),n}return d}const p=e=>Array.isArray(e)?e:e?e.data:[];function B(e,t,i,a){const r=p(e),d=[];if(r.length>0){let f=r[0];if(t)for(let o=0;o<t.length;o++)f=f.items&&f.items[0];Object.getOwnPropertyNames(f).forEach(o=>{o!==i.column&&d.push(Object.assign({id:I.tableKeyboardNavigationTools.generateNavigatableId(`${a.prevId++}`,a.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,headerColSpan:0,rowSpan:0,index:0,columnType:"data",left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},M.gridDefaultProps,{field:o}))})}return d}const z=(e,t)=>{var a;let i=e[t.parentIndex];for(;i;){if((a=i.cells)!=null&&a.footerCell)return!0;i=e[i.parentIndex]}return!1},_=e=>e.filter(t=>{var i;return z(e,t)?!1:!!((i=t.cells)!=null&&i.footerCell)||!(t.children&&t.children.length>0)}),L=e=>{let t=e.width;return typeof e.width=="number"&&e.minResizableWidth&&e.width<e.minResizableWidth&&(t=e.minResizableWidth),typeof e.width=="number"&&e.minWidth&&e.width<e.minWidth?t=e.minWidth:typeof e.width=="number"&&e.maxWidth&&e.width>e.maxWidth&&(t=e.maxWidth),t!==void 0?Math.floor(parseFloat(t.toString()))+"px":void 0},$=(e,t)=>t&&t.filter(i=>i.field===e).length>0,R=e=>(e.sort((t,i)=>t.declarationIndex-i.declarationIndex),e.map(t=>{const{declarationIndex:i,parentIndex:a,depth:r,headerColSpan:d,rowSpan:f,index:n,kFirst:o,children:s,...l}=t;return s.length?{children:R(s),...l}:l})),D=e=>{const{cells:t,rowSpannable:i,defaultCell:a,...r}=e;return e.children.length?{...r,children:e.children.map(D)}:r},A=e=>({id:e.id,field:e.field,title:e.title,width:e.width,orderIndex:e.orderIndex,hidden:!1,minWidth:e.minWidth,maxWidth:e.maxWidth,isAccessible:e.isAccessible,children:e.children?E(e.children):null}),E=e=>e.map(A),V=e=>{const t=[],i=a=>a==null?void 0:a.forEach(r=>{t.push(r),i(r.children)});return i(e),t},P=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),K=17895697,Q=e=>{let t=[];return e.sortable&&(t=t.concat([c.GridContextMenuItemNames.sortAsc,c.GridContextMenuItemNames.sortDesc])),e.pdf&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.exportPDF])),t},U=e=>{let t=[];return e.clipboard&&(t=t.concat([c.GridContextMenuItemNames.copySelection,c.GridContextMenuItemNames.copySelectionNoHeaders,c.GridContextMenuItemNames.paste])),e.editable&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.create,c.GridContextMenuItemNames.edit,c.GridContextMenuItemNames.delete])),e.selectable&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.select])),e.rowReorderable&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.reorderRow])),e.pdf&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.exportPDF])),e.pinnable&&(t.length&&(t=t.concat([c.GridContextMenuItemNames.separator])),t=t.concat([c.GridContextMenuItemNames.pinRow])),t},J=(e,t)=>{if(!(!e&&!t))return t?e?{...e,...t,select:{...e.select||{},...t.select||{}},hierarchy:{...e.hierarchy||{},...t.hierarchy||{}},group:{...e.group||{},...t.group||{}},edit:{...e.edit||{},...t.edit||{}}}:t:e},X=e=>{var i;return typeof e=="object"?(i=e.enabled)!=null?i:!0:e!=null?e:!1},Y=()=>F.ServerFragment===k.ClientFragment,Z=e=>!!(e&&e.$$typeof===Symbol.for("react.client.reference")),ee=e=>({id:e.id,ariaColumnIndex:e.ariaColumnIndex,isSelected:e.isSelected,isHighlighted:e.isHighlighted,isInEdit:e.isInEdit,isSorted:e.isSorted,isAlt:e.isAlt,expanded:e.expanded,className:e.className,style:e.style,field:e.field,dataItem:e.dataItem,format:e.format,colSpan:e.colSpan,dataIndex:e.dataIndex,columnIndex:e.columnIndex,columnsCount:e.columnsCount,rowType:e.rowType,level:e.level,editor:e.editor,locked:e.locked,isRtl:e.isRtl,rowDataIndex:e.rowDataIndex,columnPosition:e.columnPosition,group:e.group}),te=e=>{var a,r;const t=typeof e=="object"?(a=e.enabled)!=null?a:!0:e!=null?e:!1,i=typeof e=="object"?(r=e.valueGetter)!=null?r:((d,f)=>y.getter(f)(d)):(d,f)=>y.getter(f)(d);return{enabled:t,valueGetter:i}},G=e=>{var t;return w.isValidElement(e)?e:(t=w.Children.toArray(e))==null?void 0:t[0]},ne=(e,t)=>{const i=G(e);return i?w.cloneElement(i,t):null},ie=e=>{let t=0;if(e){const i=e.insertRow(0),a=i.insertCell(0);a.textContent="&nbsp;",t=i.getBoundingClientRect().height,e.deleteRow(0)}return t};exports.autoGenerateColumns=B;exports.calcRowHeight=ie;exports.clientColumn=D;exports.cloneReactElement=ne;exports.firefox=P;exports.firefoxMaxHeight=K;exports.flatData=b;exports.footerColumns=_;exports.getClientCellProps=ee;exports.getColSpan=j;exports.getColumnState=A;exports.getColumnWidth=L;exports.getColumnsState=E;exports.getDataAsArray=p;exports.getDefaultBodyContextMenuItems=U;exports.getDefaultHeadContextMenuItems=Q;exports.getFlatColumnsState=V;exports.getNestedValue=H;exports.getReactElement=G;exports.getRowSpanOptions=te;exports.isClient=Y;exports.isClientReference=Z;exports.isRowReorderEnabled=X;exports.isSorted=$;exports.mapColumns=q;exports.readColumns=N;exports.resolveCells=J;exports.sanitizeColumns=R;exports.syncLockedColumns=v;