@progress/kendo-react-grid 8.2.1-develop.5 → 8.3.0-develop.10

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/rows/GridRow.mjs CHANGED
@@ -6,46 +6,38 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import * as r from "react";
10
- import { classNames as s } from "@progress/kendo-react-common";
11
- import { GRID_ROW_INDEX_ATTRIBUTE as p } from "../constants/index.mjs";
12
- class a extends r.Component {
13
- /**
14
- * @hidden
15
- */
16
- render() {
17
- const e = s(
18
- "k-table-row",
19
- {
20
- "k-table-group-row k-grouping-row": this.props.rowType === "groupHeader",
21
- "k-group-footer": this.props.rowType === "groupFooter",
22
- "k-master-row": this.props.rowType !== "groupHeader" && this.props.rowType !== "groupFooter",
23
- "k-table-alt-row k-alt": this.props.rowType !== "groupHeader" && this.props.rowType !== "groupFooter" && this.props.isAltRow,
24
- "k-selected": this.props.isSelected,
25
- "k-grid-edit-row": this.props.isInEdit
26
- }
27
- ), o = /* @__PURE__ */ r.createElement(
28
- "tr",
29
- {
30
- id: this.props.id,
31
- onClick: this.props.onClick,
32
- onDoubleClick: this.props.onDoubleClick,
33
- className: e,
34
- style: {
35
- height: this.props.rowHeight ? this.props.rowHeight + "px" : "",
36
- visibility: this.props.isHidden ? "hidden" : ""
37
- },
38
- role: "row",
39
- "aria-rowindex": this.props.ariaRowIndex,
40
- "absolute-row-index": this.props.absoluteRowIndex,
41
- key: this.props.absoluteRowIndex,
42
- [p]: this.props.rowType === "data" ? this.props.dataIndex : void 0
9
+ import * as c from "react";
10
+ import { useUnstyled as s, uGrid as u, classNames as w } from "@progress/kendo-react-common";
11
+ import { GRID_ROW_INDEX_ATTRIBUTE as R } from "../constants/index.mjs";
12
+ const x = (e) => {
13
+ const { rowType: i, isAltRow: o, isInEdit: n, isSelected: r } = e, t = s(), l = t && t.uGrid ? t.uGrid : u, a = w(l.tr({
14
+ selected: r,
15
+ isHeader: i === "groupHeader",
16
+ isFooter: i === "groupFooter",
17
+ isMaster: i !== "groupHeader" && i !== "groupFooter",
18
+ isAltRow: o,
19
+ isInEdit: n
20
+ })), d = /* @__PURE__ */ c.createElement(
21
+ "tr",
22
+ {
23
+ id: e.id,
24
+ onClick: e.onClick,
25
+ onDoubleClick: e.onDoubleClick,
26
+ className: a,
27
+ style: {
28
+ height: e.rowHeight ? e.rowHeight + "px" : "",
29
+ visibility: e.isHidden ? "hidden" : ""
43
30
  },
44
- this.props.children
45
- );
46
- return this.props.render ? this.props.render.call(void 0, o, this.props) : o;
47
- }
48
- }
31
+ role: "row",
32
+ "aria-rowindex": e.ariaRowIndex,
33
+ "absolute-row-index": e.absoluteRowIndex,
34
+ key: e.absoluteRowIndex,
35
+ [R]: e.rowType === "data" ? e.dataIndex : void 0
36
+ },
37
+ e.children
38
+ );
39
+ return e.render ? e.render.call(void 0, d, e) : d;
40
+ };
49
41
  export {
50
- a as GridRow
42
+ x as GridRow
51
43
  };
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 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;
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,t){const a=(e||"").split(".");let o=t;return a.forEach(d=>{o=o?o[d]:void 0}),o}function u(e,t,a,o,d,l,s=0){let r=s;for(let n=0;n<t.length;n++){if(!d||t[n].value===void 0||t[n].items===void 0){e[e.length]={dataIndex:o.index,dataItem:t[n],rowType:"data",level:s,expanded:l===void 0||f(l,t[n])},o.index++;continue}r=Math.max(r,s+1);const i=l===void 0||f(l,t[n])===void 0||f(l,t[n]);e[e.length]={dataIndex:-1,dataItem:t[n],level:s,rowType:"groupHeader",expanded:i},i&&(r=Math.max(u(e,t[n].items,a,o,d,l,s+1),r)),(a==="always"||i&&a==="visible")&&(e[e.length]={dataIndex:-1,dataItem:t[n],rowType:"groupFooter",level:s,expanded:i})}return r}function p(e,t,a,o=0){let d=[];if(!e)return[];e&&e.length===void 0&&(e=[e]),e.filter(r=>r&&r.props?!r.props.hidden:!r.hidden).forEach((r,n)=>{r=r.props?r.props:r;const i=t[n]||null,h=p(r.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}:{},r,{id:r.id?r.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=(r,n)=>r.orderIndex===n.orderIndex?r.declarationIndex-n.declarationIndex:(r.orderIndex||0)-(n.orderIndex||0);if(d.sort(s),o===0){let r=[];const n=(i,h)=>i.forEach(c=>{c.parentIndex=h,n(c.children,r.push(c)-1)});return n(d,-1),r}return d}function v(e,t,a,o){let d=[];Array.isArray(e)?d=e:e&&(d=e.data);const l=[];if(d.length>0){let s=d[0];if(t)for(let n=0;n<t.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,t)=>{let a=e[t.parentIndex];for(;a;){if(a.footerCell)return!0;a=e[a.parentIndex]}return!1},y=e=>e.filter(t=>w(e,t)?!1:!!t.footerCell||!(t.children&&t.children.length>0)),b=e=>e.width!==void 0?Math.floor(parseFloat(e.width.toString()))+"px":void 0,S=(e,t)=>t&&t.filter(a=>a.field===e).length>0,I=e=>(e.sort((t,a)=>t.declarationIndex-a.declarationIndex),e.map(t=>{const{declarationIndex:a,parentIndex:o,depth:d,colSpan:l,rowSpan:s,index:r,kFirst:n,children:i,...h}=t;return i.length?{children:I(i),...h}:h})),m=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),C=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=v;exports.firefox=m;exports.firefoxMaxHeight=C;exports.flatData=u;exports.footerColumns=y;exports.getColumnWidth=b;exports.getNestedValue=f;exports.isSorted=S;exports.readColumns=p;exports.resolveCells=M;exports.sanitizeColumns=I;
package/utils/index.mjs CHANGED
@@ -7,15 +7,15 @@
7
7
  */
8
8
  "use client";
9
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
- const a = (e || "").split(".");
10
+ import { tableKeyboardNavigationTools as g } from "@progress/kendo-react-data-tools";
11
+ function c(e, r) {
12
+ const i = (e || "").split(".");
13
13
  let o = r;
14
- return a.forEach((d) => {
14
+ return i.forEach((d) => {
15
15
  o = o ? o[d] : void 0;
16
16
  }), o;
17
17
  }
18
- function g(e, r, a, o, d, s, h = 0) {
18
+ function p(e, r, i, o, d, s, h = 0) {
19
19
  let t = h;
20
20
  for (let n = 0; n < r.length; n++) {
21
21
  if (!d || r[n].value === void 0 || r[n].items === void 0) {
@@ -24,54 +24,54 @@ function g(e, r, a, o, d, s, h = 0) {
24
24
  dataItem: r[n],
25
25
  rowType: "data",
26
26
  level: h,
27
- expanded: s === void 0 || l(s, r[n])
27
+ expanded: s === void 0 || c(s, r[n])
28
28
  }, o.index++;
29
29
  continue;
30
30
  }
31
31
  t = Math.max(t, h + 1);
32
- const i = s === void 0 || l(s, r[n]) === void 0 || l(s, r[n]);
32
+ const a = s === void 0 || c(s, r[n]) === void 0 || c(s, r[n]);
33
33
  e[e.length] = {
34
34
  dataIndex: -1,
35
35
  dataItem: r[n],
36
36
  level: h,
37
37
  rowType: "groupHeader",
38
- expanded: i
39
- }, i && (t = Math.max(
40
- g(e, r[n].items, a, o, d, s, h + 1),
38
+ expanded: a
39
+ }, a && (t = Math.max(
40
+ p(e, r[n].items, i, o, d, s, h + 1),
41
41
  t
42
- )), (a === "always" || i && a === "visible") && (e[e.length] = {
42
+ )), (i === "always" || a && i === "visible") && (e[e.length] = {
43
43
  dataIndex: -1,
44
44
  dataItem: r[n],
45
45
  rowType: "groupFooter",
46
46
  level: h,
47
- expanded: i
47
+ expanded: a
48
48
  });
49
49
  }
50
50
  return t;
51
51
  }
52
- function I(e, r, a, o = 0) {
52
+ function I(e, r, i, o = 0) {
53
53
  let d = [];
54
54
  if (!e)
55
55
  return [];
56
56
  e && e.length === void 0 && (e = [e]), e.filter((t) => t && t.props ? !t.props.hidden : !t.hidden).forEach((t, n) => {
57
57
  t = t.props ? t.props : t;
58
- const i = r[n] || null, f = I(t.children, i && i.children || [], a, o + 1);
58
+ const a = r[n] || null, f = I(t.children, a && a.children || [], i, o + 1);
59
59
  d.push(
60
60
  Object.assign(
61
61
  { depth: o },
62
62
  x,
63
63
  f.length ? { cell: () => null, filterCell: () => null } : {},
64
- i ? { width: i.width, orderIndex: i.orderIndex } : {},
64
+ a ? { width: a.width, orderIndex: a.orderIndex } : {},
65
65
  t,
66
66
  {
67
- id: t.id ? t.id : p.generateNavigatableId(`${a.prevId++}`, a.idPrefix, "column"),
67
+ id: t.id ? t.id : g.generateNavigatableId(`${i.prevId++}`, i.idPrefix, "column"),
68
68
  declarationIndex: d.length,
69
69
  children: f,
70
70
  rowSpan: 0,
71
71
  colSpan: 0,
72
72
  isAccessible: !0,
73
- left: i && Math.floor(i.left),
74
- right: i && Math.floor(i.right)
73
+ left: a && Math.floor(a.left),
74
+ right: a && Math.floor(a.right)
75
75
  }
76
76
  )
77
77
  );
@@ -79,14 +79,14 @@ function I(e, r, a, o = 0) {
79
79
  const h = (t, n) => t.orderIndex === n.orderIndex ? t.declarationIndex - n.declarationIndex : (t.orderIndex || 0) - (n.orderIndex || 0);
80
80
  if (d.sort(h), o === 0) {
81
81
  let t = [];
82
- const n = (i, f) => i.forEach((c) => {
83
- c.parentIndex = f, n(c.children, t.push(c) - 1);
82
+ const n = (a, f) => a.forEach((l) => {
83
+ l.parentIndex = f, n(l.children, t.push(l) - 1);
84
84
  });
85
85
  return n(d, -1), t;
86
86
  }
87
87
  return d;
88
88
  }
89
- function b(e, r, a, o) {
89
+ function b(e, r, i, o) {
90
90
  let d = [];
91
91
  Array.isArray(e) ? d = e : e && (d = e.data);
92
92
  const s = [];
@@ -96,9 +96,9 @@ function b(e, r, a, o) {
96
96
  for (let n = 0; n < r.length; n++)
97
97
  h = h.items && h.items[0];
98
98
  Object.getOwnPropertyNames(h).forEach((n) => {
99
- n !== a && s.push(Object.assign(
99
+ n !== i && s.push(Object.assign(
100
100
  {
101
- id: p.generateNavigatableId(`${o.prevId++}`, o.idPrefix, "column"),
101
+ id: g.generateNavigatableId(`${o.prevId++}`, o.idPrefix, "column"),
102
102
  declarationIndex: -1,
103
103
  parentIndex: -1,
104
104
  depth: 0,
@@ -120,30 +120,30 @@ function b(e, r, a, o) {
120
120
  return s;
121
121
  }
122
122
  const v = (e, r) => {
123
- let a = e[r.parentIndex];
124
- for (; a; ) {
125
- if (a.footerCell)
123
+ let i = e[r.parentIndex];
124
+ for (; i; ) {
125
+ if (i.footerCell)
126
126
  return !0;
127
- a = e[a.parentIndex];
127
+ i = e[i.parentIndex];
128
128
  }
129
129
  return !1;
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) => {
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, F = (e, r) => r && r.filter((i) => i.field === e).length > 0, w = (e) => (e.sort((r, i) => r.declarationIndex - i.declarationIndex), e.map((r) => {
131
131
  const {
132
- declarationIndex: a,
132
+ declarationIndex: i,
133
133
  parentIndex: o,
134
134
  depth: d,
135
135
  colSpan: s,
136
136
  rowSpan: h,
137
137
  index: t,
138
138
  kFirst: n,
139
- children: i,
139
+ children: a,
140
140
  ...f
141
141
  } = r;
142
- return i.length ? {
143
- children: w(i),
142
+ return a.length ? {
143
+ children: w(a),
144
144
  ...f
145
145
  } : f;
146
- })), F = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), M = 17895697, A = (e, r) => {
146
+ })), M = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), A = 17895697, N = (e, r) => {
147
147
  if (!(!e && !r))
148
148
  return r ? e ? {
149
149
  ...e,
@@ -168,13 +168,14 @@ const v = (e, r) => {
168
168
  };
169
169
  export {
170
170
  b as autoGenerateColumns,
171
- F as firefox,
172
- M as firefoxMaxHeight,
173
- g as flatData,
171
+ M as firefox,
172
+ A as firefoxMaxHeight,
173
+ p as flatData,
174
174
  S as footerColumns,
175
175
  m as getColumnWidth,
176
- l as getNestedValue,
176
+ c as getNestedValue,
177
+ F as isSorted,
177
178
  I as readColumns,
178
- A as resolveCells,
179
+ N as resolveCells,
179
180
  w as sanitizeColumns
180
181
  };