@progress/kendo-react-grid 13.2.0-develop.4 → 13.2.0-develop.6

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"),G=1,w=20;class x{constructor(u){this.columns=[],this.columnsState=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=c=>{this.isRtl=c},this.initWidths=()=>{var h;const c=((h=this.colGroupMain)==null?void 0:h.children)||[],l=p.getFlatColumnsState(this.columnsState),r=this.columns.filter(n=>{var o;return!((o=n.children)!=null&&o.length)});for(let n=0;n<c.length;n++){const o=c[n];let t="";const i=l.find(s=>s.id===r[n].id);i&&(t=i.width||""),o.width=t,this.colGroupHeader&&(this.colGroupHeader.children[n].width=t),this.colGroupFooter&&(this.colGroupFooter.children[n].width=t)}},this.dragHandler=(c,l,r,h)=>{const n=c.originalEvent;h||(n.preventDefault(),n.stopPropagation(),n.stopImmediatePropagation());const o=r.closest("th");if(!o||!o)return;const t=o.clientWidth;let i=t;if(this.isRtl?i+=r.getBoundingClientRect().right-r.offsetWidth/2-c.clientX:i+=c.clientX-r.getBoundingClientRect().left-r.offsetWidth/2,!h&&Math.abs(i-t)<1)return;this.fixateInitialWidths(o.parentElement.clientWidth),this.setWidths(l,Math.floor(i)/t);const s=this.columns.filter(e=>!e.children.length).findIndex(e=>e.id===l.id);this.onResize(s,t,i,n,h,this.columnsState,l.id)},this.dblClickHandler=(c,l)=>{const r=this.columns.filter(d=>l.indexOf(d.id)>-1),h=p.getFlatColumnsState(this.columnsState);if(!this.colGroupMain||!r.length)return;const n={},o=r;for(;o.length>0;){const d=o.pop();if(!d)break;d.children.length?o.push(...d.children):n[d.id]=d}const t=this.columns.filter(d=>!d.children.length),i=[];t.forEach((d,f)=>{n[d.id]&&i.push(f)});const s=[this.colGroupMain.parentElement],e=[this.colGroupMain];this.colGroupHeader&&(s.push(this.colGroupHeader.parentElement),e.push(this.colGroupHeader)),this.colGroupFooter&&(s.push(this.colGroupFooter.parentElement),e.push(this.colGroupFooter)),s.forEach(d=>d.classList.add("k-autofitting"));const a=[];e.forEach(d=>{i.forEach(f=>{d.children[f]&&(d.children[f].width="",a[f]=Math.max(a[f]||0,d.children[f].offsetWidth+G))})}),e.forEach(d=>{i.forEach(f=>{if(d.children[f]){d.children[f].width=a[f]+"px";const g=h.find(m=>m.id===t[f].id);g&&(g.width=a[f])}})}),s.forEach(d=>d.classList.remove("k-autofitting")),this.onResize(i[0],0,0,c,!0,this.columnsState,l[0])},this.updateColElements=c=>{const l=this.columns.filter(h=>!h.hidden&&!h.children.length);let r=1e-10;for(let h=0;h<c.length;h++){const n=c[h],o=l.findIndex(a=>a.id===n.id),t=parseFloat((n.width||0).toString()),i=Math.floor(t);r+=t-i;const s=i+Math.floor(r);r-=Math.floor(r);const e=l.find(a=>a.id===n.id);if(!e)return;if(this.colGroupMain&&this.colGroupMain.children[o]){const a=parseInt(this.colGroupMain.children[o].width,10);this.colGroupMain.children[o].width=s+"px",this.updateNextLockedCol(this.colGroupMain.parentElement,e,a-s)}if(this.colGroupHeader&&this.colGroupHeader.children[o]){const a=parseInt(this.colGroupHeader.children[o].width,10);this.colGroupHeader.children[o].width=s+"px",this.updateNextLockedCol(this.colGroupHeader.parentElement,e,a-s)}if(this.colGroupFooter&&this.colGroupFooter.children[o]){const a=parseInt(this.colGroupFooter.children[o].width,10);this.colGroupFooter.children[o].width=s+"px",this.updateNextLockedCol(this.colGroupFooter.parentElement,e,a-s)}}},this.onResize=u}fixateInitialWidths(u){var o;let c=0;const l=((o=this.colGroupMain)==null?void 0:o.children)||[];for(let t=0;t<l.length;t++)l[t].width?u-=l[t].clientWidth:c++;if(c===0)return;const r=Math.floor(u/c),h=p.getFlatColumnsState(this.columnsState),n=this.columns.filter(t=>!t.children.length);for(let t=0;t<l.length;t++){const i=l[t],s=i.width?i.clientWidth:r;i.width=s;const e=h.find(a=>a.id===n[t].id);e&&(e.width=s.toString()),this.colGroupHeader&&(this.colGroupHeader.children[t].width=s),this.colGroupFooter&&(this.colGroupFooter.children[t].width=s)}}setWidths(u,c){const l=p.getFlatColumnsState(this.columnsState),r=this.columns.findIndex(t=>t.id===u.id),h=[];let n=u.children.filter(t=>!t.hidden).length;for(let t=r+1;t<this.columns.length&&!(n<=0);t++){const i=this.columns[t];i.children.length?n+=i.children.filter(s=>!s.hidden).length:h.push(i),n--}h.length===0&&h.push(u);const o=[];h.forEach(t=>{const i=l.find(s=>s.id===t.id);if(i){let s=i.width?parseFloat(i.width.toString())*c:0;const e=t.minResizableWidth===void 0?10:t.minResizableWidth;s<e&&(s=e),i.width=s,o.push(i)}}),this.updateColElements(o)}updateNextLockedCol(u,c,l){const r=c.index,h=this.colGroupMain.parentElement.closest(".k-grid"),n=h==null?void 0:h.clientWidth,o=this.columns.filter(t=>t.locked).map(t=>parseInt(t.width+"",10)).reduce((t,i)=>t+i,0);!c.locked||n<=o+w||this.columns.forEach(t=>{if(t!=null&&t.locked&&l){const i=u==null?void 0:u.querySelectorAll('[aria-colindex="'+t.ariaColumnIndex+'"]');i==null||i.forEach(s=>{const e=s.style;this.isRtl?(t.index>r&&e&&e.right&&(e.right=parseInt(e.right,10)-l+"px"),t.index<r&&e&&e.left&&(e.left=parseInt(e.left,10)-l+"px")):(t.index>r&&e&&e.left&&(e.left=parseInt(e.left,10)-l+"px"),t.index<r&&e&&e.right&&(e.right=parseInt(e.right,10)-l+"px"))})}})}}exports.ColumnResize=x;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../utils/index.js"),m=1,w=20;class W{constructor(a){this.columns=[],this.columnsState=[],this.resizable=!1,this.isRtl=!1,this.setIsRtl=n=>{this.isRtl=n},this.initWidths=()=>{var c;const n=((c=this.colGroupMain)==null?void 0:c.children)||[],l=u.getFlatColumnsState(this.columnsState),r=this.columns.filter(e=>{var s;return!((s=e.children)!=null&&s.length)});for(let e=0;e<n.length;e++){const s=n[e],t=r[e];let i="";const h=l.find(o=>o.id===r[e].id);h&&(i=this.applyWidthConstraints(h,t)),s.width=i,this.colGroupHeader&&(this.colGroupHeader.children[e].width=i),this.colGroupFooter&&(this.colGroupFooter.children[e].width=i)}},this.dragHandler=(n,l,r,c)=>{const e=n.originalEvent;c||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation());const s=r.closest("th");if(!s||!s)return;const t=s.clientWidth;let i=t;if(this.isRtl?i+=r.getBoundingClientRect().right-r.offsetWidth/2-n.clientX:i+=n.clientX-r.getBoundingClientRect().left-r.offsetWidth/2,!c&&Math.abs(i-t)<1)return;this.fixateInitialWidths(s.parentElement.clientWidth),this.setWidths(l,Math.floor(i)/t);const h=this.columns.filter(o=>!o.children.length).findIndex(o=>o.id===l.id);this.onResize(h,t,i,e,c,this.columnsState,l.id)},this.dblClickHandler=(n,l)=>{const r=this.columns.filter(d=>l.indexOf(d.id)>-1),c=u.getFlatColumnsState(this.columnsState);if(!this.colGroupMain||!r.length)return;const e={},s=r;for(;s.length>0;){const d=s.pop();if(!d)break;d.children.length?s.push(...d.children):e[d.id]=d}const t=this.columns.filter(d=>!d.children.length),i=[];t.forEach((d,p)=>{e[d.id]&&i.push(p)});const h=[this.colGroupMain.parentElement],o=[this.colGroupMain];this.colGroupHeader&&(h.push(this.colGroupHeader.parentElement),o.push(this.colGroupHeader)),this.colGroupFooter&&(h.push(this.colGroupFooter.parentElement),o.push(this.colGroupFooter)),h.forEach(d=>d.classList.add("k-autofitting"));const f=[];o.forEach(d=>{i.forEach(p=>{d.children[p]&&(d.children[p].width="",f[p]=Math.max(f[p]||0,d.children[p].offsetWidth+m))})}),o.forEach(d=>{i.forEach(p=>{if(d.children[p]){d.children[p].width=f[p]+"px";const g=c.find(G=>G.id===t[p].id);g&&(g.width=f[p])}})}),h.forEach(d=>d.classList.remove("k-autofitting")),this.onResize(i[0],0,0,n,!0,this.columnsState,l[0])},this.updateColElements=n=>{const l=this.columns.filter(c=>!c.hidden&&!c.children.length);let r=1e-10;for(let c=0;c<n.length;c++){const e=n[c],s=l.findIndex(f=>f.id===e.id),t=parseFloat((e.width||0).toString()),i=Math.floor(t);r+=t-i;const h=i+Math.floor(r);r-=Math.floor(r);const o=l.find(f=>f.id===e.id);if(!o)return;if(this.colGroupMain&&this.colGroupMain.children[s]){const f=parseInt(this.colGroupMain.children[s].width,10);this.colGroupMain.children[s].width=h+"px",this.updateNextLockedCol(this.colGroupMain.parentElement,o,f-h)}if(this.colGroupHeader&&this.colGroupHeader.children[s]){const f=parseInt(this.colGroupHeader.children[s].width,10);this.colGroupHeader.children[s].width=h+"px",this.updateNextLockedCol(this.colGroupHeader.parentElement,o,f-h)}if(this.colGroupFooter&&this.colGroupFooter.children[s]){const f=parseInt(this.colGroupFooter.children[s].width,10);this.colGroupFooter.children[s].width=h+"px",this.updateNextLockedCol(this.colGroupFooter.parentElement,o,f-h)}}},this.onResize=a}applyWidthConstraints(a,n,l=1){if(!a.width)return a.width||"";const r=a.width.toString();if(r.includes("%")){const s=parseFloat(r)*l,t=Math.max(0,Math.min(100,s));return a.width=t+"%",a.width}else{let e=parseFloat(r)*l;const s=n.minResizableWidth===void 0?10:n.minResizableWidth,t=n==null?void 0:n.minWidth,i=t!==void 0?Math.max(s,t):s,h=n==null?void 0:n.maxWidth;return e<i&&(e=i),h!==void 0&&e>h&&(e=h),a.width=e,e}}fixateInitialWidths(a){var s;let n=0;const l=((s=this.colGroupMain)==null?void 0:s.children)||[];for(let t=0;t<l.length;t++)l[t].width?a-=l[t].clientWidth:n++;if(n===0)return;const r=Math.floor(a/n),c=u.getFlatColumnsState(this.columnsState),e=this.columns.filter(t=>!t.children.length);for(let t=0;t<l.length;t++){const i=l[t],h=i.width?i.clientWidth:r;i.width=h;const o=c.find(f=>f.id===e[t].id);o&&(o.width=h.toString()),this.colGroupHeader&&(this.colGroupHeader.children[t].width=h),this.colGroupFooter&&(this.colGroupFooter.children[t].width=h)}}setWidths(a,n){const l=u.getFlatColumnsState(this.columnsState),r=this.columns.findIndex(t=>t.id===a.id),c=[];let e=a.children.filter(t=>!t.hidden).length;for(let t=r+1;t<this.columns.length&&!(e<=0);t++){const i=this.columns[t];i.children.length?e+=i.children.filter(h=>!h.hidden).length:c.push(i),e--}c.length===0&&c.push(a);const s=[];c.forEach(t=>{const i=l.find(h=>h.id===t.id);i&&(this.applyWidthConstraints(i,t,n),s.push(i))}),this.updateColElements(s)}updateNextLockedCol(a,n,l){const r=n.index,c=this.colGroupMain.parentElement.closest(".k-grid"),e=c==null?void 0:c.clientWidth,s=this.columns.filter(t=>t.locked).map(t=>parseInt(t.width+"",10)).reduce((t,i)=>t+i,0);!n.locked||e<=s+w||this.columns.forEach(t=>{if(t!=null&&t.locked&&l){const i=a==null?void 0:a.querySelectorAll('[aria-colindex="'+t.ariaColumnIndex+'"]');i==null||i.forEach(h=>{const o=h.style;this.isRtl?(t.index>r&&o&&o.right&&(o.right=parseInt(o.right,10)-l+"px"),t.index<r&&o&&o.left&&(o.left=parseInt(o.left,10)-l+"px")):(t.index>r&&o&&o.left&&(o.left=parseInt(o.left,10)-l+"px"),t.index<r&&o&&o.right&&(o.right=parseInt(o.right,10)-l+"px"))})}})}}exports.ColumnResize=W;
@@ -6,143 +6,152 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import { getFlatColumnsState as u } from "../utils/index.mjs";
9
- const m = 1, w = 20;
10
- class E {
11
- constructor(p) {
12
- this.columns = [], this.columnsState = [], this.resizable = !1, this.isRtl = !1, this.setIsRtl = (c) => {
13
- this.isRtl = c;
9
+ const w = 1, W = 20;
10
+ class F {
11
+ constructor(a) {
12
+ this.columns = [], this.columnsState = [], this.resizable = !1, this.isRtl = !1, this.setIsRtl = (h) => {
13
+ this.isRtl = h;
14
14
  }, this.initWidths = () => {
15
- var n;
16
- const c = ((n = this.colGroupMain) == null ? void 0 : n.children) || [], r = u(this.columnsState), l = this.columns.filter((h) => {
17
- var o;
18
- return !((o = h.children) != null && o.length);
15
+ var c;
16
+ const h = ((c = this.colGroupMain) == null ? void 0 : c.children) || [], l = u(this.columnsState), r = this.columns.filter((e) => {
17
+ var s;
18
+ return !((s = e.children) != null && s.length);
19
19
  });
20
- for (let h = 0; h < c.length; h++) {
21
- const o = c[h];
22
- let t = "";
23
- const i = r.find((s) => s.id === l[h].id);
24
- i && (t = i.width || ""), o.width = t, this.colGroupHeader && (this.colGroupHeader.children[h].width = t), this.colGroupFooter && (this.colGroupFooter.children[h].width = t);
20
+ for (let e = 0; e < h.length; e++) {
21
+ const s = h[e], t = r[e];
22
+ let i = "";
23
+ const n = l.find((o) => o.id === r[e].id);
24
+ n && (i = this.applyWidthConstraints(n, t)), s.width = i, this.colGroupHeader && (this.colGroupHeader.children[e].width = i), this.colGroupFooter && (this.colGroupFooter.children[e].width = i);
25
25
  }
26
- }, this.dragHandler = (c, r, l, n) => {
27
- const h = c.originalEvent;
28
- n || (h.preventDefault(), h.stopPropagation(), h.stopImmediatePropagation());
29
- const o = l.closest("th");
30
- if (!o || !o)
26
+ }, this.dragHandler = (h, l, r, c) => {
27
+ const e = h.originalEvent;
28
+ c || (e.preventDefault(), e.stopPropagation(), e.stopImmediatePropagation());
29
+ const s = r.closest("th");
30
+ if (!s || !s)
31
31
  return;
32
- const t = o.clientWidth;
32
+ const t = s.clientWidth;
33
33
  let i = t;
34
- if (this.isRtl ? i += l.getBoundingClientRect().right - l.offsetWidth / 2 - c.clientX : i += c.clientX - l.getBoundingClientRect().left - l.offsetWidth / 2, !n && Math.abs(i - t) < 1)
34
+ if (this.isRtl ? i += r.getBoundingClientRect().right - r.offsetWidth / 2 - h.clientX : i += h.clientX - r.getBoundingClientRect().left - r.offsetWidth / 2, !c && Math.abs(i - t) < 1)
35
35
  return;
36
- this.fixateInitialWidths(o.parentElement.clientWidth), this.setWidths(r, Math.floor(i) / t);
37
- const s = this.columns.filter((e) => !e.children.length).findIndex((e) => e.id === r.id);
38
- this.onResize(s, t, i, h, n, this.columnsState, r.id);
39
- }, this.dblClickHandler = (c, r) => {
40
- const l = this.columns.filter((d) => r.indexOf(d.id) > -1), n = u(this.columnsState);
41
- if (!this.colGroupMain || !l.length)
36
+ this.fixateInitialWidths(s.parentElement.clientWidth), this.setWidths(l, Math.floor(i) / t);
37
+ const n = this.columns.filter((o) => !o.children.length).findIndex((o) => o.id === l.id);
38
+ this.onResize(n, t, i, e, c, this.columnsState, l.id);
39
+ }, this.dblClickHandler = (h, l) => {
40
+ const r = this.columns.filter((d) => l.indexOf(d.id) > -1), c = u(this.columnsState);
41
+ if (!this.colGroupMain || !r.length)
42
42
  return;
43
- const h = {}, o = l;
44
- for (; o.length > 0; ) {
45
- const d = o.pop();
43
+ const e = {}, s = r;
44
+ for (; s.length > 0; ) {
45
+ const d = s.pop();
46
46
  if (!d)
47
47
  break;
48
- d.children.length ? o.push(...d.children) : h[d.id] = d;
48
+ d.children.length ? s.push(...d.children) : e[d.id] = d;
49
49
  }
50
50
  const t = this.columns.filter((d) => !d.children.length), i = [];
51
- t.forEach((d, f) => {
52
- h[d.id] && i.push(f);
51
+ t.forEach((d, p) => {
52
+ e[d.id] && i.push(p);
53
53
  });
54
- const s = [this.colGroupMain.parentElement], e = [this.colGroupMain];
55
- this.colGroupHeader && (s.push(this.colGroupHeader.parentElement), e.push(this.colGroupHeader)), this.colGroupFooter && (s.push(this.colGroupFooter.parentElement), e.push(this.colGroupFooter)), s.forEach((d) => d.classList.add("k-autofitting"));
56
- const a = [];
57
- e.forEach((d) => {
58
- i.forEach((f) => {
59
- d.children[f] && (d.children[f].width = "", a[f] = Math.max(
60
- a[f] || 0,
61
- d.children[f].offsetWidth + m
54
+ const n = [this.colGroupMain.parentElement], o = [this.colGroupMain];
55
+ this.colGroupHeader && (n.push(this.colGroupHeader.parentElement), o.push(this.colGroupHeader)), this.colGroupFooter && (n.push(this.colGroupFooter.parentElement), o.push(this.colGroupFooter)), n.forEach((d) => d.classList.add("k-autofitting"));
56
+ const f = [];
57
+ o.forEach((d) => {
58
+ i.forEach((p) => {
59
+ d.children[p] && (d.children[p].width = "", f[p] = Math.max(
60
+ f[p] || 0,
61
+ d.children[p].offsetWidth + w
62
62
  ));
63
63
  });
64
- }), e.forEach((d) => {
65
- i.forEach((f) => {
66
- if (d.children[f]) {
67
- d.children[f].width = a[f] + "px";
68
- const g = n.find((G) => G.id === t[f].id);
69
- g && (g.width = a[f]);
64
+ }), o.forEach((d) => {
65
+ i.forEach((p) => {
66
+ if (d.children[p]) {
67
+ d.children[p].width = f[p] + "px";
68
+ const g = c.find((G) => G.id === t[p].id);
69
+ g && (g.width = f[p]);
70
70
  }
71
71
  });
72
- }), s.forEach((d) => d.classList.remove("k-autofitting")), this.onResize(i[0], 0, 0, c, !0, this.columnsState, r[0]);
73
- }, this.updateColElements = (c) => {
74
- const r = this.columns.filter((n) => !n.hidden && !n.children.length);
75
- let l = 1e-10;
76
- for (let n = 0; n < c.length; n++) {
77
- const h = c[n], o = r.findIndex((a) => a.id === h.id), t = parseFloat((h.width || 0).toString()), i = Math.floor(t);
78
- l += t - i;
79
- const s = i + Math.floor(l);
80
- l -= Math.floor(l);
81
- const e = r.find((a) => a.id === h.id);
82
- if (!e)
72
+ }), n.forEach((d) => d.classList.remove("k-autofitting")), this.onResize(i[0], 0, 0, h, !0, this.columnsState, l[0]);
73
+ }, this.updateColElements = (h) => {
74
+ const l = this.columns.filter((c) => !c.hidden && !c.children.length);
75
+ let r = 1e-10;
76
+ for (let c = 0; c < h.length; c++) {
77
+ const e = h[c], s = l.findIndex((f) => f.id === e.id), t = parseFloat((e.width || 0).toString()), i = Math.floor(t);
78
+ r += t - i;
79
+ const n = i + Math.floor(r);
80
+ r -= Math.floor(r);
81
+ const o = l.find((f) => f.id === e.id);
82
+ if (!o)
83
83
  return;
84
- if (this.colGroupMain && this.colGroupMain.children[o]) {
85
- const a = parseInt(this.colGroupMain.children[o].width, 10);
86
- this.colGroupMain.children[o].width = s + "px", this.updateNextLockedCol(this.colGroupMain.parentElement, e, a - s);
84
+ if (this.colGroupMain && this.colGroupMain.children[s]) {
85
+ const f = parseInt(this.colGroupMain.children[s].width, 10);
86
+ this.colGroupMain.children[s].width = n + "px", this.updateNextLockedCol(this.colGroupMain.parentElement, o, f - n);
87
87
  }
88
- if (this.colGroupHeader && this.colGroupHeader.children[o]) {
89
- const a = parseInt(this.colGroupHeader.children[o].width, 10);
90
- this.colGroupHeader.children[o].width = s + "px", this.updateNextLockedCol(this.colGroupHeader.parentElement, e, a - s);
88
+ if (this.colGroupHeader && this.colGroupHeader.children[s]) {
89
+ const f = parseInt(this.colGroupHeader.children[s].width, 10);
90
+ this.colGroupHeader.children[s].width = n + "px", this.updateNextLockedCol(this.colGroupHeader.parentElement, o, f - n);
91
91
  }
92
- if (this.colGroupFooter && this.colGroupFooter.children[o]) {
93
- const a = parseInt(this.colGroupFooter.children[o].width, 10);
94
- this.colGroupFooter.children[o].width = s + "px", this.updateNextLockedCol(this.colGroupFooter.parentElement, e, a - s);
92
+ if (this.colGroupFooter && this.colGroupFooter.children[s]) {
93
+ const f = parseInt(this.colGroupFooter.children[s].width, 10);
94
+ this.colGroupFooter.children[s].width = n + "px", this.updateNextLockedCol(this.colGroupFooter.parentElement, o, f - n);
95
95
  }
96
96
  }
97
- }, this.onResize = p;
97
+ }, this.onResize = a;
98
98
  }
99
- fixateInitialWidths(p) {
100
- var o;
101
- let c = 0;
102
- const r = ((o = this.colGroupMain) == null ? void 0 : o.children) || [];
103
- for (let t = 0; t < r.length; t++)
104
- r[t].width ? p -= r[t].clientWidth : c++;
105
- if (c === 0)
99
+ applyWidthConstraints(a, h, l = 1) {
100
+ if (!a.width)
101
+ return a.width || "";
102
+ const r = a.width.toString();
103
+ if (r.includes("%")) {
104
+ const s = parseFloat(r) * l, t = Math.max(0, Math.min(100, s));
105
+ return a.width = t + "%", a.width;
106
+ } else {
107
+ let e = parseFloat(r) * l;
108
+ const s = h.minResizableWidth === void 0 ? 10 : h.minResizableWidth, t = h == null ? void 0 : h.minWidth, i = t !== void 0 ? Math.max(s, t) : s, n = h == null ? void 0 : h.maxWidth;
109
+ return e < i && (e = i), n !== void 0 && e > n && (e = n), a.width = e, e;
110
+ }
111
+ }
112
+ fixateInitialWidths(a) {
113
+ var s;
114
+ let h = 0;
115
+ const l = ((s = this.colGroupMain) == null ? void 0 : s.children) || [];
116
+ for (let t = 0; t < l.length; t++)
117
+ l[t].width ? a -= l[t].clientWidth : h++;
118
+ if (h === 0)
106
119
  return;
107
- const l = Math.floor(p / c), n = u(this.columnsState), h = this.columns.filter((t) => !t.children.length);
108
- for (let t = 0; t < r.length; t++) {
109
- const i = r[t], s = i.width ? i.clientWidth : l;
110
- i.width = s;
111
- const e = n.find((a) => a.id === h[t].id);
112
- e && (e.width = s.toString()), this.colGroupHeader && (this.colGroupHeader.children[t].width = s), this.colGroupFooter && (this.colGroupFooter.children[t].width = s);
120
+ const r = Math.floor(a / h), c = u(this.columnsState), e = this.columns.filter((t) => !t.children.length);
121
+ for (let t = 0; t < l.length; t++) {
122
+ const i = l[t], n = i.width ? i.clientWidth : r;
123
+ i.width = n;
124
+ const o = c.find((f) => f.id === e[t].id);
125
+ o && (o.width = n.toString()), this.colGroupHeader && (this.colGroupHeader.children[t].width = n), this.colGroupFooter && (this.colGroupFooter.children[t].width = n);
113
126
  }
114
127
  }
115
- setWidths(p, c) {
116
- const r = u(this.columnsState), l = this.columns.findIndex((t) => t.id === p.id), n = [];
117
- let h = p.children.filter((t) => !t.hidden).length;
118
- for (let t = l + 1; t < this.columns.length && !(h <= 0); t++) {
128
+ setWidths(a, h) {
129
+ const l = u(this.columnsState), r = this.columns.findIndex((t) => t.id === a.id), c = [];
130
+ let e = a.children.filter((t) => !t.hidden).length;
131
+ for (let t = r + 1; t < this.columns.length && !(e <= 0); t++) {
119
132
  const i = this.columns[t];
120
- i.children.length ? h += i.children.filter((s) => !s.hidden).length : n.push(i), h--;
133
+ i.children.length ? e += i.children.filter((n) => !n.hidden).length : c.push(i), e--;
121
134
  }
122
- n.length === 0 && n.push(p);
123
- const o = [];
124
- n.forEach((t) => {
125
- const i = r.find((s) => s.id === t.id);
126
- if (i) {
127
- let s = i.width ? parseFloat(i.width.toString()) * c : 0;
128
- const e = t.minResizableWidth === void 0 ? 10 : t.minResizableWidth;
129
- s < e && (s = e), i.width = s, o.push(i);
130
- }
131
- }), this.updateColElements(o);
135
+ c.length === 0 && c.push(a);
136
+ const s = [];
137
+ c.forEach((t) => {
138
+ const i = l.find((n) => n.id === t.id);
139
+ i && (this.applyWidthConstraints(i, t, h), s.push(i));
140
+ }), this.updateColElements(s);
132
141
  }
133
- updateNextLockedCol(p, c, r) {
134
- const l = c.index, n = this.colGroupMain.parentElement.closest(".k-grid"), h = n == null ? void 0 : n.clientWidth, o = this.columns.filter((t) => t.locked).map((t) => parseInt(t.width + "", 10)).reduce((t, i) => t + i, 0);
135
- !c.locked || h <= o + w || this.columns.forEach((t) => {
136
- if (t != null && t.locked && r) {
137
- const i = p == null ? void 0 : p.querySelectorAll('[aria-colindex="' + t.ariaColumnIndex + '"]');
138
- i == null || i.forEach((s) => {
139
- const e = s.style;
140
- this.isRtl ? (t.index > l && e && e.right && (e.right = parseInt(e.right, 10) - r + "px"), t.index < l && e && e.left && (e.left = parseInt(e.left, 10) - r + "px")) : (t.index > l && e && e.left && (e.left = parseInt(e.left, 10) - r + "px"), t.index < l && e && e.right && (e.right = parseInt(e.right, 10) - r + "px"));
142
+ updateNextLockedCol(a, h, l) {
143
+ const r = h.index, c = this.colGroupMain.parentElement.closest(".k-grid"), e = c == null ? void 0 : c.clientWidth, s = this.columns.filter((t) => t.locked).map((t) => parseInt(t.width + "", 10)).reduce((t, i) => t + i, 0);
144
+ !h.locked || e <= s + W || this.columns.forEach((t) => {
145
+ if (t != null && t.locked && l) {
146
+ const i = a == null ? void 0 : a.querySelectorAll('[aria-colindex="' + t.ariaColumnIndex + '"]');
147
+ i == null || i.forEach((n) => {
148
+ const o = n.style;
149
+ this.isRtl ? (t.index > r && o && o.right && (o.right = parseInt(o.right, 10) - l + "px"), t.index < r && o && o.left && (o.left = parseInt(o.left, 10) - l + "px")) : (t.index > r && o && o.left && (o.left = parseInt(o.left, 10) - l + "px"), t.index < r && o && o.right && (o.right = parseInt(o.right, 10) - l + "px"));
141
150
  });
142
151
  }
143
152
  });
144
153
  }
145
154
  }
146
155
  export {
147
- E as ColumnResize
156
+ F as ColumnResize
148
157
  };
package/index.d.mts CHANGED
@@ -1603,7 +1603,7 @@ export declare interface GridColumnMenuWrapperProps extends GridColumnMenuProps
1603
1603
  /**
1604
1604
  * The props of the GridColumn component.
1605
1605
  */
1606
- export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell'> {
1606
+ export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell' | 'minResizableWidth'> {
1607
1607
  /**
1608
1608
  * Allows the column headers to be clicked and the `sortChange` event emitted.
1609
1609
  * You have to handle the `sortChange` event yourself and sort the data.
@@ -1786,6 +1786,20 @@ export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell'> {
1786
1786
  * @default "data"
1787
1787
  */
1788
1788
  columnType?: GridColumnType;
1789
+ /**
1790
+ * **Deprecated**: Use the `minWidth` property instead. The `minResizableWidth` property will be removed in a future version.
1791
+ *
1792
+ * @deprecated Use `minWidth` instead.
1793
+ */
1794
+ minResizableWidth?: number;
1795
+ /**
1796
+ * Sets the minimum width of the column (in pixels).
1797
+ */
1798
+ minWidth?: number;
1799
+ /**
1800
+ * Sets the maximum width of the column (in pixels).
1801
+ */
1802
+ maxWidth?: number;
1789
1803
  /**
1790
1804
  * Defines if the cells of the column should be spanned when their values are the same.
1791
1805
  *
@@ -1918,6 +1932,14 @@ export declare interface GridColumnState {
1918
1932
  * Determines if the column is locked to the left or right side of the grid.
1919
1933
  */
1920
1934
  locked?: boolean;
1935
+ /**
1936
+ * Sets the minimum width of the column (in pixels).
1937
+ */
1938
+ minWidth?: number;
1939
+ /**
1940
+ * Sets the maximum width of the column (in pixels).
1941
+ */
1942
+ maxWidth?: number;
1921
1943
  }
1922
1944
 
1923
1945
  /**
package/index.d.ts CHANGED
@@ -1603,7 +1603,7 @@ export declare interface GridColumnMenuWrapperProps extends GridColumnMenuProps
1603
1603
  /**
1604
1604
  * The props of the GridColumn component.
1605
1605
  */
1606
- export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell'> {
1606
+ export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell' | 'minResizableWidth'> {
1607
1607
  /**
1608
1608
  * Allows the column headers to be clicked and the `sortChange` event emitted.
1609
1609
  * You have to handle the `sortChange` event yourself and sort the data.
@@ -1786,6 +1786,20 @@ export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell'> {
1786
1786
  * @default "data"
1787
1787
  */
1788
1788
  columnType?: GridColumnType;
1789
+ /**
1790
+ * **Deprecated**: Use the `minWidth` property instead. The `minResizableWidth` property will be removed in a future version.
1791
+ *
1792
+ * @deprecated Use `minWidth` instead.
1793
+ */
1794
+ minResizableWidth?: number;
1795
+ /**
1796
+ * Sets the minimum width of the column (in pixels).
1797
+ */
1798
+ minWidth?: number;
1799
+ /**
1800
+ * Sets the maximum width of the column (in pixels).
1801
+ */
1802
+ maxWidth?: number;
1789
1803
  /**
1790
1804
  * Defines if the cells of the column should be spanned when their values are the same.
1791
1805
  *
@@ -1918,6 +1932,14 @@ export declare interface GridColumnState {
1918
1932
  * Determines if the column is locked to the left or right side of the grid.
1919
1933
  */
1920
1934
  locked?: boolean;
1935
+ /**
1936
+ * Sets the minimum width of the column (in pixels).
1937
+ */
1938
+ minWidth?: number;
1939
+ /**
1940
+ * Sets the maximum width of the column (in pixels).
1941
+ */
1942
+ maxWidth?: number;
1921
1943
  }
1922
1944
 
1923
1945
  /**
@@ -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: 1765055415,version:"13.2.0-develop.4",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: 1765282627,version:"13.2.0-develop.6",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"});exports.packageMetadata=e;
@@ -10,8 +10,8 @@ const e = Object.freeze({
10
10
  productName: "KendoReact",
11
11
  productCode: "KENDOUIREACT",
12
12
  productCodes: ["KENDOUIREACT"],
13
- publishDate: 1765055415,
14
- version: "13.2.0-develop.4",
13
+ publishDate: 1765282627,
14
+ version: "13.2.0-develop.6",
15
15
  licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
16
16
  });
17
17
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-grid",
3
- "version": "13.2.0-develop.4",
3
+ "version": "13.2.0-develop.6",
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",
@@ -28,21 +28,21 @@
28
28
  "@progress/kendo-data-query": "^1.7.2",
29
29
  "@progress/kendo-drawing": "^1.21.2",
30
30
  "@progress/kendo-licensing": "^1.7.2",
31
- "@progress/kendo-react-animation": "13.2.0-develop.4",
32
- "@progress/kendo-react-buttons": "13.2.0-develop.4",
33
- "@progress/kendo-react-common": "13.2.0-develop.4",
34
- "@progress/kendo-react-data-tools": "13.2.0-develop.4",
35
- "@progress/kendo-react-dateinputs": "13.2.0-develop.4",
36
- "@progress/kendo-react-indicators": "13.2.0-develop.4",
37
- "@progress/kendo-react-form": "13.2.0-develop.4",
38
- "@progress/kendo-react-labels": "13.2.0-develop.4",
39
- "@progress/kendo-react-dialogs": "13.2.0-develop.4",
40
- "@progress/kendo-react-dropdowns": "13.2.0-develop.4",
41
- "@progress/kendo-react-inputs": "13.2.0-develop.4",
42
- "@progress/kendo-react-intl": "13.2.0-develop.4",
43
- "@progress/kendo-react-popup": "13.2.0-develop.4",
44
- "@progress/kendo-react-layout": "13.2.0-develop.4",
45
- "@progress/kendo-react-conversational-ui": "13.2.0-develop.4",
31
+ "@progress/kendo-react-animation": "13.2.0-develop.6",
32
+ "@progress/kendo-react-buttons": "13.2.0-develop.6",
33
+ "@progress/kendo-react-common": "13.2.0-develop.6",
34
+ "@progress/kendo-react-data-tools": "13.2.0-develop.6",
35
+ "@progress/kendo-react-dateinputs": "13.2.0-develop.6",
36
+ "@progress/kendo-react-indicators": "13.2.0-develop.6",
37
+ "@progress/kendo-react-form": "13.2.0-develop.6",
38
+ "@progress/kendo-react-labels": "13.2.0-develop.6",
39
+ "@progress/kendo-react-dialogs": "13.2.0-develop.6",
40
+ "@progress/kendo-react-dropdowns": "13.2.0-develop.6",
41
+ "@progress/kendo-react-inputs": "13.2.0-develop.6",
42
+ "@progress/kendo-react-intl": "13.2.0-develop.6",
43
+ "@progress/kendo-react-popup": "13.2.0-develop.6",
44
+ "@progress/kendo-react-layout": "13.2.0-develop.6",
45
+ "@progress/kendo-react-conversational-ui": "13.2.0-develop.6",
46
46
  "@progress/kendo-svg-icons": "^4.0.0",
47
47
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
48
48
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^19.0.0-rc",
@@ -147,7 +147,7 @@
147
147
  "package": {
148
148
  "productName": "KendoReact",
149
149
  "productCode": "KENDOUIREACT",
150
- "publishDate": 1765055415,
150
+ "publishDate": 1765282627,
151
151
  "licensingDocsUrl": "https://www.telerik.com/kendo-react-ui/components/my-license/"
152
152
  }
153
153
  },
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 A=require("react"),w=require("../GridColumn.js"),y=require("@progress/kendo-data-query"),I=require("@progress/kendo-react-data-tools"),G=require("./_serverModule.js"),O=require("./_clientModule.js"),f=require("../contextMenu/enums.js"),T=require("@progress/kendo-react-common");function H(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 S=H(A);function j(e,t){const a=(e!=null?e:"").split(".");let r=t;return a.forEach(i=>{r=r?r[i]:void 0}),r}function v(e,t,a,r,i,d,c,n,o,s=0,l){var u;let g=s;for(let h=0;h<t.length;h++){let x;if(!i||t[h].value===void 0||t[h].items===void 0){e[e.length]={dataIndex:r.index,dataItem:t[h],rowType:"data",level:s,group:l,expanded:(u=o?!!(d!=null&&d[y.getter(o)(t[h])]):!1)!=null?u:!1},r.index++;continue}else{let m;l!=null&&l.parents?m=[{field:l.field,value:l.value},...l.parents]:l?m=[l]:m=[],x={field:t[h].field,value:t[h].value,parents:m}}g=Math.max(g,s+1);let C=!1;const M=I.findGroupExpand(c||[],x);M?C=M.expanded!==!1:C=n!==!1,e[e.length]={dataIndex:-1,dataItem:t[h],level:s,group:x,rowType:"groupHeader",expanded:C},C&&(x.expanded=C,g=Math.max(v(e,t[h].items,a,r,i,d,c,n,o,s+1,x),g)),(a==="always"||C&&a==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[h],rowType:"groupFooter",level:s,expanded:C})}return g}function N(e,t){for(let a=0;a<e.length;a++){const r=e[a];if(!r.locked){const i=t[r.index];i&&(r.locked=i.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 i=0;for(let n=e.length-1;n>=0;n--)i=Math.max(i,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 c=1;return e.forEach((n,o)=>{r[n.depth]=r[n.depth]||[];let s=!1;r[n.depth].length===0&&(c<=1?c=1+(n.children.length>0?0:i-n.depth):(c--,s=!0)),n.rowSpan=1+(n.children.length>0?0:i-n.depth),n.kFirst=s,n.index=r[n.depth].length,r[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}),N(e,t),I.updateLeft(r,e,a),I.updateRight(r,e,a),r}function b(e,t,a,r=0,i=!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(`${a.prevId++}`,a.idPrefix,"column"),l=T.canUseDOM&&n.media&&window.matchMedia?!window.matchMedia(n.media).matches:!1,g=i||l||n.hidden,u=t==null?void 0:t.find(x=>x.id===s),h=b(n.children,(u==null?void 0:u.children)||[],a,r+1,g);d.push(Object.assign({depth:r},w.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},u?{width:u.width,orderIndex:u.orderIndex}:{}))});const c=(n,o)=>n.orderIndex===o.orderIndex?n.declarationIndex-o.declarationIndex:(n.orderIndex||0)-(o.orderIndex||0);if(d.sort(c),r===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 D=e=>Array.isArray(e)?e:e?e.data:[];function _(e,t,a,r){const i=D(e),d=[];if(i.length>0){let c=i[0];if(t)for(let o=0;o<t.length;o++)c=c.items&&c.items[0];Object.getOwnPropertyNames(c).forEach(o=>{o!==a.column&&d.push(Object.assign({id:I.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},w.gridDefaultProps,{field:o}))})}return d}const L=(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},$=e=>e.filter(t=>{var a;return L(e,t)?!1:!!((a=t.cells)!=null&&a.footerCell)||!(t.children&&t.children.length>0)}),z=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,V=(e,t)=>t&&t.filter(a=>a.field===e).length>0,R=e=>(e.sort((t,a)=>t.declarationIndex-a.declarationIndex),e.map(t=>{const{declarationIndex:a,parentIndex:r,depth:i,headerColSpan:d,rowSpan:c,index:n,kFirst:o,children:s,...l}=t;return s.length?{children:R(s),...l}:l})),p=e=>{const{cells:t,rowSpannable:a,defaultCell:r,...i}=e;return e.children.length?{...i,children:e.children.map(p)}:i},E=e=>({id:e.id,field:e.field,title:e.title,width:e.width,orderIndex:e.orderIndex,hidden:!1,children:e.children?F(e.children):null}),F=e=>e.map(E),P=e=>{const t=[],a=r=>r==null?void 0:r.forEach(i=>{t.push(i),a(i.children)});return a(e),t},W=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),K=17895697,Q=e=>{let t=[];return e.sortable&&(t=t.concat([f.GridContextMenuItemNames.sortAsc,f.GridContextMenuItemNames.sortDesc])),e.pdf&&(t.length&&(t=t.concat([f.GridContextMenuItemNames.separator])),t=t.concat([f.GridContextMenuItemNames.exportPDF])),t},U=e=>{let t=[];return e.clipboard&&(t=t.concat([f.GridContextMenuItemNames.copySelection,f.GridContextMenuItemNames.copySelectionNoHeaders,f.GridContextMenuItemNames.paste])),e.editable&&(t.length&&(t=t.concat([f.GridContextMenuItemNames.separator])),t=t.concat([f.GridContextMenuItemNames.create,f.GridContextMenuItemNames.edit,f.GridContextMenuItemNames.delete])),e.selectable&&(t.length&&(t=t.concat([f.GridContextMenuItemNames.separator])),t=t.concat([f.GridContextMenuItemNames.select])),e.rowReorderable&&(t.length&&(t=t.concat([f.GridContextMenuItemNames.separator])),t=t.concat([f.GridContextMenuItemNames.reorderRow])),e.pdf&&(t.length&&(t=t.concat([f.GridContextMenuItemNames.separator])),t=t.concat([f.GridContextMenuItemNames.exportPDF])),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 a;return typeof e=="object"?(a=e.enabled)!=null?a:!0:e!=null?e:!1},Y=()=>G.ServerFragment===O.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 r,i;const t=typeof e=="object"?(r=e.enabled)!=null?r:!0:e!=null?e:!1,a=typeof e=="object"?(i=e.valueGetter)!=null?i:(d,c)=>y.getter(c)(d):(d,c)=>y.getter(c)(d);return{enabled:t,valueGetter:a}},k=e=>{var t;return S.isValidElement(e)?e:(t=S.Children.toArray(e))==null?void 0:t[0]},ne=(e,t)=>{const a=k(e);return a?S.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=_;exports.calcRowHeight=ae;exports.clientColumn=p;exports.cloneReactElement=ne;exports.firefox=W;exports.firefoxMaxHeight=K;exports.flatData=v;exports.footerColumns=$;exports.getClientCellProps=ee;exports.getColSpan=q;exports.getColumnState=E;exports.getColumnWidth=z;exports.getColumnsState=F;exports.getDataAsArray=D;exports.getDefaultBodyContextMenuItems=U;exports.getDefaultHeadContextMenuItems=Q;exports.getFlatColumnsState=P;exports.getNestedValue=j;exports.getReactElement=k;exports.getRowSpanOptions=te;exports.isClient=Y;exports.isClientReference=Z;exports.isRowReorderEnabled=X;exports.isSorted=V;exports.mapColumns=B;exports.readColumns=b;exports.resolveCells=J;exports.sanitizeColumns=R;exports.syncLockedColumns=N;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const G=require("react"),v=require("../GridColumn.js"),w=require("@progress/kendo-data-query"),y=require("@progress/kendo-react-data-tools"),O=require("./_serverModule.js"),T=require("./_clientModule.js"),l=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(G);function q(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,h,i,s,f=0,o){var c;let x=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:(c=s?!!(d!=null&&d[w.getter(s)(t[g])]):!1)!=null?c:!1},r.index++;continue}else{let S;o!=null&&o.parents?S=[{field:o.field,value:o.value},...o.parents]:o?S=[o]:S=[],C={field:t[g].field,value:t[g].value,parents:S}}x=Math.max(x,f+1);let I=!1;const b=y.findGroupExpand(h||[],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,x=Math.max(N(e,t[g].items,a,r,n,d,h,i,s,f+1,C),x)),(a==="always"||I&&a==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[g],rowType:"groupFooter",level:f,expanded:I})}return x}function R(e,t){for(let a=0;a<e.length;a++){const r=e[a];if(!r.locked){const n=t[r.index];n&&(r.locked=n.locked)}}}const u=(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 h=1;return e.forEach((i,s)=>{r[i.depth]=r[i.depth]||[];let f=!1;r[i.depth].length===0&&(h<=1?h=1+(i.children.length>0?0:n-i.depth):(h--,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}),R(e,t),y.updateLeft(r,e,a),y.updateRight(r,e,a),r}function p(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,x=n||o||i.hidden,c=t==null?void 0:t.find(C=>C.id===f),g=p(i.children,(c==null?void 0:c.children)||[],a,r+1,x);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:x,left:null,right:null,rowSpannable:i.rowSpannable},c?{width:c.width,orderIndex:c.orderIndex}:{}))});const h=(i,s)=>i.orderIndex===s.orderIndex?i.declarationIndex-s.declarationIndex:(i.orderIndex||0)-(s.orderIndex||0);if(d.sort(h),r===0){const i=[],s=(f,o)=>f.forEach(x=>{x.parentIndex=o,s(x.children,i.push(x)-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 h=n[0];if(t)for(let s=0;s<t.length;s++)h=h.items&&h.items[0];Object.getOwnPropertyNames(h).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,E=e=>(e.sort((t,a)=>t.declarationIndex-a.declarationIndex),e.map(t=>{const{declarationIndex:a,parentIndex:r,depth:n,headerColSpan:d,rowSpan:h,index:i,kFirst:s,children:f,...o}=t;return f.length?{children:E(f),...o}:o})),W=e=>{const{cells:t,rowSpannable:a,defaultCell:r,...n}=e;return e.children.length?{...n,children:e.children.map(W)}:n},F=e=>({id:e.id,field:e.field,title:e.title,width:e.width,orderIndex:e.orderIndex,hidden:!1,minWidth:e.minWidth,maxWidth:e.maxWidth,children:e.children?k(e.children):null}),k=e=>e.map(F),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([l.GridContextMenuItemNames.sortAsc,l.GridContextMenuItemNames.sortDesc])),e.pdf&&(t.length&&(t=t.concat([l.GridContextMenuItemNames.separator])),t=t.concat([l.GridContextMenuItemNames.exportPDF])),t},J=e=>{let t=[];return e.clipboard&&(t=t.concat([l.GridContextMenuItemNames.copySelection,l.GridContextMenuItemNames.copySelectionNoHeaders,l.GridContextMenuItemNames.paste])),e.editable&&(t.length&&(t=t.concat([l.GridContextMenuItemNames.separator])),t=t.concat([l.GridContextMenuItemNames.create,l.GridContextMenuItemNames.edit,l.GridContextMenuItemNames.delete])),e.selectable&&(t.length&&(t=t.concat([l.GridContextMenuItemNames.separator])),t=t.concat([l.GridContextMenuItemNames.select])),e.rowReorderable&&(t.length&&(t=t.concat([l.GridContextMenuItemNames.separator])),t=t.concat([l.GridContextMenuItemNames.reorderRow])),e.pdf&&(t.length&&(t=t.concat([l.GridContextMenuItemNames.separator])),t=t.concat([l.GridContextMenuItemNames.exportPDF])),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,h)=>w.getter(h)(d):(d,h)=>w.getter(h)(d);return{enabled:t,valueGetter:a}},A=e=>{var t;return M.isValidElement(e)?e:(t=M.Children.toArray(e))==null?void 0:t[0]},ie=(e,t)=>{const a=A(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=W;exports.cloneReactElement=ie;exports.firefox=K;exports.firefoxMaxHeight=Q;exports.flatData=N;exports.footerColumns=L;exports.getClientCellProps=ee;exports.getColSpan=u;exports.getColumnState=F;exports.getColumnWidth=$;exports.getColumnsState=k;exports.getDataAsArray=D;exports.getDefaultBodyContextMenuItems=J;exports.getDefaultHeadContextMenuItems=U;exports.getFlatColumnsState=P;exports.getNestedValue=q;exports.getReactElement=A;exports.getRowSpanOptions=te;exports.isClient=Z;exports.isClientReference=m;exports.isRowReorderEnabled=Y;exports.isSorted=V;exports.mapColumns=B;exports.readColumns=p;exports.resolveCells=X;exports.sanitizeColumns=E;exports.syncLockedColumns=R;