@progress/kendo-react-grid 15.2.0-develop.7 → 15.2.0-develop.8

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.
Files changed (55) hide show
  1. package/GridClientWrapper.d.ts +1 -0
  2. package/GridClientWrapper.js +1 -1
  3. package/GridClientWrapper.mjs +478 -450
  4. package/GridColumn.d.ts +18 -1
  5. package/GridComponent.js +1 -1
  6. package/GridComponent.mjs +509 -433
  7. package/cells/groupcell/GridGroupCell.js +1 -1
  8. package/cells/groupcell/GridGroupCell.mjs +60 -10
  9. package/cells/groupcell/GridGroupCellServer.js +1 -1
  10. package/cells/groupcell/GridGroupCellServer.mjs +31 -18
  11. package/cells/groupcell/utils.d.ts +19 -4
  12. package/cells/groupcell/utils.js +1 -1
  13. package/cells/groupcell/utils.mjs +255 -33
  14. package/cells/selectioncell/GridSelectionCellInput.d.ts +1 -0
  15. package/cells/selectioncell/GridSelectionCellInput.js +1 -1
  16. package/cells/selectioncell/GridSelectionCellInput.mjs +19 -14
  17. package/components/StickyGroupTable.d.ts +2 -0
  18. package/components/StickyGroupTable.js +1 -1
  19. package/components/StickyGroupTable.mjs +29 -27
  20. package/dist/cdn/js/kendo-react-grid.js +1 -1
  21. package/drag/GroupingIndicator.d.ts +1 -0
  22. package/drag/GroupingIndicator.js +1 -1
  23. package/drag/GroupingIndicator.mjs +33 -30
  24. package/getRowContents.d.ts +5 -0
  25. package/getRowContents.js +1 -1
  26. package/getRowContents.mjs +77 -67
  27. package/header/GridHeaderCell.js +1 -1
  28. package/header/GridHeaderCell.mjs +17 -8
  29. package/header/GroupPanel.d.ts +3 -0
  30. package/header/GroupPanel.js +1 -1
  31. package/header/GroupPanel.mjs +35 -33
  32. package/header/HeaderRow.js +1 -1
  33. package/header/HeaderRow.mjs +48 -47
  34. package/index.d.mts +4 -2
  35. package/index.d.ts +4 -2
  36. package/interfaces/GridCellProps.d.ts +21 -0
  37. package/interfaces/GridCellsSettings.d.ts +60 -0
  38. package/interfaces/GridGroupColumnSettings.d.ts +170 -0
  39. package/interfaces/GridGroupableSettings.d.ts +66 -0
  40. package/interfaces/GridHeaderCellProps.d.ts +4 -0
  41. package/messages/index.d.ts +5 -0
  42. package/messages/index.js +2 -2
  43. package/messages/index.mjs +149 -147
  44. package/package-metadata.js +1 -1
  45. package/package-metadata.mjs +2 -2
  46. package/package.json +17 -17
  47. package/rows/GridRowRenderer.d.ts +2 -0
  48. package/rows/GridRowRenderer.js +1 -1
  49. package/rows/GridRowRenderer.mjs +21 -19
  50. package/stacked/StackedModeRow.d.ts +2 -0
  51. package/stacked/StackedModeRow.js +1 -1
  52. package/stacked/StackedModeRow.mjs +97 -85
  53. package/utils/index.d.ts +7 -1
  54. package/utils/index.js +1 -1
  55. package/utils/index.mjs +67 -62
