@progress/kendo-react-grid 8.2.0-develop.25 → 8.2.0-develop.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.mts CHANGED
@@ -484,7 +484,7 @@ export declare class GridClassComponent extends React_2.Component<GridProps> {
484
484
  private childrenToArray;
485
485
  private readColumns;
486
486
  private mapColumns;
487
- private filterHiddenColumns;
487
+ private filterColumnsByMediaProp;
488
488
  private initColumns;
489
489
  private configureColumns;
490
490
  private getHeaderRow;
@@ -501,6 +501,12 @@ export declare class GridClassComponent extends React_2.Component<GridProps> {
501
501
  */
502
502
  export declare const GridColumn: React_2.FunctionComponent<GridColumnProps>;
503
503
 
504
+ /**
505
+ * The type of elements that the children property of the Grid accepts.
506
+ */
507
+ export declare interface GridColumnChildrenProps extends GridColumnProps, ReactElement<GridColumnProps> {
508
+ }
509
+
504
510
  /**
505
511
  * @hidden
506
512
  */
@@ -1235,7 +1241,7 @@ export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell'> {
1235
1241
  /**
1236
1242
  * A collection of child columns.
1237
1243
  */
1238
- children?: GridColumnProps[] | ReactElement<GridColumnProps>[];
1244
+ children?: GridColumnProps[] | ReactElement<GridColumnProps>[] | GridColumnChildrenProps[];
1239
1245
  /**
1240
1246
  * Specifies a React element that will be cloned and rendered inside the column menu of the Grid ([see example]({% slug column_menu_grid %}#toc-basic-usage)).
1241
1247
  */
package/index.d.ts CHANGED
@@ -484,7 +484,7 @@ export declare class GridClassComponent extends React_2.Component<GridProps> {
484
484
  private childrenToArray;
485
485
  private readColumns;
486
486
  private mapColumns;
487
- private filterHiddenColumns;
487
+ private filterColumnsByMediaProp;
488
488
  private initColumns;
489
489
  private configureColumns;
490
490
  private getHeaderRow;
@@ -501,6 +501,12 @@ export declare class GridClassComponent extends React_2.Component<GridProps> {
501
501
  */
502
502
  export declare const GridColumn: React_2.FunctionComponent<GridColumnProps>;
503
503
 
504
+ /**
505
+ * The type of elements that the children property of the Grid accepts.
506
+ */
507
+ export declare interface GridColumnChildrenProps extends GridColumnProps, ReactElement<GridColumnProps> {
508
+ }
509
+
504
510
  /**
505
511
  * @hidden
506
512
  */
@@ -1235,7 +1241,7 @@ export declare interface GridColumnProps extends Omit<ColumnBaseProps, 'cell'> {
1235
1241
  /**
1236
1242
  * A collection of child columns.
1237
1243
  */
1238
- children?: GridColumnProps[] | ReactElement<GridColumnProps>[];
1244
+ children?: GridColumnProps[] | ReactElement<GridColumnProps>[] | GridColumnChildrenProps[];
1239
1245
  /**
1240
1246
  * Specifies a React element that will be cloned and rendered inside the column menu of the Grid ([see example]({% slug column_menu_grid %}#toc-basic-usage)).
1241
1247
  */
@@ -10,7 +10,7 @@ const e = {
10
10
  name: "@progress/kendo-react-grid",
11
11
  productName: "KendoReact",
12
12
  productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
13
- publishDate: 1722253887,
13
+ publishDate: 1722421078,
14
14
  version: "",
15
15
  licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@progress/kendo-react-grid",
3
- "version": "8.2.0-develop.25",
3
+ "version": "8.2.0-develop.28",
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",
@@ -25,15 +25,15 @@
25
25
  "@progress/kendo-data-query": "^1.0.0",
26
26
  "@progress/kendo-drawing": "^1.20.1",
27
27
  "@progress/kendo-licensing": "^1.3.4",
28
- "@progress/kendo-react-animation": "8.2.0-develop.25",
29
- "@progress/kendo-react-buttons": "8.2.0-develop.25",
30
- "@progress/kendo-react-common": "8.2.0-develop.25",
31
- "@progress/kendo-react-data-tools": "8.2.0-develop.25",
32
- "@progress/kendo-react-dateinputs": "8.2.0-develop.25",
33
- "@progress/kendo-react-dropdowns": "8.2.0-develop.25",
34
- "@progress/kendo-react-inputs": "8.2.0-develop.25",
35
- "@progress/kendo-react-intl": "8.2.0-develop.25",
36
- "@progress/kendo-react-popup": "8.2.0-develop.25",
28
+ "@progress/kendo-react-animation": "8.2.0-develop.28",
29
+ "@progress/kendo-react-buttons": "8.2.0-develop.28",
30
+ "@progress/kendo-react-common": "8.2.0-develop.28",
31
+ "@progress/kendo-react-data-tools": "8.2.0-develop.28",
32
+ "@progress/kendo-react-dateinputs": "8.2.0-develop.28",
33
+ "@progress/kendo-react-dropdowns": "8.2.0-develop.28",
34
+ "@progress/kendo-react-inputs": "8.2.0-develop.28",
35
+ "@progress/kendo-react-intl": "8.2.0-develop.28",
36
+ "@progress/kendo-react-popup": "8.2.0-develop.28",
37
37
  "@progress/kendo-svg-icons": "^3.0.0",
38
38
  "react": "^16.8.2 || ^17.0.0 || ^18.0.0",
39
39
  "react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
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 client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("../GridColumn.js"),x=require("@progress/kendo-react-data-tools");function f(e,t){const a=(e||"").split(".");let o=t;return a.forEach(i=>{o=o?o[i]:void 0}),o}function g(e,t,a,o,i,s,n=0){let d=n;for(let r=0;r<t.length;r++){if(!i||t[r].value===void 0||t[r].items===void 0){e[e.length]={dataIndex:o.index,dataItem:t[r],rowType:"data",level:n,expanded:s===void 0||f(s,t[r])},o.index++;continue}d=Math.max(d,n+1);const l=s===void 0||f(s,t[r])===void 0||f(s,t[r]);e[e.length]={dataIndex:-1,dataItem:t[r],level:n,rowType:"groupHeader",expanded:l},l&&(d=Math.max(g(e,t[r].items,a,o,i,s,n+1),d)),(a==="always"||l&&a==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[r],rowType:"groupFooter",level:n,expanded:l})}return d}function u(e,t,a,o=0){let i=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.forEach((n,d)=>{n=n.props?n.props:n;const r=t[d]||null,l=u(n.children,r&&r.children||[],a,o+1);i.push(Object.assign({depth:o},c.gridDefaultProps,l.length?{cell:()=>null,filterCell:()=>null}:{},r?{width:r.width,orderIndex:r.orderIndex}:{},n,{id:n.id?n.id:x.tableKeyboardNavigationTools.generateNavigatableId(`${a.prevId++}`,a.idPrefix,"column"),declarationIndex:i.length,children:l,rowSpan:0,colSpan:0,isAccessible:!0,left:r&&Math.floor(r.left),right:r&&Math.floor(r.right)}))});const s=(n,d)=>n.orderIndex===d.orderIndex?n.declarationIndex-d.declarationIndex:(n.orderIndex||0)-(d.orderIndex||0);if(i.sort(s),o===0){let n=[];const d=(r,l)=>r.forEach(h=>{h.parentIndex=l,d(h.children,n.push(h)-1)});return d(i,-1),n}return i}function p(e,t,a,o){let i=[];Array.isArray(e)?i=e:e&&(i=e.data);const s=[];if(i.length>0){let n=i[0];if(t)for(let r=0;r<t.length;r++)n=n.items&&n.items[0];Object.getOwnPropertyNames(n).forEach(r=>{r!==a&&s.push(Object.assign({id:x.tableKeyboardNavigationTools.generateNavigatableId(`${o.prevId++}`,o.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,rowSpan:0,index:0,left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},c.gridDefaultProps,{field:r}))})}return s}const v=(e,t)=>{let a=e[t.parentIndex];for(;a;){if(a.footerCell)return!0;a=e[a.parentIndex]}return!1},w=e=>e.filter(t=>v(e,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),y=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,I=e=>(e.sort((t,a)=>t.declarationIndex-a.declarationIndex),e.map(t=>{const{declarationIndex:a,parentIndex:o,depth:i,colSpan:s,rowSpan:n,index:d,kFirst:r,children:l,...h}=t;return l.length?{children:I(l),...h}:h})),b=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),S=17895697,M=(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};exports.autoGenerateColumns=p;exports.firefox=b;exports.firefoxMaxHeight=S;exports.flatData=g;exports.footerColumns=w;exports.getColumnWidth=y;exports.getNestedValue=f;exports.readColumns=u;exports.resolveCells=M;exports.sanitizeColumns=I;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("../GridColumn.js"),g=require("@progress/kendo-react-data-tools");function f(e,r){const a=(e||"").split(".");let o=r;return a.forEach(d=>{o=o?o[d]:void 0}),o}function u(e,r,a,o,d,l,s=0){let t=s;for(let n=0;n<r.length;n++){if(!d||r[n].value===void 0||r[n].items===void 0){e[e.length]={dataIndex:o.index,dataItem:r[n],rowType:"data",level:s,expanded:l===void 0||f(l,r[n])},o.index++;continue}t=Math.max(t,s+1);const i=l===void 0||f(l,r[n])===void 0||f(l,r[n]);e[e.length]={dataIndex:-1,dataItem:r[n],level:s,rowType:"groupHeader",expanded:i},i&&(t=Math.max(u(e,r[n].items,a,o,d,l,s+1),t)),(a==="always"||i&&a==="visible")&&(e[e.length]={dataIndex:-1,dataItem:r[n],rowType:"groupFooter",level:s,expanded:i})}return t}function p(e,r,a,o=0){let d=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.filter(t=>t&&t.props?!t.props.hidden:!t.hidden).forEach((t,n)=>{t=t.props?t.props:t;const i=r[n]||null,h=p(t.children,i&&i.children||[],a,o+1);d.push(Object.assign({depth:o},x.gridDefaultProps,h.length?{cell:()=>null,filterCell:()=>null}:{},i?{width:i.width,orderIndex:i.orderIndex}:{},t,{id:t.id?t.id:g.tableKeyboardNavigationTools.generateNavigatableId(`${a.prevId++}`,a.idPrefix,"column"),declarationIndex:d.length,children:h,rowSpan:0,colSpan:0,isAccessible:!0,left:i&&Math.floor(i.left),right:i&&Math.floor(i.right)}))});const s=(t,n)=>t.orderIndex===n.orderIndex?t.declarationIndex-n.declarationIndex:(t.orderIndex||0)-(n.orderIndex||0);if(d.sort(s),o===0){let t=[];const n=(i,h)=>i.forEach(c=>{c.parentIndex=h,n(c.children,t.push(c)-1)});return n(d,-1),t}return d}function v(e,r,a,o){let d=[];Array.isArray(e)?d=e:e&&(d=e.data);const l=[];if(d.length>0){let s=d[0];if(r)for(let n=0;n<r.length;n++)s=s.items&&s.items[0];Object.getOwnPropertyNames(s).forEach(n=>{n!==a&&l.push(Object.assign({id:g.tableKeyboardNavigationTools.generateNavigatableId(`${o.prevId++}`,o.idPrefix,"column"),declarationIndex:-1,parentIndex:-1,depth:0,colSpan:0,rowSpan:0,index:0,left:0,right:0,rightBorder:!1,children:[],ariaColumnIndex:0,isAccessible:!0},x.gridDefaultProps,{field:n}))})}return l}const w=(e,r)=>{let a=e[r.parentIndex];for(;a;){if(a.footerCell)return!0;a=e[a.parentIndex]}return!1},y=e=>e.filter(r=>w(e,r)?!1:!!r.footerCell||!(r.children&&r.children.length>0)),b=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,I=e=>(e.sort((r,a)=>r.declarationIndex-a.declarationIndex),e.map(r=>{const{declarationIndex:a,parentIndex:o,depth:d,colSpan:l,rowSpan:s,index:t,kFirst:n,children:i,...h}=r;return i.length?{children:I(i),...h}:h})),m=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),S=17895697,C=(e,r)=>{if(!(!e&&!r))return r?e?{...e,...r,select:{...e.select||{},...r.select||{}},hierarchy:{...e.hierarchy||{},...r.hierarchy||{}},group:{...e.group||{},...r.group||{}},edit:{...e.edit||{},...r.edit||{}}}:r:e};exports.autoGenerateColumns=v;exports.firefox=m;exports.firefoxMaxHeight=S;exports.flatData=u;exports.footerColumns=y;exports.getColumnWidth=b;exports.getNestedValue=f;exports.readColumns=p;exports.resolveCells=C;exports.sanitizeColumns=I;
package/utils/index.mjs CHANGED
@@ -6,99 +6,99 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import { gridDefaultProps as l } from "../GridColumn.mjs";
10
- import { tableKeyboardNavigationTools as x } from "@progress/kendo-react-data-tools";
11
- function c(e, r) {
9
+ import { gridDefaultProps as x } from "../GridColumn.mjs";
10
+ import { tableKeyboardNavigationTools as p } from "@progress/kendo-react-data-tools";
11
+ function l(e, r) {
12
12
  const a = (e || "").split(".");
13
- let i = r;
14
- return a.forEach((o) => {
15
- i = i ? i[o] : void 0;
16
- }), i;
13
+ let o = r;
14
+ return a.forEach((d) => {
15
+ o = o ? o[d] : void 0;
16
+ }), o;
17
17
  }
18
- function g(e, r, a, i, o, h, n = 0) {
19
- let d = n;
20
- for (let t = 0; t < r.length; t++) {
21
- if (!o || r[t].value === void 0 || r[t].items === void 0) {
18
+ function g(e, r, a, o, d, s, h = 0) {
19
+ let t = h;
20
+ for (let n = 0; n < r.length; n++) {
21
+ if (!d || r[n].value === void 0 || r[n].items === void 0) {
22
22
  e[e.length] = {
23
- dataIndex: i.index,
24
- dataItem: r[t],
23
+ dataIndex: o.index,
24
+ dataItem: r[n],
25
25
  rowType: "data",
26
- level: n,
27
- expanded: h === void 0 || c(h, r[t])
28
- }, i.index++;
26
+ level: h,
27
+ expanded: s === void 0 || l(s, r[n])
28
+ }, o.index++;
29
29
  continue;
30
30
  }
31
- d = Math.max(d, n + 1);
32
- const f = h === void 0 || c(h, r[t]) === void 0 || c(h, r[t]);
31
+ t = Math.max(t, h + 1);
32
+ const i = s === void 0 || l(s, r[n]) === void 0 || l(s, r[n]);
33
33
  e[e.length] = {
34
34
  dataIndex: -1,
35
- dataItem: r[t],
36
- level: n,
35
+ dataItem: r[n],
36
+ level: h,
37
37
  rowType: "groupHeader",
38
- expanded: f
39
- }, f && (d = Math.max(
40
- g(e, r[t].items, a, i, o, h, n + 1),
41
- d
42
- )), (a === "always" || f && a === "visible") && (e[e.length] = {
38
+ expanded: i
39
+ }, i && (t = Math.max(
40
+ g(e, r[n].items, a, o, d, s, h + 1),
41
+ t
42
+ )), (a === "always" || i && a === "visible") && (e[e.length] = {
43
43
  dataIndex: -1,
44
- dataItem: r[t],
44
+ dataItem: r[n],
45
45
  rowType: "groupFooter",
46
- level: n,
47
- expanded: f
46
+ level: h,
47
+ expanded: i
48
48
  });
49
49
  }
50
- return d;
50
+ return t;
51
51
  }
52
- function I(e, r, a, i = 0) {
53
- let o = [];
52
+ function I(e, r, a, o = 0) {
53
+ let d = [];
54
54
  if (!e)
55
55
  return [];
56
- e && e.length === void 0 && (e = [e]), e.forEach((n, d) => {
57
- n = n.props ? n.props : n;
58
- const t = r[d] || null, f = I(n.children, t && t.children || [], a, i + 1);
59
- o.push(
56
+ e && e.length === void 0 && (e = [e]), e.filter((t) => t && t.props ? !t.props.hidden : !t.hidden).forEach((t, n) => {
57
+ t = t.props ? t.props : t;
58
+ const i = r[n] || null, f = I(t.children, i && i.children || [], a, o + 1);
59
+ d.push(
60
60
  Object.assign(
61
- { depth: i },
62
- l,
61
+ { depth: o },
62
+ x,
63
63
  f.length ? { cell: () => null, filterCell: () => null } : {},
64
- t ? { width: t.width, orderIndex: t.orderIndex } : {},
65
- n,
64
+ i ? { width: i.width, orderIndex: i.orderIndex } : {},
65
+ t,
66
66
  {
67
- id: n.id ? n.id : x.generateNavigatableId(`${a.prevId++}`, a.idPrefix, "column"),
68
- declarationIndex: o.length,
67
+ id: t.id ? t.id : p.generateNavigatableId(`${a.prevId++}`, a.idPrefix, "column"),
68
+ declarationIndex: d.length,
69
69
  children: f,
70
70
  rowSpan: 0,
71
71
  colSpan: 0,
72
72
  isAccessible: !0,
73
- left: t && Math.floor(t.left),
74
- right: t && Math.floor(t.right)
73
+ left: i && Math.floor(i.left),
74
+ right: i && Math.floor(i.right)
75
75
  }
76
76
  )
77
77
  );
78
78
  });
79
- const h = (n, d) => n.orderIndex === d.orderIndex ? n.declarationIndex - d.declarationIndex : (n.orderIndex || 0) - (d.orderIndex || 0);
80
- if (o.sort(h), i === 0) {
81
- let n = [];
82
- const d = (t, f) => t.forEach((s) => {
83
- s.parentIndex = f, d(s.children, n.push(s) - 1);
79
+ const h = (t, n) => t.orderIndex === n.orderIndex ? t.declarationIndex - n.declarationIndex : (t.orderIndex || 0) - (n.orderIndex || 0);
80
+ if (d.sort(h), o === 0) {
81
+ let t = [];
82
+ const n = (i, f) => i.forEach((c) => {
83
+ c.parentIndex = f, n(c.children, t.push(c) - 1);
84
84
  });
85
- return d(o, -1), n;
85
+ return n(d, -1), t;
86
86
  }
87
- return o;
87
+ return d;
88
88
  }
89
- function y(e, r, a, i) {
90
- let o = [];
91
- Array.isArray(e) ? o = e : e && (o = e.data);
92
- const h = [];
93
- if (o.length > 0) {
94
- let n = o[0];
89
+ function b(e, r, a, o) {
90
+ let d = [];
91
+ Array.isArray(e) ? d = e : e && (d = e.data);
92
+ const s = [];
93
+ if (d.length > 0) {
94
+ let h = d[0];
95
95
  if (r)
96
- for (let t = 0; t < r.length; t++)
97
- n = n.items && n.items[0];
98
- Object.getOwnPropertyNames(n).forEach((t) => {
99
- t !== a && h.push(Object.assign(
96
+ for (let n = 0; n < r.length; n++)
97
+ h = h.items && h.items[0];
98
+ Object.getOwnPropertyNames(h).forEach((n) => {
99
+ n !== a && s.push(Object.assign(
100
100
  {
101
- id: x.generateNavigatableId(`${i.prevId++}`, i.idPrefix, "column"),
101
+ id: p.generateNavigatableId(`${o.prevId++}`, o.idPrefix, "column"),
102
102
  declarationIndex: -1,
103
103
  parentIndex: -1,
104
104
  depth: 0,
@@ -112,14 +112,14 @@ function y(e, r, a, i) {
112
112
  ariaColumnIndex: 0,
113
113
  isAccessible: !0
114
114
  },
115
- l,
116
- { field: t }
115
+ x,
116
+ { field: n }
117
117
  ));
118
118
  });
119
119
  }
120
- return h;
120
+ return s;
121
121
  }
122
- const p = (e, r) => {
122
+ const v = (e, r) => {
123
123
  let a = e[r.parentIndex];
124
124
  for (; a; ) {
125
125
  if (a.footerCell)
@@ -127,22 +127,22 @@ const p = (e, r) => {
127
127
  a = e[a.parentIndex];
128
128
  }
129
129
  return !1;
130
- }, b = (e) => e.filter((r) => p(e, r) ? !1 : !!r.footerCell || !(r.children && r.children.length > 0)), S = (e) => e.width !== void 0 ? Math.floor(parseFloat(e.width.toString())) + "px" : void 0, w = (e) => (e.sort((r, a) => r.declarationIndex - a.declarationIndex), e.map((r) => {
130
+ }, S = (e) => e.filter((r) => v(e, r) ? !1 : !!r.footerCell || !(r.children && r.children.length > 0)), m = (e) => e.width !== void 0 ? Math.floor(parseFloat(e.width.toString())) + "px" : void 0, w = (e) => (e.sort((r, a) => r.declarationIndex - a.declarationIndex), e.map((r) => {
131
131
  const {
132
132
  declarationIndex: a,
133
- parentIndex: i,
134
- depth: o,
135
- colSpan: h,
136
- rowSpan: n,
137
- index: d,
138
- kFirst: t,
139
- children: f,
140
- ...s
133
+ parentIndex: o,
134
+ depth: d,
135
+ colSpan: s,
136
+ rowSpan: h,
137
+ index: t,
138
+ kFirst: n,
139
+ children: i,
140
+ ...f
141
141
  } = r;
142
- return f.length ? {
143
- children: w(f),
144
- ...s
145
- } : s;
142
+ return i.length ? {
143
+ children: w(i),
144
+ ...f
145
+ } : f;
146
146
  })), F = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), M = 17895697, A = (e, r) => {
147
147
  if (!(!e && !r))
148
148
  return r ? e ? {
@@ -167,13 +167,13 @@ const p = (e, r) => {
167
167
  } : r : e;
168
168
  };
169
169
  export {
170
- y as autoGenerateColumns,
170
+ b as autoGenerateColumns,
171
171
  F as firefox,
172
172
  M as firefoxMaxHeight,
173
173
  g as flatData,
174
- b as footerColumns,
175
- S as getColumnWidth,
176
- c as getNestedValue,
174
+ S as footerColumns,
175
+ m as getColumnWidth,
176
+ l as getNestedValue,
177
177
  I as readColumns,
178
178
  A as resolveCells,
179
179
  w as sanitizeColumns