@@ -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 B=require("react"),L=require("../cells/groupcell/GridGroupCellToggle.js"),V=require("../rows/GridRow.js"),z=require("./GridStackedRow.js");function H(e){const c=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const u=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(c,s,u.get?u:{enumerable:!0,get:()=>e[s]})}}return c.default=e,Object.freeze(c)}const t=H(B),U=({item:e,rowId:c,dataIndex:s,idPrefix:u,ariaRowIndex:f,absoluteRowIndex:y,isAltRow:k,isHidden:h,isRowReorderable:j,rowHeight:O,rows:R,leafColumns:p,groupLevelCount:b,stackedLayoutSettings:w,cells:F,editMode:x,isSelected:S,isHighlighted:A,isInEdit:v,preparedCells:D,showDetailToggle:M,isDetailExpanded:_,detailExpandField:q,isPinned:I})=>{var C,G,$;if(e.rowType==="data")return t.createElement(z.GridStackedRow,{key:c,dataItem:e.dataItem,columns:p,stackedLayoutSettings:w,isAltRow:k,isSelected:S,isInEdit:v,cells:F,dataIndex:s,idPrefix:u,ariaRowIndex:f,absoluteRowIndex:y,groupLevel:b,preparedCells:D,editMode:x,showDetailToggle:M,isDetailExpanded:_,detailExpandField:q,isPinned:I});const P=b+1,E=e.level||0,T=Math.max(1,P-E),N=Array.from({length:E},(d,r)=>t.createElement("td",{key:`group-cell-${c}-${r}`,className:"k-table-group-td k-group-cell k-table-td"}));let m;if(e.rowType==="groupHeader"){const d=(C=e.dataItem)==null?void 0:C.field,r=(G=e.dataItem)==null?void 0:G.value,g=d!==void 0?(()=>{const l=String(d),n=p.find(o=>o.field===l&&o.isAccessible!==!1),i=n==null?void 0:n.title;return typeof i=="string"&&i.length?i:l})():void 0;let a="";if(d!==void 0){let l;r instanceof Date?l=r.toString():l=String(r),a=`${g}: ${l}`}else r instanceof Date?a=r.toString():r!==void 0&&(a=String(r));m=t.createElement(t.Fragment,null,N,t.createElement("td",{className:"k-table-td",colSpan:T,role:"gridcell","aria-expanded":e.expanded},t.createElement("p",{className:"k-reset"},t.createElement(L.GridGroupCellToggle,{id:"",dataItem:e.dataItem,dataIndex:e.dataIndex,field:"value",expanded:e.expanded,group:e.group,columnPosition:{},ariaColumnIndex:1,isSelected:!1}),t.createElement("span",{className:"k-value"},a))))}else{const d=p.filter(a=>{const l=!!a._type,n=a.isAccessible===!1;return!a.hidden&&!l&&!n&&(a.columnType==="data"||a.columnType===void 0)}),r=($=e.dataItem)==null?void 0:$.aggregates,g=d.map(a=>{const l=a.field;if(!l||!r)return null;const n=r[l];if(!n||typeof n!="object")return null;const i=Object.keys(n).filter(o=>n[o]!==void 0&&n[o]!==null).map(o=>`${o.length?`${o.charAt(0).toUpperCase()}${o.slice(1)}`:o}: ${String(n[o])}`);return i.length===0?null:t.createElement("div",{key:`agg-${c}-${l}`,className:"k-grid-template-column"},t.createElement("p",{className:"k-grid-template-column-header"},a.title||l),t.createElement("p",{className:"k-reset"},i.join(", ")))}).filter(Boolean);if(e.rowType==="groupFooter"&&g.length===0)return t.createElement(t.Fragment,{key:c});m=t.createElement(t.Fragment,null,N,t.createElement("td",{className:"k-table-td",colSpan:T},t.createElement("div",{className:"k-grid-column-template"},g)))}return t.createElement(V.GridRow,{key:c,dataItem:e.dataItem,isAltRow:k,isInEdit:v,rowType:e.rowType,isRowReorderable:j,isHidden:h,onClick:null,onDoubleClick:null,rowHeight:O,ariaRowIndex:f,absoluteRowIndex:y,dataIndex:s,isSelected:S,isHighlighted:A,rows:R},m)};exports.StackedModeRow=U;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const z=require("react"),U=require("../cells/groupcell/GridGroupCellToggle.js"),J=require("../rows/GridRow.js"),K=require("./GridStackedRow.js");function Q(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const s in e)if(s!=="default"){const u=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(o,s,u.get?u:{enumerable:!0,get:()=>e[s]})}}return o.default=e,Object.freeze(o)}const t=Q(z),W=({item:e,rowId:o,dataIndex:s,idPrefix:u,ariaRowIndex:b,absoluteRowIndex:v,isAltRow:S,isHidden:w,isRowReorderable:O,rowHeight:R,rows:x,leafColumns:m,groupLevelCount:E,groupingMode:F,stackedLayoutSettings:A,cells:D,editMode:M,isSelected:T,isHighlighted:_,isInEdit:N,preparedCells:q,showDetailToggle:I,isDetailExpanded:P,detailExpandField:B,isPinned:H})=>{var $,h,j;if(e.rowType==="data")return t.createElement(K.GridStackedRow,{key:o,dataItem:e.dataItem,columns:m,stackedLayoutSettings:A,isAltRow:S,isSelected:T,isInEdit:N,cells:D,dataIndex:s,idPrefix:u,ariaRowIndex:b,absoluteRowIndex:v,groupLevel:E,preparedCells:q,editMode:M,showDetailToggle:I,isDetailExpanded:P,detailExpandField:B,isPinned:H});const f=F==="compact",L=E+1,g=e.level||0,C=Math.max(1,L-g),G=f?[]:Array.from({length:g},(i,r)=>t.createElement("td",{key:`group-cell-${o}-${r}`,className:"k-table-group-td k-group-cell k-table-td"})),V=f&&g>0?{"--kendo-grid-grouping-level":g}:void 0;let k;if(e.rowType==="groupHeader"){const i=($=e.dataItem)==null?void 0:$.field,r=(h=e.dataItem)==null?void 0:h.value,p=i!==void 0?(()=>{const a=String(i),d=m.find(y=>y.field===a&&y.isAccessible!==!1),n=d==null?void 0:d.title;return typeof n=="string"&&n.length?n:a})():void 0;let l="";if(i!==void 0){let a;r instanceof Date?a=r.toString():a=String(r),l=`${p}: ${a}`}else r instanceof Date?l=r.toString():r!==void 0&&(l=String(r));const c=t.createElement(U.GridGroupCellToggle,{id:"",dataItem:e.dataItem,dataIndex:e.dataIndex,field:"value",expanded:e.expanded,group:e.group,columnPosition:{},ariaColumnIndex:1,isSelected:!1});k=t.createElement(t.Fragment,null,G,t.createElement("td",{className:"k-table-td",colSpan:C,role:"gridcell","aria-expanded":e.expanded,style:V},f?t.createElement("div",{className:"k-grouping-row-content"},c,t.createElement("span",{className:"k-grouping-row-text"},l)):t.createElement("p",{className:"k-reset"},c,t.createElement("span",{className:"k-value"},l))))}else{const i=m.filter(l=>{const c=!!l._type,a=l.isAccessible===!1;return!l.hidden&&!c&&!a&&(l.columnType==="data"||l.columnType===void 0)}),r=(j=e.dataItem)==null?void 0:j.aggregates,p=i.map(l=>{const c=l.field;if(!c||!r)return null;const a=r[c];if(!a||typeof a!="object")return null;const d=Object.keys(a).filter(n=>a[n]!==void 0&&a[n]!==null).map(n=>`${n.length?`${n.charAt(0).toUpperCase()}${n.slice(1)}`:n}: ${String(a[n])}`);return d.length===0?null:t.createElement("div",{key:`agg-${o}-${c}`,className:"k-grid-template-column"},t.createElement("p",{className:"k-grid-template-column-header"},l.title||c),t.createElement("p",{className:"k-reset"},d.join(", ")))}).filter(Boolean);if(e.rowType==="groupFooter"&&p.length===0)return t.createElement(t.Fragment,{key:o});k=t.createElement(t.Fragment,null,G,t.createElement("td",{className:"k-table-td",colSpan:C},t.createElement("div",{className:"k-grid-column-template"},p)))}return t.createElement(J.GridRow,{key:o,dataItem:e.dataItem,isAltRow:S,isInEdit:N,rowType:e.rowType,isRowReorderable:O,isHidden:w,onClick:null,onDoubleClick:null,rowHeight:R,ariaRowIndex:b,absoluteRowIndex:v,dataIndex:s,isSelected:T,isHighlighted:_,rows:x},k)};exports.StackedModeRow=W;
@@ -6,75 +6,76 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as e from "react";
9
- import { GridGroupCellToggle as H } from "../cells/groupcell/GridGroupCellToggle.mjs";
10
- import { GridRow as O } from "../rows/GridRow.mjs";
11
- import { GridStackedRow as P } from "./GridStackedRow.mjs";
12
- const K = ({
9
+ import { GridGroupCellToggle as q } from "../cells/groupcell/GridGroupCellToggle.mjs";
10
+ import { GridRow as z } from "../rows/GridRow.mjs";
11
+ import { GridStackedRow as J } from "./GridStackedRow.mjs";
12
+ const X = ({
13
13
  item: t,
14
- rowId: d,
15
- dataIndex: m,
16
- idPrefix: h,
17
- ariaRowIndex: u,
18
- absoluteRowIndex: f,
19
- isAltRow: k,
20
- isHidden: x,
21
- isRowReorderable: F,
22
- rowHeight: G,
23
- rows: A,
14
+ rowId: i,
15
+ dataIndex: k,
16
+ idPrefix: G,
17
+ ariaRowIndex: y,
18
+ absoluteRowIndex: v,
19
+ isAltRow: E,
20
+ isHidden: F,
21
+ isRowReorderable: A,
22
+ rowHeight: w,
23
+ rows: I,
24
24
  leafColumns: p,
25
- groupLevelCount: y,
26
- stackedLayoutSettings: I,
27
- cells: j,
28
- editMode: D,
29
- isSelected: v,
30
- isHighlighted: R,
31
- isInEdit: E,
32
- preparedCells: w,
33
- showDetailToggle: B,
34
- isDetailExpanded: L,
35
- detailExpandField: M,
36
- isPinned: V
25
+ groupLevelCount: S,
26
+ groupingMode: j,
27
+ stackedLayoutSettings: D,
28
+ cells: R,
29
+ editMode: B,
30
+ isSelected: b,
31
+ isHighlighted: H,
32
+ isInEdit: N,
33
+ preparedCells: L,
34
+ showDetailToggle: M,
35
+ isDetailExpanded: V,
36
+ detailExpandField: _,
37
+ isPinned: O
37
38
  }) => {
38
- var T, $, C;
39
+ var $, h, x;
39
40
  if (t.rowType === "data")
40
41
  return /* @__PURE__ */ e.createElement(
41
- P,
42
+ J,
42
43
  {
43
- key: d,
44
+ key: i,
44
45
  dataItem: t.dataItem,
45
46
  columns: p,
46
- stackedLayoutSettings: I,
47
- isAltRow: k,
48
- isSelected: v,
49
- isInEdit: E,
50
- cells: j,
51
- dataIndex: m,
52
- idPrefix: h,
53
- ariaRowIndex: u,
54
- absoluteRowIndex: f,
55
- groupLevel: y,
56
- preparedCells: w,
57
- editMode: D,
58
- showDetailToggle: B,
59
- isDetailExpanded: L,
60
- detailExpandField: M,
61
- isPinned: V
47
+ stackedLayoutSettings: D,
48
+ isAltRow: E,
49
+ isSelected: b,
50
+ isInEdit: N,
51
+ cells: R,
52
+ dataIndex: k,
53
+ idPrefix: G,
54
+ ariaRowIndex: y,
55
+ absoluteRowIndex: v,
56
+ groupLevel: S,
57
+ preparedCells: L,
58
+ editMode: B,
59
+ showDetailToggle: M,
60
+ isDetailExpanded: V,
61
+ detailExpandField: _,
62
+ isPinned: O
62
63
  }
63
64
  );
64
- const _ = y + 1, S = t.level || 0, b = Math.max(1, _ - S), N = Array.from({ length: S }, (s, r) => /* @__PURE__ */ e.createElement("td", { key: `group-cell-${d}-${r}`, className: "k-table-group-td k-group-cell k-table-td" }));
65
- let g;
65
+ const m = j === "compact", P = S + 1, d = t.level || 0, T = Math.max(1, P - d), C = m ? [] : Array.from({ length: d }, (s, r) => /* @__PURE__ */ e.createElement("td", { key: `group-cell-${i}-${r}`, className: "k-table-group-td k-group-cell k-table-td" })), U = m && d > 0 ? { "--kendo-grid-grouping-level": d } : void 0;
66
+ let u;
66
67
  if (t.rowType === "groupHeader") {
67
- const s = (T = t.dataItem) == null ? void 0 : T.field, r = ($ = t.dataItem) == null ? void 0 : $.value, i = s !== void 0 ? (() => {
68
- const l = String(s), n = p.find((o) => o.field === l && o.isAccessible !== !1), c = n == null ? void 0 : n.title;
69
- return typeof c == "string" && c.length ? c : l;
68
+ const s = ($ = t.dataItem) == null ? void 0 : $.field, r = (h = t.dataItem) == null ? void 0 : h.value, g = s !== void 0 ? (() => {
69
+ const a = String(s), c = p.find((f) => f.field === a && f.isAccessible !== !1), n = c == null ? void 0 : c.title;
70
+ return typeof n == "string" && n.length ? n : a;
70
71
  })() : void 0;
71
- let a = "";
72
+ let l = "";
72
73
  if (s !== void 0) {
73
- let l;
74
- r instanceof Date ? l = r.toString() : l = String(r), a = `${i}: ${l}`;
75
- } else r instanceof Date ? a = r.toString() : r !== void 0 && (a = String(r));
76
- g = /* @__PURE__ */ e.createElement(e.Fragment, null, N, /* @__PURE__ */ e.createElement("td", { className: "k-table-td", colSpan: b, role: "gridcell", "aria-expanded": t.expanded }, /* @__PURE__ */ e.createElement("p", { className: "k-reset" }, /* @__PURE__ */ e.createElement(
77
- H,
74
+ let a;
75
+ r instanceof Date ? a = r.toString() : a = String(r), l = `${g}: ${a}`;
76
+ } else r instanceof Date ? l = r.toString() : r !== void 0 && (l = String(r));
77
+ const o = /* @__PURE__ */ e.createElement(
78
+ q,
78
79
  {
79
80
  id: "",
80
81
  dataItem: t.dataItem,
@@ -86,48 +87,59 @@ const K = ({
86
87
  ariaColumnIndex: 1,
87
88
  isSelected: !1
88
89
  }
89
- ), /* @__PURE__ */ e.createElement("span", { className: "k-value" }, a))));
90
+ );
91
+ u = /* @__PURE__ */ e.createElement(e.Fragment, null, C, /* @__PURE__ */ e.createElement(
92
+ "td",
93
+ {
94
+ className: "k-table-td",
95
+ colSpan: T,
96
+ role: "gridcell",
97
+ "aria-expanded": t.expanded,
98
+ style: U
99
+ },
100
+ m ? /* @__PURE__ */ e.createElement("div", { className: "k-grouping-row-content" }, o, /* @__PURE__ */ e.createElement("span", { className: "k-grouping-row-text" }, l)) : /* @__PURE__ */ e.createElement("p", { className: "k-reset" }, o, /* @__PURE__ */ e.createElement("span", { className: "k-value" }, l))
101
+ ));
90
102
  } else {
91
- const s = p.filter((a) => {
92
- const l = !!a._type, n = a.isAccessible === !1;
93
- return !a.hidden && !l && !n && (a.columnType === "data" || a.columnType === void 0);
94
- }), r = (C = t.dataItem) == null ? void 0 : C.aggregates, i = s.map((a) => {
95
- const l = a.field;
96
- if (!l || !r)
103
+ const s = p.filter((l) => {
104
+ const o = !!l._type, a = l.isAccessible === !1;
105
+ return !l.hidden && !o && !a && (l.columnType === "data" || l.columnType === void 0);
106
+ }), r = (x = t.dataItem) == null ? void 0 : x.aggregates, g = s.map((l) => {
107
+ const o = l.field;
108
+ if (!o || !r)
97
109
  return null;
98
- const n = r[l];
99
- if (!n || typeof n != "object")
110
+ const a = r[o];
111
+ if (!a || typeof a != "object")
100
112
  return null;
101
- const c = Object.keys(n).filter((o) => n[o] !== void 0 && n[o] !== null).map((o) => `${o.length ? `${o.charAt(0).toUpperCase()}${o.slice(1)}` : o}: ${String(n[o])}`);
102
- return c.length === 0 ? null : /* @__PURE__ */ e.createElement("div", { key: `agg-${d}-${l}`, className: "k-grid-template-column" }, /* @__PURE__ */ e.createElement("p", { className: "k-grid-template-column-header" }, a.title || l), /* @__PURE__ */ e.createElement("p", { className: "k-reset" }, c.join(", ")));
113
+ const c = Object.keys(a).filter((n) => a[n] !== void 0 && a[n] !== null).map((n) => `${n.length ? `${n.charAt(0).toUpperCase()}${n.slice(1)}` : n}: ${String(a[n])}`);
114
+ return c.length === 0 ? null : /* @__PURE__ */ e.createElement("div", { key: `agg-${i}-${o}`, className: "k-grid-template-column" }, /* @__PURE__ */ e.createElement("p", { className: "k-grid-template-column-header" }, l.title || o), /* @__PURE__ */ e.createElement("p", { className: "k-reset" }, c.join(", ")));
103
115
  }).filter(Boolean);
104
- if (t.rowType === "groupFooter" && i.length === 0)
105
- return /* @__PURE__ */ e.createElement(e.Fragment, { key: d });
106
- g = /* @__PURE__ */ e.createElement(e.Fragment, null, N, /* @__PURE__ */ e.createElement("td", { className: "k-table-td", colSpan: b }, /* @__PURE__ */ e.createElement("div", { className: "k-grid-column-template" }, i)));
116
+ if (t.rowType === "groupFooter" && g.length === 0)
117
+ return /* @__PURE__ */ e.createElement(e.Fragment, { key: i });
118
+ u = /* @__PURE__ */ e.createElement(e.Fragment, null, C, /* @__PURE__ */ e.createElement("td", { className: "k-table-td", colSpan: T }, /* @__PURE__ */ e.createElement("div", { className: "k-grid-column-template" }, g)));
107
119
  }
108
120
  return /* @__PURE__ */ e.createElement(
109
- O,
121
+ z,
110
122
  {
111
- key: d,
123
+ key: i,
112
124
  dataItem: t.dataItem,
113
- isAltRow: k,
114
- isInEdit: E,
125
+ isAltRow: E,
126
+ isInEdit: N,
115
127
  rowType: t.rowType,
116
- isRowReorderable: F,
117
- isHidden: x,
128
+ isRowReorderable: A,
129
+ isHidden: F,
118
130
  onClick: null,
119
131
  onDoubleClick: null,
120
- rowHeight: G,
121
- ariaRowIndex: u,
122
- absoluteRowIndex: f,
123
- dataIndex: m,
124
- isSelected: v,
125
- isHighlighted: R,
126
- rows: A
132
+ rowHeight: w,
133
+ ariaRowIndex: y,
134
+ absoluteRowIndex: v,
135
+ dataIndex: k,
136
+ isSelected: b,
137
+ isHighlighted: H,
138
+ rows: I
127
139
  },
128
- g
140
+ u
129
141
  );
130
142
  };
131
143
  export {
132
- K as StackedModeRow
144
+ X as StackedModeRow
133
145
  };
package/utils/index.d.ts CHANGED
@@ -23,6 +23,10 @@ import * as React from 'react';
23
23
  * @hidden
24
24
  */
25
25
  export declare function getNestedValue(fieldName: string | undefined, dataItem: any): any;
26
+ /**
27
+ * @hidden
28
+ */
29
+ export declare const flattenGroupItems: (item: any) => any[];
26
30
  /**
27
31
  * @hidden
28
32
  */
@@ -177,7 +181,9 @@ export declare const getClientCellProps: (props: GridCellProps) => GridCellProps
177
181
  /**
178
182
  * @hidden
179
183
  */
180
- export declare const getRowSpanOptions: (rowSpannable?: boolean | GridRowSpannableSettings) => Required<GridRowSpannableSettings>;
184
+ export declare const getRowSpanOptions: (rowSpannable?: boolean | GridRowSpannableSettings) => GridRowSpannableSettings & {
185
+ enabled: boolean;
186
+ };
181
187
  /** @hidden */
182
188
  export declare const getReactElement: (children: React.ReactElement<any> | undefined) => React.ReactElement<any>;
183
189
  /** @hidden */
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 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;
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const F=require("react"),S=require("../GridColumn.js"),y=require("@progress/kendo-data-query"),I=require("@progress/kendo-react-data-tools"),k=require("./_serverModule.js"),O=require("./_clientModule.js"),c=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 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=H(F);function j(e,t){const i=(e!=null?e:"").split(".");let a=t;return i.forEach(r=>{a=a?a[r]:void 0}),a}const b=e=>e.items?e.items.flatMap(b):[e];function v(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 M=I.findGroupExpand(f||[],u);M?C=M.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(v(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 p(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 q=(e,t)=>typeof e.colSpan=="function"?e.colSpan({dataItem:t,column:e}):e.colSpan||1;function B(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}),p(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=T.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},S.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 R=e=>Array.isArray(e)?e:e?e.data:[];function z(e,t,i,a){const r=R(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},S.gridDefaultProps,{field:o}))})}return d}const _=(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},L=e=>e.filter(t=>{var i;return _(e,t)?!1:!!((i=t.cells)!=null&&i.footerCell)||!(t.children&&t.children.length>0)}),$=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},V=(e,t)=>t&&t.filter(i=>i.field===e).length>0,D=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:D(s),...l}:l})),G=e=>{const{cells:t,rowSpannable:i,defaultCell:a,...r}=e;return e.children.length?{...r,children:e.children.map(G)}: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),P=e=>{const t=[],i=a=>a==null?void 0:a.forEach(r=>{t.push(r),i(r.children)});return i(e),t},K=typeof window!="undefined"&&/Firefox/.test(window.navigator.userAgent),Q=17895697,U=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},J=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},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 i;return typeof e=="object"?(i=e.enabled)!=null?i:!0:e!=null?e:!1},Z=()=>k.ServerFragment===O.ClientFragment,ee=e=>!!(e&&e.$$typeof===Symbol.for("react.client.reference")),te=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}),ne=e=>{var a,r;const t=typeof e=="object"?(a=e.enabled)!=null?a:!0:e!=null?e:!1;if(!t)return{enabled:t};const 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}},W=e=>{var t;return w.isValidElement(e)?e:(t=w.Children.toArray(e))==null?void 0:t[0]},ie=(e,t)=>{const i=W(e);return i?w.cloneElement(i,t):null},ae=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=z;exports.calcRowHeight=ae;exports.clientColumn=G;exports.cloneReactElement=ie;exports.firefox=K;exports.firefoxMaxHeight=Q;exports.flatData=v;exports.flattenGroupItems=b;exports.footerColumns=L;exports.getClientCellProps=te;exports.getColSpan=q;exports.getColumnState=A;exports.getColumnWidth=$;exports.getColumnsState=E;exports.getDataAsArray=R;exports.getDefaultBodyContextMenuItems=J;exports.getDefaultHeadContextMenuItems=U;exports.getFlatColumnsState=P;exports.getNestedValue=j;exports.getReactElement=W;exports.getRowSpanOptions=ne;exports.isClient=Z;exports.isClientReference=ee;exports.isRowReorderEnabled=Y;exports.isSorted=V;exports.mapColumns=B;exports.readColumns=N;exports.resolveCells=X;exports.sanitizeColumns=D;exports.syncLockedColumns=p;
package/utils/index.mjs CHANGED
@@ -6,21 +6,22 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import * as C from "react";
9
- import { gridDefaultProps as b } from "../GridColumn.mjs";
9
+ import { gridDefaultProps as p } from "../GridColumn.mjs";
10
10
  import { getter as S } from "@progress/kendo-data-query";
11
- import { findGroupExpand as R, tableKeyboardNavigationTools as p, updateLeft as W, updateRight as A } from "@progress/kendo-react-data-tools";
11
+ import { updateLeft as R, updateRight as W, findGroupExpand as A, tableKeyboardNavigationTools as b } from "@progress/kendo-react-data-tools";
12
12
  import { ServerFragment as F } from "./_serverModule.mjs";
13
- import { ClientFragment as D } from "./_clientModule.mjs";
13
+ import { ClientFragment as M } from "./_clientModule.mjs";
14
14
  import { GridContextMenuItemNames as f } from "../contextMenu/enums.mjs";
15
- import { canUseDOM as E } from "@progress/kendo-react-common";
16
- function K(e, t) {
15
+ import { canUseDOM as u } from "@progress/kendo-react-common";
16
+ function Q(e, t) {
17
17
  const n = (e != null ? e : "").split(".");
18
18
  let r = t;
19
19
  return n.forEach((a) => {
20
20
  r = r ? r[a] : void 0;
21
21
  }), r;
22
22
  }
23
- function M(e, t, n, r, a, d, s, i, l, o = 0, h) {
23
+ const D = (e) => e.items ? e.items.flatMap(D) : [e];
24
+ function E(e, t, n, r, a, d, s, i, l, o = 0, h) {
24
25
  var x;
25
26
  let g = o;
26
27
  for (let c = 0; c < t.length; c++) {
@@ -46,7 +47,7 @@ function M(e, t, n, r, a, d, s, i, l, o = 0, h) {
46
47
  }
47
48
  g = Math.max(g, o + 1);
48
49
  let w = !1;
49
- const v = R(s || [], I);
50
+ const v = A(s || [], I);
50
51
  v ? w = v.expanded !== !1 : w = i !== !1, e[e.length] = {
51
52
  dataIndex: -1,
52
53
  dataItem: t[c],
@@ -55,7 +56,7 @@ function M(e, t, n, r, a, d, s, i, l, o = 0, h) {
55
56
  rowType: "groupHeader",
56
57
  expanded: w
57
58
  }, w && (I.expanded = w, g = Math.max(
58
- M(
59
+ E(
59
60
  e,
60
61
  t[c].items,
61
62
  n,
@@ -88,8 +89,8 @@ function H(e, t) {
88
89
  }
89
90
  }
90
91
  }
91
- const Q = (e, t) => typeof e.colSpan == "function" ? e.colSpan({ dataItem: t, column: e }) : e.colSpan || 1;
92
- function X(e, t, n) {
92
+ const X = (e, t) => typeof e.colSpan == "function" ? e.colSpan({ dataItem: t, column: e }) : e.colSpan || 1;
93
+ function Y(e, t, n) {
93
94
  const r = [[]];
94
95
  let a = 0;
95
96
  for (let i = e.length - 1; i >= 0; i--)
@@ -105,7 +106,7 @@ function X(e, t, n) {
105
106
  r[i.depth].length === 0 && (s <= 1 ? s = 1 + (i.children.length > 0 ? 0 : a - i.depth) : (s--, o = !0)), i.rowSpan = 1 + (i.children.length > 0 ? 0 : a - i.depth), i.kFirst = o, i.index = r[i.depth].length, r[i.depth].push(l), i.ariaColumnIndex = d[i.depth] ? d[i.depth] + 1 : 1;
106
107
  for (let h = i.depth; h < i.depth + i.rowSpan; h++)
107
108
  d[h] = (d[h] || 0) + i.headerColSpan;
108
- }), H(e, t), W(r, e, n), A(r, e, n), r;
109
+ }), H(e, t), R(r, e, n), W(r, e, n), r;
109
110
  }
110
111
  function T(e, t, n, r = 0, a = !1) {
111
112
  const d = [];
@@ -113,11 +114,11 @@ function T(e, t, n, r = 0, a = !1) {
113
114
  return [];
114
115
  e && e.length === void 0 && (e = [e]), e.forEach((i, l) => {
115
116
  i = i.props ? i.props : i;
116
- const o = i.id ? i.id : p.generateNavigatableId(`${n.prevId++}`, n.idPrefix, "column"), h = E && i.media && window.matchMedia ? !window.matchMedia(i.media).matches : !1, g = a || h || i.hidden, x = t == null ? void 0 : t.find((I) => I.id === o), c = T(i.children, (x == null ? void 0 : x.children) || [], n, r + 1, g);
117
+ const o = i.id ? i.id : b.generateNavigatableId(`${n.prevId++}`, n.idPrefix, "column"), h = u && i.media && window.matchMedia ? !window.matchMedia(i.media).matches : !1, g = a || h || i.hidden, x = t == null ? void 0 : t.find((I) => I.id === o), c = T(i.children, (x == null ? void 0 : x.children) || [], n, r + 1, g);
117
118
  d.push(
118
119
  Object.assign(
119
120
  { depth: r },
120
- b,
121
+ p,
121
122
  c.length ? { cell: () => null, filterCell: () => null } : {},
122
123
  i,
123
124
  {
@@ -148,7 +149,7 @@ function T(e, t, n, r = 0, a = !1) {
148
149
  return d;
149
150
  }
150
151
  const k = (e) => Array.isArray(e) ? e : e ? e.data : [];
151
- function Y(e, t, n, r) {
152
+ function Z(e, t, n, r) {
152
153
  const a = k(e), d = [];
153
154
  if (a.length > 0) {
154
155
  let s = a[0];
@@ -159,7 +160,7 @@ function Y(e, t, n, r) {
159
160
  l !== n.column && d.push(
160
161
  Object.assign(
161
162
  {
162
- id: p.generateNavigatableId(`${r.prevId++}`, r.idPrefix, "column"),
163
+ id: b.generateNavigatableId(`${r.prevId++}`, r.idPrefix, "column"),
163
164
  declarationIndex: -1,
164
165
  parentIndex: -1,
165
166
  depth: 0,
@@ -175,7 +176,7 @@ function Y(e, t, n, r) {
175
176
  ariaColumnIndex: 0,
176
177
  isAccessible: !0
177
178
  },
178
- b,
179
+ p,
179
180
  { field: l }
180
181
  )
181
182
  );
@@ -183,7 +184,7 @@ function Y(e, t, n, r) {
183
184
  }
184
185
  return d;
185
186
  }
186
- const u = (e, t) => {
187
+ const m = (e, t) => {
187
188
  var r;
188
189
  let n = e[t.parentIndex];
189
190
  for (; n; ) {
@@ -192,25 +193,25 @@ const u = (e, t) => {
192
193
  n = e[n.parentIndex];
193
194
  }
194
195
  return !1;
195
- }, Z = (e) => e.filter((t) => {
196
+ }, _ = (e) => e.filter((t) => {
196
197
  var n;
197
- return u(e, t) ? !1 : !!((n = t.cells) != null && n.footerCell) || !(t.children && t.children.length > 0);
198
- }), _ = (e) => {
198
+ return m(e, t) ? !1 : !!((n = t.cells) != null && n.footerCell) || !(t.children && t.children.length > 0);
199
+ }), P = (e) => {
199
200
  let t = e.width;
200
201
  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;
201
- }, P = (e, t) => t && t.filter((n) => n.field === e).length > 0, j = (e) => (e.sort((t, n) => t.declarationIndex - n.declarationIndex), e.map((t) => {
202
+ }, G = (e, t) => t && t.filter((n) => n.field === e).length > 0, j = (e) => (e.sort((t, n) => t.declarationIndex - n.declarationIndex), e.map((t) => {
202
203
  const { declarationIndex: n, parentIndex: r, depth: a, headerColSpan: d, rowSpan: s, index: i, kFirst: l, children: o, ...h } = t;
203
204
  return o.length ? {
204
205
  children: j(o),
205
206
  ...h
206
207
  } : h;
207
- })), m = (e) => {
208
+ })), B = (e) => {
208
209
  const { cells: t, rowSpannable: n, defaultCell: r, ...a } = e;
209
210
  return e.children.length ? {
210
211
  ...a,
211
- children: e.children.map(m)
212
+ children: e.children.map(B)
212
213
  } : a;
213
- }, B = (e) => ({
214
+ }, O = (e) => ({
214
215
  id: e.id,
215
216
  field: e.field,
216
217
  title: e.title,
@@ -220,16 +221,16 @@ const u = (e, t) => {
220
221
  minWidth: e.minWidth,
221
222
  maxWidth: e.maxWidth,
222
223
  isAccessible: e.isAccessible,
223
- children: e.children ? O(e.children) : null
224
- }), O = (e) => e.map(B), G = (e) => {
224
+ children: e.children ? N(e.children) : null
225
+ }), N = (e) => e.map(O), ee = (e) => {
225
226
  const t = [], n = (r) => r == null ? void 0 : r.forEach((a) => {
226
227
  t.push(a), n(a.children);
227
228
  });
228
229
  return n(e), t;
229
- }, ee = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), te = 17895697, ie = (e) => {
230
+ }, te = typeof window != "undefined" && /Firefox/.test(window.navigator.userAgent), ie = 17895697, ne = (e) => {
230
231
  let t = [];
231
232
  return e.sortable && (t = t.concat([f.sortAsc, f.sortDesc])), e.pdf && (t.length && (t = t.concat([f.separator])), t = t.concat([f.exportPDF])), t;
232
- }, ne = (e) => {
233
+ }, re = (e) => {
233
234
  let t = [];
234
235
  return e.clipboard && (t = t.concat([
235
236
  f.copySelection,
@@ -240,7 +241,7 @@ const u = (e, t) => {
240
241
  f.edit,
241
242
  f.delete
242
243
  ])), e.selectable && (t.length && (t = t.concat([f.separator])), t = t.concat([f.select])), e.rowReorderable && (t.length && (t = t.concat([f.separator])), t = t.concat([f.reorderRow])), e.pdf && (t.length && (t = t.concat([f.separator])), t = t.concat([f.exportPDF])), e.pinnable && (t.length && (t = t.concat([f.separator])), t = t.concat([f.pinRow])), t;
243
- }, re = (e, t) => {
244
+ }, ae = (e, t) => {
244
245
  if (!(!e && !t))
245
246
  return t ? e ? {
246
247
  ...e,
@@ -262,10 +263,10 @@ const u = (e, t) => {
262
263
  ...t.edit || {}
263
264
  }
264
265
  } : t : e;
265
- }, ae = (e) => {
266
+ }, de = (e) => {
266
267
  var n;
267
268
  return typeof e == "object" ? (n = e.enabled) != null ? n : !0 : e != null ? e : !1;
268
- }, de = () => F === D, le = (e) => !!(e && e.$$typeof === Symbol.for("react.client.reference")), he = (e) => ({
269
+ }, le = () => F === M, he = (e) => !!(e && e.$$typeof === Symbol.for("react.client.reference")), oe = (e) => ({
269
270
  id: e.id,
270
271
  ariaColumnIndex: e.ariaColumnIndex,
271
272
  isSelected: e.isSelected,
@@ -291,17 +292,20 @@ const u = (e, t) => {
291
292
  rowDataIndex: e.rowDataIndex,
292
293
  columnPosition: e.columnPosition,
293
294
  group: e.group
294
- }), oe = (e) => {
295
+ }), fe = (e) => {
295
296
  var r, a;
296
- const t = typeof e == "object" ? (r = e.enabled) != null ? r : !0 : e != null ? e : !1, n = typeof e == "object" ? (a = e.valueGetter) != null ? a : ((d, s) => S(s)(d)) : (d, s) => S(s)(d);
297
+ const t = typeof e == "object" ? (r = e.enabled) != null ? r : !0 : e != null ? e : !1;
298
+ if (!t)
299
+ return { enabled: t };
300
+ const n = typeof e == "object" ? (a = e.valueGetter) != null ? a : ((d, s) => S(s)(d)) : (d, s) => S(s)(d);
297
301
  return { enabled: t, valueGetter: n };
298
- }, N = (e) => {
302
+ }, z = (e) => {
299
303
  var t;
300
304
  return C.isValidElement(e) ? e : (t = C.Children.toArray(e)) == null ? void 0 : t[0];
301
- }, fe = (e, t) => {
302
- const n = N(e);
305
+ }, se = (e, t) => {
306
+ const n = z(e);
303
307
  return n ? C.cloneElement(n, t) : null;
304
- }, se = (e) => {
308
+ }, ce = (e) => {
305
309
  let t = 0;
306
310
  if (e) {
307
311
  const n = e.insertRow(0), r = n.insertCell(0);
@@ -310,33 +314,34 @@ const u = (e, t) => {
310
314
  return t;
311
315
  };
312
316
  export {
313
- Y as autoGenerateColumns,
314
- se as calcRowHeight,
315
- m as clientColumn,
316
- fe as cloneReactElement,
317
- ee as firefox,
318
- te as firefoxMaxHeight,
319
- M as flatData,
320
- Z as footerColumns,
321
- he as getClientCellProps,
322
- Q as getColSpan,
323
- B as getColumnState,
324
- _ as getColumnWidth,
325
- O as getColumnsState,
317
+ Z as autoGenerateColumns,
318
+ ce as calcRowHeight,
319
+ B as clientColumn,
320
+ se as cloneReactElement,
321
+ te as firefox,
322
+ ie as firefoxMaxHeight,
323
+ E as flatData,
324
+ D as flattenGroupItems,
325
+ _ as footerColumns,
326
+ oe as getClientCellProps,
327
+ X as getColSpan,
328
+ O as getColumnState,
329
+ P as getColumnWidth,
330
+ N as getColumnsState,
326
331
  k as getDataAsArray,
327
- ne as getDefaultBodyContextMenuItems,
328
- ie as getDefaultHeadContextMenuItems,
329
- G as getFlatColumnsState,
330
- K as getNestedValue,
331
- N as getReactElement,
332
- oe as getRowSpanOptions,
333
- de as isClient,
334
- le as isClientReference,
335
- ae as isRowReorderEnabled,
336
- P as isSorted,
337
- X as mapColumns,
332
+ re as getDefaultBodyContextMenuItems,
333
+ ne as getDefaultHeadContextMenuItems,
334
+ ee as getFlatColumnsState,
335
+ Q as getNestedValue,
336
+ z as getReactElement,
337
+ fe as getRowSpanOptions,
338
+ le as isClient,
339
+ he as isClientReference,
340
+ de as isRowReorderEnabled,
341
+ G as isSorted,
342
+ Y as mapColumns,
338
343
  T as readColumns,
339
- re as resolveCells,
344
+ ae as resolveCells,
340
345
  j as sanitizeColumns,
341
346
  H as syncLockedColumns
342
347
  };