@progress/kendo-react-treelist 6.1.1 → 7.0.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.
Files changed (176) hide show
  1. package/LICENSE.md +1 -1
  2. package/ScrollMode.d.ts +5 -0
  3. package/{dist/es/TreeList.d.ts → TreeList.d.ts} +6 -2
  4. package/{dist/es/TreeListNoRecords.d.ts → TreeListNoRecords.d.ts} +4 -0
  5. package/TreeListToolbar.d.ts +15 -0
  6. package/cells/EditCells/TreeListBooleanEditor.d.ts +11 -0
  7. package/cells/EditCells/TreeListDateEditor.d.ts +11 -0
  8. package/{dist/es/cells → cells}/EditCells/TreeListNumericEditor.d.ts +4 -0
  9. package/cells/EditCells/TreeListTextEditor.d.ts +11 -0
  10. package/{dist/npm/cells → cells}/FilterCells/TreeListBooleanFilter.d.ts +4 -0
  11. package/{dist/npm/cells → cells}/FilterCells/TreeListDateFilter.d.ts +4 -0
  12. package/{dist/es/cells → cells}/FilterCells/TreeListNumericFilter.d.ts +4 -0
  13. package/{dist/es/cells → cells}/FilterCells/TreeListTextFilter.d.ts +4 -0
  14. package/{dist/npm/cells → cells}/FilterCells/utils.d.ts +4 -0
  15. package/cells/TreeListCell.d.ts +9 -0
  16. package/cells/TreeListSelectionCell.d.ts +11 -0
  17. package/{dist/es/constants → constants}/index.d.ts +4 -0
  18. package/dist/cdn/js/kendo-react-treelist.js +5 -1
  19. package/header/TreeListHeaderCell.d.ts +7 -0
  20. package/header/TreeListHeaderSelectionCell.d.ts +15 -0
  21. package/index.d.ts +38 -0
  22. package/index.js +5 -0
  23. package/index.mjs +1181 -0
  24. package/interfaces/DataItemWrapper.d.ts +14 -0
  25. package/{dist/npm/interfaces → interfaces}/TreeListCellProps.d.ts +4 -1
  26. package/{dist/es/interfaces → interfaces}/TreeListColumnProps.d.ts +4 -0
  27. package/interfaces/TreeListFilterCellProps.d.ts +10 -0
  28. package/interfaces/TreeListFilterOperator.d.ts +10 -0
  29. package/interfaces/TreeListHeaderCellProps.d.ts +10 -0
  30. package/interfaces/TreeListNoRecordsProps.d.ts +13 -0
  31. package/{dist/es/interfaces → interfaces}/TreeListProps.d.ts +4 -1
  32. package/{dist/es/interfaces → interfaces}/TreeListRowProps.d.ts +4 -1
  33. package/{dist/es/interfaces → interfaces}/TreeListSelectableSettings.d.ts +5 -1
  34. package/interfaces/TreeListSortSettings.d.ts +13 -0
  35. package/interfaces/TreeListToolbarProps.d.ts +13 -0
  36. package/{dist/es/interfaces → interfaces}/events.d.ts +4 -0
  37. package/{dist/npm/messages → messages}/index.d.ts +4 -0
  38. package/package-metadata.d.ts +9 -0
  39. package/package.json +36 -57
  40. package/{dist/es/rows → rows}/TreeListDraggableRow.d.ts +5 -1
  41. package/rows/TreeListRow.d.ts +10 -0
  42. package/{dist/npm/utils → utils}/index.d.ts +4 -0
  43. package/about.md +0 -3
  44. package/debug.log +0 -3
  45. package/dist/es/ScrollMode.d.ts +0 -1
  46. package/dist/es/ScrollMode.js +0 -1
  47. package/dist/es/TreeList.js +0 -632
  48. package/dist/es/TreeListNoRecords.js +0 -37
  49. package/dist/es/TreeListToolbar.d.ts +0 -11
  50. package/dist/es/TreeListToolbar.js +0 -33
  51. package/dist/es/cells/EditCells/TreeListBooleanEditor.d.ts +0 -8
  52. package/dist/es/cells/EditCells/TreeListBooleanEditor.js +0 -41
  53. package/dist/es/cells/EditCells/TreeListDateEditor.d.ts +0 -8
  54. package/dist/es/cells/EditCells/TreeListDateEditor.js +0 -40
  55. package/dist/es/cells/EditCells/TreeListNumericEditor.js +0 -41
  56. package/dist/es/cells/EditCells/TreeListTextEditor.d.ts +0 -8
  57. package/dist/es/cells/EditCells/TreeListTextEditor.js +0 -39
  58. package/dist/es/cells/FilterCells/TreeListBooleanFilter.d.ts +0 -10
  59. package/dist/es/cells/FilterCells/TreeListBooleanFilter.js +0 -30
  60. package/dist/es/cells/FilterCells/TreeListDateFilter.d.ts +0 -10
  61. package/dist/es/cells/FilterCells/TreeListDateFilter.js +0 -30
  62. package/dist/es/cells/FilterCells/TreeListNumericFilter.js +0 -30
  63. package/dist/es/cells/FilterCells/TreeListTextFilter.js +0 -30
  64. package/dist/es/cells/FilterCells/utils.d.ts +0 -38
  65. package/dist/es/cells/FilterCells/utils.js +0 -66
  66. package/dist/es/cells/TreeListCell.d.ts +0 -6
  67. package/dist/es/cells/TreeListCell.js +0 -61
  68. package/dist/es/cells/TreeListSelectionCell.d.ts +0 -8
  69. package/dist/es/cells/TreeListSelectionCell.js +0 -31
  70. package/dist/es/constants/index.js +0 -7
  71. package/dist/es/header/TreeListHeaderCell.d.ts +0 -3
  72. package/dist/es/header/TreeListHeaderCell.js +0 -14
  73. package/dist/es/header/TreeListHeaderSelectionCell.d.ts +0 -11
  74. package/dist/es/header/TreeListHeaderSelectionCell.js +0 -45
  75. package/dist/es/interfaces/DataItemWrapper.d.ts +0 -10
  76. package/dist/es/interfaces/DataItemWrapper.js +0 -1
  77. package/dist/es/interfaces/TreeListCellProps.d.ts +0 -42
  78. package/dist/es/interfaces/TreeListCellProps.js +0 -1
  79. package/dist/es/interfaces/TreeListColumnProps.js +0 -1
  80. package/dist/es/interfaces/TreeListFilterCellProps.d.ts +0 -6
  81. package/dist/es/interfaces/TreeListFilterCellProps.js +0 -1
  82. package/dist/es/interfaces/TreeListFilterOperator.d.ts +0 -6
  83. package/dist/es/interfaces/TreeListFilterOperator.js +0 -1
  84. package/dist/es/interfaces/TreeListHeaderCellProps.d.ts +0 -6
  85. package/dist/es/interfaces/TreeListHeaderCellProps.js +0 -1
  86. package/dist/es/interfaces/TreeListNoRecordsProps.d.ts +0 -10
  87. package/dist/es/interfaces/TreeListNoRecordsProps.js +0 -1
  88. package/dist/es/interfaces/TreeListProps.js +0 -1
  89. package/dist/es/interfaces/TreeListRowProps.js +0 -1
  90. package/dist/es/interfaces/TreeListSelectableSettings.js +0 -2
  91. package/dist/es/interfaces/TreeListSortSettings.d.ts +0 -9
  92. package/dist/es/interfaces/TreeListSortSettings.js +0 -1
  93. package/dist/es/interfaces/TreeListToolbarProps.d.ts +0 -10
  94. package/dist/es/interfaces/TreeListToolbarProps.js +0 -1
  95. package/dist/es/interfaces/events.js +0 -1
  96. package/dist/es/main.d.ts +0 -34
  97. package/dist/es/main.js +0 -23
  98. package/dist/es/messages/index.d.ts +0 -120
  99. package/dist/es/messages/index.js +0 -121
  100. package/dist/es/package-metadata.d.ts +0 -5
  101. package/dist/es/package-metadata.js +0 -11
  102. package/dist/es/rows/TreeListDraggableRow.js +0 -171
  103. package/dist/es/rows/TreeListRow.d.ts +0 -6
  104. package/dist/es/rows/TreeListRow.js +0 -31
  105. package/dist/es/utils/index.d.ts +0 -17
  106. package/dist/es/utils/index.js +0 -68
  107. package/dist/npm/ScrollMode.d.ts +0 -1
  108. package/dist/npm/ScrollMode.js +0 -2
  109. package/dist/npm/TreeList.d.ts +0 -133
  110. package/dist/npm/TreeList.js +0 -635
  111. package/dist/npm/TreeListNoRecords.d.ts +0 -12
  112. package/dist/npm/TreeListNoRecords.js +0 -40
  113. package/dist/npm/TreeListToolbar.d.ts +0 -11
  114. package/dist/npm/TreeListToolbar.js +0 -36
  115. package/dist/npm/cells/EditCells/TreeListBooleanEditor.d.ts +0 -8
  116. package/dist/npm/cells/EditCells/TreeListBooleanEditor.js +0 -45
  117. package/dist/npm/cells/EditCells/TreeListDateEditor.d.ts +0 -8
  118. package/dist/npm/cells/EditCells/TreeListDateEditor.js +0 -44
  119. package/dist/npm/cells/EditCells/TreeListNumericEditor.d.ts +0 -8
  120. package/dist/npm/cells/EditCells/TreeListNumericEditor.js +0 -45
  121. package/dist/npm/cells/EditCells/TreeListTextEditor.d.ts +0 -8
  122. package/dist/npm/cells/EditCells/TreeListTextEditor.js +0 -43
  123. package/dist/npm/cells/FilterCells/TreeListBooleanFilter.js +0 -34
  124. package/dist/npm/cells/FilterCells/TreeListDateFilter.js +0 -34
  125. package/dist/npm/cells/FilterCells/TreeListNumericFilter.d.ts +0 -10
  126. package/dist/npm/cells/FilterCells/TreeListNumericFilter.js +0 -34
  127. package/dist/npm/cells/FilterCells/TreeListTextFilter.d.ts +0 -10
  128. package/dist/npm/cells/FilterCells/TreeListTextFilter.js +0 -34
  129. package/dist/npm/cells/FilterCells/utils.js +0 -70
  130. package/dist/npm/cells/TreeListCell.d.ts +0 -6
  131. package/dist/npm/cells/TreeListCell.js +0 -65
  132. package/dist/npm/cells/TreeListSelectionCell.d.ts +0 -8
  133. package/dist/npm/cells/TreeListSelectionCell.js +0 -35
  134. package/dist/npm/constants/index.d.ts +0 -6
  135. package/dist/npm/constants/index.js +0 -10
  136. package/dist/npm/header/TreeListHeaderCell.d.ts +0 -3
  137. package/dist/npm/header/TreeListHeaderCell.js +0 -18
  138. package/dist/npm/header/TreeListHeaderSelectionCell.d.ts +0 -11
  139. package/dist/npm/header/TreeListHeaderSelectionCell.js +0 -48
  140. package/dist/npm/interfaces/DataItemWrapper.d.ts +0 -10
  141. package/dist/npm/interfaces/DataItemWrapper.js +0 -2
  142. package/dist/npm/interfaces/TreeListCellProps.js +0 -2
  143. package/dist/npm/interfaces/TreeListColumnProps.d.ts +0 -41
  144. package/dist/npm/interfaces/TreeListColumnProps.js +0 -2
  145. package/dist/npm/interfaces/TreeListFilterCellProps.d.ts +0 -6
  146. package/dist/npm/interfaces/TreeListFilterCellProps.js +0 -2
  147. package/dist/npm/interfaces/TreeListFilterOperator.d.ts +0 -6
  148. package/dist/npm/interfaces/TreeListFilterOperator.js +0 -2
  149. package/dist/npm/interfaces/TreeListHeaderCellProps.d.ts +0 -6
  150. package/dist/npm/interfaces/TreeListHeaderCellProps.js +0 -2
  151. package/dist/npm/interfaces/TreeListNoRecordsProps.d.ts +0 -10
  152. package/dist/npm/interfaces/TreeListNoRecordsProps.js +0 -2
  153. package/dist/npm/interfaces/TreeListProps.d.ts +0 -234
  154. package/dist/npm/interfaces/TreeListProps.js +0 -2
  155. package/dist/npm/interfaces/TreeListRowProps.d.ts +0 -93
  156. package/dist/npm/interfaces/TreeListRowProps.js +0 -2
  157. package/dist/npm/interfaces/TreeListSelectableSettings.d.ts +0 -18
  158. package/dist/npm/interfaces/TreeListSelectableSettings.js +0 -3
  159. package/dist/npm/interfaces/TreeListSortSettings.d.ts +0 -9
  160. package/dist/npm/interfaces/TreeListSortSettings.js +0 -2
  161. package/dist/npm/interfaces/TreeListToolbarProps.d.ts +0 -10
  162. package/dist/npm/interfaces/TreeListToolbarProps.js +0 -2
  163. package/dist/npm/interfaces/events.d.ts +0 -265
  164. package/dist/npm/interfaces/events.js +0 -2
  165. package/dist/npm/main.d.ts +0 -34
  166. package/dist/npm/main.js +0 -63
  167. package/dist/npm/messages/index.js +0 -124
  168. package/dist/npm/package-metadata.d.ts +0 -5
  169. package/dist/npm/package-metadata.js +0 -14
  170. package/dist/npm/rows/TreeListDraggableRow.d.ts +0 -32
  171. package/dist/npm/rows/TreeListDraggableRow.js +0 -174
  172. package/dist/npm/rows/TreeListRow.d.ts +0 -6
  173. package/dist/npm/rows/TreeListRow.js +0 -34
  174. package/dist/npm/utils/index.js +0 -74
  175. package/dist/systemjs/kendo-react-treelist.js +0 -1
  176. package/e2e-next/basic.tests.ts +0 -24
package/index.mjs ADDED
@@ -0,0 +1,1181 @@
1
+ /**-----------------------------------------------------------------------------------------
2
+ * Copyright © 2023 Progress Software Corporation. All rights reserved.
3
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
4
+ *-------------------------------------------------------------------------------------------*/
5
+ import * as l from "react";
6
+ import * as c from "prop-types";
7
+ import { getNestedValue as C, Keys as Fe, IconWrap as ne, classNames as I, guid as z, memoizeOne as Q, validatePackage as Ae, noop as Z, canUseDOM as j, getter as Me, Draggable as Pe } from "@progress/kendo-react-common";
8
+ import { getNestedValue as Yt, mapTree as Jt, mapTreeItem as Qt } from "@progress/kendo-react-common";
9
+ import { TABLE_ROW_INDEX_ATTRIBUTE as ze, TABLE_COL_INDEX_ATTRIBUTE as He, TABLE_PREVENT_SELECTION_ELEMENT as Be, useTableKeyboardNavigation as k, readColumns as Ke, mapColumns as _e, tableKeyboardNavigation as T, getSelectionOptions as ee, CommonDragLogic as qe, ColumnResize as Ve, tableKeyboardNavigationTools as te, Header as Ue, HeaderRow as We, tableColumnsVirtualization as Xe, TableKeyboardNavigationContext as oe, tableKeyboardNavigationScopeAttributes as Ge, TableSelection as $e, tableKeyboardNavigationBodyAttributes as je, DropClue as Ye, DragClue as Je, flatData as Qe, FilterRow as Ze, HeaderCell as et, HeaderSelectionCell as tt, TextFilterCell as at, NumericFilterCell as nt, DateFilterCell as ot, BooleanFilterCell as lt } from "@progress/kendo-react-data-tools";
10
+ import { createDataTree as ea, extendDataItem as ta, filterBy as aa, flatData as na, getItemPath as oa, getSelectedState as la, getSelectedStateFromKeyDown as ra, modifySubItems as ia, moveTreeItem as sa, orderBy as ca, removeItems as da, setSelectedState as ha, treeToFlat as ga } from "@progress/kendo-react-data-tools";
11
+ import { useInternationalization as rt, provideLocalizationService as it, registerForLocalization as st, useLocalization as H } from "@progress/kendo-react-intl";
12
+ import { caretAltDownIcon as ct, caretAltRightIcon as dt, plusIcon as ht, cancelIcon as gt } from "@progress/kendo-svg-icons";
13
+ import * as ut from "react-dom";
14
+ import { NumericTextBox as mt } from "@progress/kendo-react-inputs";
15
+ import { DatePicker as ft } from "@progress/kendo-react-dateinputs";
16
+ function pt(e) {
17
+ return e !== void 0 && (typeof e == "number" || /px$/i.test(String(e)));
18
+ }
19
+ function Ct(e, r, t) {
20
+ const a = Array.from(e.tHead && e.tHead.rows || []), n = [r];
21
+ let o;
22
+ const i = t || ((s) => window.getComputedStyle(s).height || void 0);
23
+ a.forEach((s) => {
24
+ let d = i(s);
25
+ n.push(pt(d) ? parseFloat(String(d)) : s.offsetHeight);
26
+ });
27
+ for (let s = 0; s < a.length; s++)
28
+ o = n.slice(0, s + 1).reduce((d, g) => d + g), Array.from(a[s].cells).forEach((d) => d.style.top = o + "px");
29
+ }
30
+ const W = 1e6;
31
+ function vt(e) {
32
+ const { rows: r, tableViewPortHeight: t, scrollTop: a } = e;
33
+ if (r.length === 0)
34
+ return [];
35
+ const n = r[0].height, o = Math.min(Math.round(a / n), r.length), i = Math.round(t / n), s = Math.max(0, o - i), d = Math.min(r.length, o + 2 * i), g = r.slice(s, d), m = g[g.length - 1];
36
+ return s > 0 && g.unshift({
37
+ dataItem: {},
38
+ level: [W],
39
+ offsetTop: 0,
40
+ height: g[0].offsetTop,
41
+ levelCount: 0
42
+ }), d < r.length - 1 && g.push({
43
+ dataItem: {},
44
+ level: [W, W],
45
+ offsetTop: m.offsetTop + m.height,
46
+ height: (r.length - d) * n,
47
+ levelCount: 0
48
+ }), g;
49
+ }
50
+ const xt = ze, L = He, bt = Be, le = (e) => {
51
+ const { hasChildren: r, level: t = [0], expanded: a, dataItem: n, format: o, id: i, ariaColumnIndex: s, isSelected: d } = e, g = C(e.field, n), m = rt(), p = k(i);
52
+ let S = "";
53
+ const w = l.useCallback(
54
+ (E) => {
55
+ E.isDefaultPrevented() || E.keyCode === Fe.enter && e.expandable && (E.preventDefault(), e.onExpandChange(E, n, t));
56
+ },
57
+ [e.expandable, n, t]
58
+ );
59
+ g != null && (S = o ? m.format(o, g) : g.toString());
60
+ const v = [];
61
+ if (e.expandable) {
62
+ const E = (f) => /* @__PURE__ */ l.createElement("span", { key: f, className: "k-treelist-toggle k-icon k-svg-icon" }, /* @__PURE__ */ l.createElement("svg", { "aria-hidden": "true", focusable: "false", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }));
63
+ v.push(...t.slice(1).map((f, F) => E(F))), r ? v.push(
64
+ /* @__PURE__ */ l.createElement(
65
+ ne,
66
+ {
67
+ className: "k-treelist-toggle",
68
+ name: a ? "caret-alt-down" : "caret-alt-right",
69
+ icon: a ? ct : dt,
70
+ key: "expand-collapse",
71
+ onClick: (f) => e.onExpandChange(f.syntheticEvent || f, n, t),
72
+ [bt]: !0
73
+ }
74
+ )
75
+ ) : v.push(E(v.length));
76
+ }
77
+ const O = /* @__PURE__ */ l.createElement(
78
+ "td",
79
+ {
80
+ style: e.style,
81
+ className: I(
82
+ "k-table-td",
83
+ e.className,
84
+ {
85
+ ["k-text-nowrap"]: e.expandable,
86
+ ["k-selected"]: d
87
+ }
88
+ ),
89
+ colSpan: e.colSpan,
90
+ "aria-colindex": s,
91
+ "aria-expanded": r ? a : void 0,
92
+ "aria-selected": d,
93
+ role: "gridcell",
94
+ onKeyDown: w,
95
+ [L]: e.colIndex,
96
+ ...p
97
+ },
98
+ v,
99
+ S
100
+ );
101
+ return e.render ? e.render.call(void 0, O, e) : O;
102
+ };
103
+ le.displayName = "KendoReactTreeListCell";
104
+ const X = "treelist.filterClearButton", B = "treelist.filterEqOperator", K = "treelist.filterNotEqOperator", _ = "treelist.filterIsNullOperator", q = "treelist.filterIsNotNullOperator", re = "treelist.filterIsEmptyOperator", ie = "treelist.filterIsNotEmptyOperator", se = "treelist.filterStartsWithOperator", ce = "treelist.filterContainsOperator", de = "treelist.filterNotContainsOperator", he = "treelist.filterEndsWithOperator", ge = "treelist.filterGteOperator", ue = "treelist.filterGtOperator", me = "treelist.filterLteOperator", fe = "treelist.filterLtOperator", pe = "treelist.filterIsTrue", Ce = "treelist.filterIsFalse", ve = "treelist.filterBooleanAll", xe = "treelist.filterAfterOrEqualOperator", be = "treelist.filterAfterOperator", Ee = "treelist.filterBeforeOperator", Ie = "treelist.filterBeforeOrEqualOperator", G = "treelist.noRecords", $ = {
105
+ [X]: "Clear",
106
+ [B]: "Is equal to",
107
+ [K]: "Is not equal to",
108
+ [_]: "Is null",
109
+ [q]: "Is not null",
110
+ [re]: "Is empty",
111
+ [ie]: "Is not empty",
112
+ [se]: "Starts with",
113
+ [ce]: "Contains",
114
+ [de]: "Does not contain",
115
+ [he]: "Ends with",
116
+ [ge]: "Is greater than or equal to",
117
+ [ue]: "Is greater than",
118
+ [me]: "Is less than or equal to",
119
+ [fe]: "Is less than",
120
+ [pe]: "Is true",
121
+ [Ce]: "Is false",
122
+ [ve]: "(All)",
123
+ [xe]: "Is after or equal to",
124
+ [be]: "Is after",
125
+ [Ee]: "Is before",
126
+ [Ie]: "Is before or equal to",
127
+ [G]: "No records available"
128
+ };
129
+ class Se extends l.Component {
130
+ /**
131
+ * @hidden
132
+ */
133
+ render() {
134
+ return this.props.children || it(this).toLanguageString(G, $[G]);
135
+ }
136
+ }
137
+ st(Se);
138
+ const Y = l.forwardRef((e, r) => {
139
+ const { isSelected: t, rowHeight: a, isAltRow: n, expanded: o, ariaRowIndex: i, level: s, ariaSetSize: d, ariaPosInSet: g } = e, m = I(
140
+ "k-table-row",
141
+ "k-master-row",
142
+ {
143
+ "k-selected": t,
144
+ "k-alt": n
145
+ }
146
+ ), p = l.useMemo(
147
+ () => a !== void 0 ? { height: a + "px" } : void 0,
148
+ [a]
149
+ ), S = /* @__PURE__ */ l.createElement(
150
+ "tr",
151
+ {
152
+ onClick: e.onClick,
153
+ onDoubleClick: e.onDoubleClick,
154
+ onContextMenu: e.onContextMenu,
155
+ className: m,
156
+ style: p,
157
+ ref: r,
158
+ "aria-expanded": o,
159
+ role: "row",
160
+ "aria-rowindex": i,
161
+ "aria-level": s.length,
162
+ "aria-posinset": g,
163
+ "aria-setsize": d,
164
+ [xt]: e.rowIndex
165
+ },
166
+ e.children
167
+ );
168
+ return /* @__PURE__ */ l.createElement(l.Fragment, null, e.render ? e.render.call(void 0, S, e) : S);
169
+ });
170
+ Y.displayName = "KendoReactTreeListRow";
171
+ const Et = {
172
+ name: "@progress/kendo-react-treelist",
173
+ productName: "KendoReact",
174
+ productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
175
+ publishDate: 1701439462,
176
+ version: "",
177
+ licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
178
+ };
179
+ class we extends l.Component {
180
+ constructor(r) {
181
+ super(r), this.wrapperScrollLeft = 0, this.wrapperScrollTop = 0, this.updateOnScroll = !1, this.tbodyOffsetTop = 0, this.prevData = [], this.flattedData = [], this.extendedColumn = [], this.columnsMap = [], this.element = null, this._treeListId = z(), this.contextStateRef = { current: void 0 }, this.navigationStateRef = { current: void 0 }, this.scrollIntoView = (t) => {
182
+ if (!this.element)
183
+ return;
184
+ const { rowIndex: a = 0 } = t, { scrollable: n, rowHeight: o = 0 } = this.props;
185
+ if (n === "virtual" || o)
186
+ this.element.scroll(0, (a - 1) * o);
187
+ else {
188
+ const i = this.element.querySelector(`tbody > tr:nth-child(${a})`);
189
+ if (i) {
190
+ const s = i.offsetTop - this.tbodyOffsetTop;
191
+ this.element.scroll(0, s);
192
+ }
193
+ }
194
+ }, this.getExtendedColumn = Q(
195
+ (t, a) => Ke(t, { prevId: 0, idPrefix: a })
196
+ ), this.getColumnsMap = Q(
197
+ (t) => _e(t)
198
+ ), this.onKeyDown = (t) => {
199
+ if (T.onKeyDown(t, {
200
+ contextStateRef: this.contextStateRef,
201
+ navigationStateRef: this.navigationStateRef
202
+ }), this.props.onKeyDown) {
203
+ const { mode: a, cell: n } = ee(this.props.selectable), o = {
204
+ dataItems: this.getLeafDataItems(),
205
+ mode: a,
206
+ cell: n,
207
+ componentId: this._treeListId,
208
+ selectedField: this.props.selectedField,
209
+ ...this.getArguments(t)
210
+ };
211
+ this.props.onKeyDown.call(void 0, o);
212
+ }
213
+ }, this.onFocus = (t) => {
214
+ T.onFocus(t, {
215
+ contextStateRef: this.contextStateRef
216
+ });
217
+ }, this.onRowDrag = (t) => {
218
+ this.props.onRowDrag && this.props.onRowDrag.call(void 0, { ...t, target: this });
219
+ }, this.onRowDrop = (t) => {
220
+ this.props.onRowDrop && this.props.onRowDrop.call(void 0, { ...t, target: this });
221
+ }, this.columnReorder = (t, a, n) => {
222
+ const o = this.extendedColumn[t].depth, i = (d) => {
223
+ do
224
+ d++;
225
+ while (d < this.extendedColumn.length && this.extendedColumn[d].depth > o);
226
+ return d;
227
+ }, s = this.extendedColumn.splice(t, i(t) - t);
228
+ if (this.extendedColumn.splice(t < a ? i(a - s.length) : a, 0, ...s), this.extendedColumn.filter((d) => d.declarationIndex >= 0).forEach((d, g) => d.orderIndex = g), this.props.onColumnReorder) {
229
+ const d = {
230
+ target: this,
231
+ columns: this.columns,
232
+ nativeEvent: n
233
+ };
234
+ this.props.onColumnReorder.call(void 0, d);
235
+ }
236
+ }, this.onResize = (t, a, n, o, i) => {
237
+ if (this.props.onColumnResize) {
238
+ const s = this.extendedColumn.filter((g) => g.children.length === 0).reduce((g, m) => g += parseFloat(String(m.width)), 0), d = {
239
+ columns: this.columns,
240
+ totalWidth: s,
241
+ index: t,
242
+ nativeEvent: o,
243
+ newWidth: a,
244
+ oldWidth: n,
245
+ end: i,
246
+ target: this
247
+ };
248
+ this.props.onColumnResize.call(void 0, d);
249
+ }
250
+ }, this.handleOnScroll = (t) => {
251
+ const a = t.currentTarget.scrollLeft, n = t.currentTarget.scrollTop, { columnVirtualization: o, scrollable: i, rowHeight: s = 0 } = this.props, d = s, g = 0;
252
+ let m = !1;
253
+ o && Math.abs(this.wrapperScrollLeft - a) > g && (this.wrapperScrollLeft = a, m = !0), i === "virtual" && Math.abs(this.wrapperScrollTop - n) > d && (this.wrapperScrollTop = n, m = !0), m && (this.updateOnScroll = !0, this.forceUpdate());
254
+ }, this.calculateSizes = (t) => {
255
+ if (!t || this.props.scrollable === "none")
256
+ return;
257
+ const a = Array.from(t.childNodes), n = a.find((s) => s.nodeName === "TABLE"), o = this.props.toolbar && a.find((s) => s.nodeType === 1 && s.classList.contains("k-grid-toolbar"));
258
+ let i = 0;
259
+ if (o) {
260
+ const s = o.style.boxSizing;
261
+ o.style.boxSizing = "border-box", i = parseFloat(String(window.getComputedStyle(o).height)) || o.offsetHeight, o.style.boxSizing = s, o.getAttribute("style") || o.removeAttribute("style");
262
+ }
263
+ this.tbodyOffsetTop = n.tBodies[0].offsetTop, Ct(n, i);
264
+ }, this.itemChange = (t) => {
265
+ const a = this.props.onItemChange;
266
+ if (t.field === this.props.expandField) {
267
+ const n = this.props.onExpandChange;
268
+ if (n) {
269
+ const o = {
270
+ ...this.getArguments(t.syntheticEvent),
271
+ dataItem: t.dataItem,
272
+ level: t.level,
273
+ value: t.value
274
+ };
275
+ n.call(void 0, o);
276
+ }
277
+ return;
278
+ }
279
+ if (a) {
280
+ const n = {
281
+ ...this.getArguments(t.syntheticEvent),
282
+ dataItem: t.dataItem,
283
+ level: t.level,
284
+ field: t.field,
285
+ value: t.value
286
+ };
287
+ a.call(void 0, n);
288
+ }
289
+ }, this.onHeaderSelectionChange = (t) => {
290
+ if (this.props.onHeaderSelectionChange) {
291
+ const a = {
292
+ field: t.field,
293
+ nativeEvent: t.syntheticEvent && t.syntheticEvent.nativeEvent,
294
+ syntheticEvent: t.syntheticEvent,
295
+ target: this,
296
+ dataItems: this.getLeafDataItems()
297
+ };
298
+ this.props.onHeaderSelectionChange.call(void 0, a);
299
+ }
300
+ }, this.selectionRelease = (t) => {
301
+ if (this.props.onSelectionChange) {
302
+ const a = {
303
+ syntheticEvent: void 0,
304
+ target: this,
305
+ selectedField: this.props.selectedField || "",
306
+ componentId: this._treeListId,
307
+ dataItems: this.getLeafDataItems(),
308
+ dataItem: null,
309
+ level: [],
310
+ ...t
311
+ };
312
+ this.props.onSelectionChange.call(void 0, a);
313
+ }
314
+ }, this.sortChange = (t, a, n) => {
315
+ this.raiseDataEvent(this.props.onSortChange, { sort: a, field: n }, t);
316
+ }, this.headerFilterChange = (t, a, n) => {
317
+ this.raiseDataEvent(this.props.onFilterChange, { filter: a, field: n }, t);
318
+ }, this.filterChange = (t) => {
319
+ const { filter: a, field: n } = t;
320
+ this.raiseDataEvent(this.props.onFilterChange, { filter: a, field: n }, t.syntheticEvent);
321
+ }, this.columnMenuFilterChange = (t, a, n) => {
322
+ const { onColumnMenuFilterChange: o } = this.props;
323
+ if (!o)
324
+ return;
325
+ const i = {
326
+ syntheticEvent: t,
327
+ filter: a,
328
+ field: n,
329
+ target: this,
330
+ nativeEvent: t.nativeEvent
331
+ };
332
+ o.call(void 0, i);
333
+ }, this.expandChange = (t, a, n) => {
334
+ const { expandField: o, onExpandChange: i } = this.props;
335
+ if (o && i) {
336
+ const s = {
337
+ ...this.getArguments(t),
338
+ dataItem: a,
339
+ level: n,
340
+ value: this.expanded(a)
341
+ };
342
+ i.call(void 0, s);
343
+ }
344
+ }, this.rowClick = (t, a) => {
345
+ if (this.props.onRowClick && t.target.nodeName === "TD") {
346
+ const n = {
347
+ dataItem: a.dataItem,
348
+ level: a.level,
349
+ ...this.getArguments(t)
350
+ };
351
+ this.props.onRowClick.call(void 0, n);
352
+ }
353
+ }, this.rowDoubleClick = (t, a) => {
354
+ if (this.props.onRowDoubleClick && t.target.nodeName === "TD") {
355
+ const n = {
356
+ dataItem: a.dataItem,
357
+ level: a.level,
358
+ ...this.getArguments(t)
359
+ };
360
+ this.props.onRowDoubleClick.call(void 0, n);
361
+ }
362
+ }, this.rowContextMenu = (t, a) => {
363
+ if (this.props.onRowContextMenu && t.target.nodeName === "TD") {
364
+ const n = {
365
+ dataItem: a.dataItem,
366
+ level: a.level,
367
+ ...this.getArguments(t)
368
+ };
369
+ this.props.onRowContextMenu.call(void 0, n);
370
+ }
371
+ }, this.onPageChange = (t) => {
372
+ if (this.props.onPageChange) {
373
+ const a = {
374
+ ...this.getArguments(t.syntheticEvent),
375
+ skip: t.skip,
376
+ take: t.take
377
+ };
378
+ this.props.onPageChange.call(void 0, a);
379
+ }
380
+ }, this.expandedSubItems = (t) => {
381
+ const a = [];
382
+ return this.expanded(t) && this.hasChildren(t) && a.push(...C(this.props.subItemsField, t)), a;
383
+ }, this.getLeafDataItems = () => this.flatData.map((t) => t.dataItem), this.expanded = (t) => !!C(this.props.expandField, t), this.hasChildren = (t) => !!C(this.props.subItemsField, t), Ae(Et), this.dragLogic = new qe(this.columnReorder, Z, Z), this.columnResize = new Ve(this.onResize.bind(this)), T.onConstructor({
384
+ navigatable: !!r.navigatable,
385
+ contextStateRef: this.contextStateRef,
386
+ navigationStateRef: this.navigationStateRef
387
+ });
388
+ }
389
+ get document() {
390
+ if (j)
391
+ return this.element && this.element.ownerDocument || document;
392
+ }
393
+ /**
394
+ * @hidden
395
+ */
396
+ componentDidMount() {
397
+ this.calculateSizes(this.element), T.onComponentDidMount({
398
+ scope: this.element || void 0,
399
+ contextStateRef: this.contextStateRef,
400
+ navigationStateRef: this.navigationStateRef
401
+ });
402
+ }
403
+ /**
404
+ * @hidden
405
+ */
406
+ getSnapshotBeforeUpdate() {
407
+ return T.onGetSnapshotBeforeUpdate({
408
+ document: this.document,
409
+ contextStateRef: this.contextStateRef,
410
+ navigationStateRef: this.navigationStateRef
411
+ }), null;
412
+ }
413
+ /**
414
+ * @hidden
415
+ */
416
+ componentDidUpdate(r) {
417
+ r.columns !== this.props.columns && this.calculateSizes(this.element), T.onComponentDidUpdate({
418
+ scope: this.element || void 0,
419
+ contextStateRef: this.contextStateRef,
420
+ navigationStateRef: this.navigationStateRef
421
+ });
422
+ }
423
+ /**
424
+ * @hidden
425
+ */
426
+ componentWillUnmount() {
427
+ this.columnsMap = [], this.prevData = [], this.flattedData = [], this.updateOnScroll = !1, this.getExtendedColumn.clear(), this.getColumnsMap.clear();
428
+ }
429
+ /**
430
+ * @hidden
431
+ */
432
+ render() {
433
+ const {
434
+ columns: r = [],
435
+ filterRow: t,
436
+ scrollable: a = "scrollable",
437
+ resizable: n = !1,
438
+ reorderable: o = !1,
439
+ skip: i,
440
+ take: s
441
+ } = this.props, d = r.some((h) => !!h.filter || !!h.filterCell) || t !== void 0, g = t || Ze, m = te.getIdPrefix(this.navigationStateRef);
442
+ this.extendedColumn = this.getExtendedColumn(r, m), this.columnsMap = this.getColumnsMap(this.extendedColumn);
443
+ const p = this.extendedColumn.filter((h) => h.children.length === 0);
444
+ this.columnResize.columns = this.extendedColumn, this.columnResize.resizable = n, this.dragLogic.columns = this.extendedColumn, this.dragLogic.reorderable = o, this.dragLogic.groupable = !1;
445
+ const S = /* @__PURE__ */ l.createElement(
446
+ Ue,
447
+ {
448
+ headerRow: /* @__PURE__ */ l.createElement(
449
+ We,
450
+ {
451
+ sort: this.props.sort,
452
+ sortable: this.props.sortable,
453
+ sortChange: this.sortChange,
454
+ selectionChange: this.onHeaderSelectionChange,
455
+ columns: this.extendedColumn,
456
+ columnsMap: this.columnsMap,
457
+ cellRender: this.props.headerCellRender,
458
+ columnResize: this.columnResize,
459
+ columnMenu: this.props.columnMenu,
460
+ columnMenuFilter: this.props.columnMenuFilter,
461
+ columnMenuFilterChange: this.columnMenuFilterChange,
462
+ pressHandler: this.dragLogic.pressHandler,
463
+ dragHandler: this.dragLogic.dragHandler,
464
+ releaseHandler: this.dragLogic.releaseHandler,
465
+ filterChange: this.headerFilterChange
466
+ }
467
+ ),
468
+ filterRow: d && /* @__PURE__ */ l.createElement(
469
+ g,
470
+ {
471
+ columns: p,
472
+ filter: this.props.filter,
473
+ filterChange: this.filterChange,
474
+ sort: this.props.sort,
475
+ ariaRowIndex: this.columnsMap.length + 1
476
+ }
477
+ ) || void 0,
478
+ columnResize: this.columnResize
479
+ }
480
+ ), w = this.props.style || {}, { colSpans: v, hiddenColumns: O } = Xe({
481
+ enabled: this.props.columnVirtualization,
482
+ columns: p,
483
+ scrollLeft: this.wrapperScrollLeft,
484
+ tableViewPortWidth: parseFloat((w.width || "").toString())
485
+ }), E = (h, x, A, M, P, N) => p.map((u, b) => {
486
+ if (O[b])
487
+ return null;
488
+ const y = u.id ? u.id : b, U = `${u.className ? u.className + " " : ""}${u.locked ? "k-grid-content-sticky" : ""}`, D = {
489
+ id: te.generateNavigatableId(`${A}-${String(b)}`, m),
490
+ colSpan: v[b],
491
+ dataItem: h.dataItem,
492
+ field: u.field,
493
+ format: u.format,
494
+ className: U || void 0,
495
+ render: this.props.cellRender,
496
+ onChange: this.itemChange,
497
+ selectionChange: this.props.onSelectionChange ? (R) => {
498
+ this.selectionChange({ event: R, item: h, columnIndex: b, dataIndex: P });
499
+ } : void 0,
500
+ level: h.level,
501
+ expandable: u.expandable,
502
+ expanded: M,
503
+ hasChildren: this.hasChildren(h.dataItem),
504
+ onExpandChange: this.expandChange,
505
+ colIndex: b,
506
+ ariaColumnIndex: u.ariaColumnIndex,
507
+ style: u.left !== void 0 && {
508
+ left: u.left,
509
+ right: u.right,
510
+ borderRightWidth: u.rightBorder ? "1px" : ""
511
+ } || {},
512
+ isSelected: Array.isArray(N) && N.indexOf(b) > -1
513
+ };
514
+ return x && u.editCell ? /* @__PURE__ */ l.createElement(u.editCell, { key: y, ...D, onChange: this.itemChange }) : u.cell ? /* @__PURE__ */ l.createElement(u.cell, { key: y, ...D }) : /* @__PURE__ */ l.createElement(le, { key: y, ...D });
515
+ });
516
+ let f = this.flatData;
517
+ const F = f.length;
518
+ i !== void 0 && s !== void 0 && (f = f.slice(i, i + s)), a === "virtual" && (f = vt({
519
+ rows: f,
520
+ tableViewPortHeight: parseFloat((w.height || w.maxHeight || "").toString()),
521
+ scrollTop: this.wrapperScrollTop
522
+ }), this.updateOnScroll = !1);
523
+ const ye = f.map((h) => h.level), De = this.columnsMap.length + (d ? 1 : 0) + 1, Te = f.length > 0 && f.map((h, x) => {
524
+ const A = C(this.props.editField, h.dataItem), M = this.props.dataItemKey && Me(this.props.dataItemKey)(h.dataItem), P = String(M || h.level.join(".")), N = this.expanded(h.dataItem), u = this.props.selectedField ? C(this.props.selectedField, h.dataItem) : void 0, b = {
525
+ key: P,
526
+ level: h.level,
527
+ levels: ye,
528
+ dataItem: h.dataItem,
529
+ selectedField: this.props.selectedField,
530
+ rowHeight: a === "virtual" ? h.height : this.props.rowHeight,
531
+ render: this.props.rowRender,
532
+ onDrop: this.onRowDrop,
533
+ onDrag: this.onRowDrag,
534
+ onClick: (R) => this.rowClick(R, h),
535
+ onDoubleClick: (R) => this.rowDoubleClick(R, h),
536
+ onContextMenu: (R) => this.rowContextMenu(R, h),
537
+ isAltRow: x % 2 !== 0,
538
+ expanded: N,
539
+ rowIndex: x,
540
+ ariaRowIndex: De + x,
541
+ ariaSetSize: h.levelCount,
542
+ ariaPosInSet: h.level[h.level.length - 1] + 1,
543
+ isSelected: typeof u == "boolean" && u
544
+ }, y = this.props.editRow, U = this.props.row || Y, D = E(h, A, P, N, x, u);
545
+ return A && y ? /* @__PURE__ */ l.createElement(y, { ...b }, D) : /* @__PURE__ */ l.createElement(U, { ...b }, D);
546
+ }) || /* @__PURE__ */ l.createElement("tr", { className: "k-table-row k-grid-norecords" }, /* @__PURE__ */ l.createElement("td", { colSpan: p.length }, this.props.noRecords || /* @__PURE__ */ l.createElement(Se, null))), ke = (h) => this.props.sort && this.props.sort.some((x) => x.field === h), Ne = /* @__PURE__ */ l.createElement("colgroup", { ref: (h) => {
547
+ this.columnResize.colGroupMain = h;
548
+ } }, p.map(
549
+ (h, x) => /* @__PURE__ */ l.createElement(
550
+ "col",
551
+ {
552
+ key: x.toString(),
553
+ className: ke(h.field) ? "k-sorted" : void 0,
554
+ style: h.width !== void 0 ? { width: h.width } : void 0
555
+ }
556
+ )
557
+ )), Le = this.props.columnVirtualization || this.props.scrollable === "virtual", Oe = this.props.selectable && this.props.selectable.drag ? "none" : void 0, J = this.props.tableProps || {};
558
+ return /* @__PURE__ */ l.createElement(oe.Provider, { value: this.contextStateRef.current }, /* @__PURE__ */ l.createElement(
559
+ "div",
560
+ {
561
+ style: this.props.style,
562
+ className: I(
563
+ "k-grid k-grid-md",
564
+ this.props.className,
565
+ { "k-treelist-scrollable": a !== "none" }
566
+ ),
567
+ ref: (h) => this.element = h,
568
+ onScroll: Le ? this.handleOnScroll : void 0,
569
+ onKeyDown: this.onKeyDown,
570
+ onFocus: this.onFocus,
571
+ "aria-rowcount": F,
572
+ "aria-colcount": p.length,
573
+ role: "treegrid",
574
+ ...Ge
575
+ },
576
+ this.props.toolbar,
577
+ /* @__PURE__ */ l.createElement(
578
+ $e,
579
+ {
580
+ selectable: this.props.selectable,
581
+ onRelease: this.selectionRelease
582
+ },
583
+ /* @__PURE__ */ l.createElement(
584
+ "table",
585
+ {
586
+ className: "k-table k-table-md k-grid-table",
587
+ ...J,
588
+ style: { ...J.style || {}, userSelect: Oe },
589
+ role: "presentation"
590
+ },
591
+ Ne,
592
+ S,
593
+ /* @__PURE__ */ l.createElement("tbody", { className: "k-table-tbody", ...je, role: "presentation" }, Te)
594
+ )
595
+ ),
596
+ this.props.pager && /* @__PURE__ */ l.createElement(
597
+ this.props.pager,
598
+ {
599
+ className: "k-grid-pager",
600
+ total: F,
601
+ skip: i,
602
+ take: s,
603
+ onPageChange: this.onPageChange
604
+ }
605
+ ),
606
+ o && /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(Ye, { ref: this.dragLogic.refDropElementClue }), /* @__PURE__ */ l.createElement(Je, { ref: this.dragLogic.refDragElementClue }))
607
+ ));
608
+ }
609
+ get columns() {
610
+ const r = this.extendedColumn.filter((a) => a.declarationIndex >= 0 && a.parentIndex === -1), t = (a) => (a.sort((n, o) => n.declarationIndex - o.declarationIndex), a.map((n) => {
611
+ const {
612
+ declarationIndex: o,
613
+ parentIndex: i,
614
+ depth: s,
615
+ colSpan: d,
616
+ rowSpan: g,
617
+ index: m,
618
+ kFirst: p,
619
+ groupable: S,
620
+ children: w,
621
+ ...v
622
+ } = n;
623
+ return w.length ? {
624
+ children: t(w),
625
+ ...v
626
+ } : v;
627
+ }));
628
+ return t(r);
629
+ }
630
+ get flatData() {
631
+ const { data: r = [], rowHeight: t = 0 } = this.props;
632
+ let a = 0;
633
+ const n = (i) => {
634
+ const s = { height: t, offsetTop: a };
635
+ return a += s.height, s;
636
+ };
637
+ let o = this.updateOnScroll && this.prevData === r && this.tbodyOffsetTop > 0 && this.flattedData.length ? this.flattedData : Qe(r, this.expandedSubItems, n);
638
+ return this.prevData = r, this.flattedData = o, o;
639
+ }
640
+ selectionChange(r) {
641
+ if (this.props.onSelectionChange) {
642
+ const { event: t, item: a, dataIndex: n, columnIndex: o } = r, { mode: i, cell: s } = ee(this.props.selectable), d = {
643
+ ...this.getArguments(t.syntheticEvent),
644
+ dataItem: a.dataItem,
645
+ level: a.level,
646
+ startColIndex: o,
647
+ endColIndex: o,
648
+ startRowIndex: n,
649
+ endRowIndex: n,
650
+ dataItems: this.getLeafDataItems(),
651
+ altKey: !1,
652
+ ctrlKey: !1,
653
+ shiftKey: !1,
654
+ metaKey: !1,
655
+ mode: i,
656
+ cell: s,
657
+ isDrag: !1,
658
+ componentId: this._treeListId,
659
+ selectedField: this.props.selectedField || ""
660
+ };
661
+ this.props.onSelectionChange.call(void 0, d);
662
+ }
663
+ }
664
+ raiseDataEvent(r, t, a) {
665
+ const n = this.props.onDataStateChange;
666
+ if (r)
667
+ r.call(void 0, { ...this.getArguments(a), ...t });
668
+ else if (n) {
669
+ const o = {
670
+ ...this.getArguments(a),
671
+ dataState: { ...this.getDataState(), ...t }
672
+ };
673
+ n.call(void 0, o);
674
+ }
675
+ }
676
+ getDataState() {
677
+ return {
678
+ filter: this.props.filter,
679
+ sort: this.props.sort
680
+ };
681
+ }
682
+ getArguments(r) {
683
+ return {
684
+ nativeEvent: r && r.nativeEvent,
685
+ syntheticEvent: r,
686
+ target: this
687
+ };
688
+ }
689
+ }
690
+ we.propTypes = {
691
+ data: c.array,
692
+ resizable: c.bool,
693
+ reorderable: c.bool,
694
+ sortable: c.oneOfType([
695
+ c.bool,
696
+ c.shape({
697
+ mode: c.oneOf(["single", "multiple"]),
698
+ allowUnsort: c.bool
699
+ })
700
+ ]),
701
+ onSortChange: c.func,
702
+ sort: c.array,
703
+ columns: c.arrayOf(c.object),
704
+ columnVirtualization: c.bool,
705
+ filter: c.array,
706
+ onFilterChange: c.func,
707
+ filterRow: c.any,
708
+ toolbar: c.any,
709
+ noRecords: c.any,
710
+ onExpandChange: c.func,
711
+ expandField: c.string,
712
+ subItemsField: c.string,
713
+ selectedField: c.string,
714
+ onSelectionChange: c.func,
715
+ onHeaderSelectionChange: c.func,
716
+ onRowClick: c.func,
717
+ onItemChange: c.func,
718
+ editField: c.string,
719
+ scrollable: c.oneOf(["none", "scrollable", "virtual"]),
720
+ rowHeight: c.number,
721
+ style: c.object,
722
+ tableProps: c.object,
723
+ pager: c.any,
724
+ skip: c.number,
725
+ take: c.number,
726
+ onPageChange: c.func,
727
+ onDataStateChange: c.func,
728
+ onColumnResize: c.func,
729
+ onColumnReorder: c.func,
730
+ dataItemKey: c.string,
731
+ navigatable: c.bool
732
+ };
733
+ we.contextType = oe;
734
+ const Kt = (e) => /* @__PURE__ */ l.createElement(et, { ...e }), It = (e) => {
735
+ const r = l.useCallback(
736
+ (i) => {
737
+ e.selectionChange && e.selectionChange({ syntheticEvent: i });
738
+ },
739
+ [e.selectionChange]
740
+ ), t = l.useMemo(() => z(), []), a = C(e.field, e.dataItem), n = k(e.id), o = /* @__PURE__ */ l.createElement(
741
+ "td",
742
+ {
743
+ style: e.style,
744
+ className: I(
745
+ "k-table-td",
746
+ e.className
747
+ ),
748
+ "aria-colindex": e.ariaColumnIndex,
749
+ role: "gridcell",
750
+ ...n
751
+ },
752
+ /* @__PURE__ */ l.createElement(
753
+ "input",
754
+ {
755
+ checked: typeof a == "boolean" && a,
756
+ id: t,
757
+ type: "checkbox",
758
+ className: "k-checkbox k-checkbox-md k-rounded-md",
759
+ onChange: r
760
+ }
761
+ ),
762
+ /* @__PURE__ */ l.createElement("label", { className: "k-checkbox-label", htmlFor: t })
763
+ );
764
+ return e.render ? e.render.call(void 0, o, e) : o;
765
+ };
766
+ It.displayName = "KendoReactTreeListSelectionCell";
767
+ class _t extends l.Component {
768
+ constructor() {
769
+ super(...arguments), this._inputId = z();
770
+ }
771
+ /**
772
+ * @hidden
773
+ */
774
+ render() {
775
+ return /* @__PURE__ */ l.createElement(tt, { inputId: this._inputId, ...this.props });
776
+ }
777
+ }
778
+ const St = (e) => e.visible && j ? ut.createPortal(
779
+ /* @__PURE__ */ l.createElement(
780
+ "div",
781
+ {
782
+ className: "k-header k-drag-clue",
783
+ style: {
784
+ display: "block",
785
+ position: "absolute",
786
+ zIndex: 2e4,
787
+ padding: "8px 12px",
788
+ top: e.top + "px",
789
+ left: e.left + "px"
790
+ }
791
+ },
792
+ /* @__PURE__ */ l.createElement(
793
+ ne,
794
+ {
795
+ className: I(
796
+ "k-drag-status"
797
+ ),
798
+ name: e.allowDrop ? "plus" : "cancel",
799
+ icon: e.allowDrop ? ht : gt
800
+ }
801
+ ),
802
+ e.text
803
+ ),
804
+ document.body
805
+ ) : null;
806
+ function wt(e, r, t) {
807
+ if (!e.originalEvent)
808
+ return -1;
809
+ let a = Re(e, "tr", t);
810
+ if (a) {
811
+ const n = r ? r.childNodes : [];
812
+ for (let o = 0; o < n.length; o++)
813
+ if (n[o] === a)
814
+ return o;
815
+ }
816
+ return -1;
817
+ }
818
+ function Re(e, r, t) {
819
+ let a = t ? t.elementFromPoint(e.clientX, e.clientY) : null;
820
+ return r && a ? a.closest(r) : null;
821
+ }
822
+ const Rt = "k-grid k-grid-md", ae = {
823
+ visible: !1,
824
+ top: 0,
825
+ left: 0,
826
+ text: "",
827
+ allowDrop: !1
828
+ };
829
+ class qt extends l.Component {
830
+ constructor() {
831
+ super(...arguments), this.state = {
832
+ clueProps: { ...ae }
833
+ }, this.draggable = l.createRef(), this.dragged = null, this.draggedOver = null, this.onPress = () => this.dragged = this.props.level, this.onDrag = (r) => {
834
+ if (!j)
835
+ return;
836
+ const t = this.draggable.current && this.draggable.current.element, a = t ? t.ownerDocument : document;
837
+ if (!a)
838
+ return;
839
+ const n = r.event, o = this.dragged;
840
+ if (t && o) {
841
+ !n.isTouch && n.type !== "scroll" && n.originalEvent.preventDefault();
842
+ const i = this.props.levels[wt(n, t.parentNode, a)];
843
+ this.draggedOver = i;
844
+ const s = i ? !o.every((d, g) => d === i[g]) : !!Re(n, Rt, a);
845
+ this.setState({
846
+ clueProps: {
847
+ visible: !0,
848
+ top: n.pageY + 10,
849
+ left: n.pageX,
850
+ text: t.innerText,
851
+ allowDrop: s
852
+ }
853
+ }), this.props.onDrag && this.props.onDrag.call(void 0, {
854
+ nativeEvent: n.originalEvent,
855
+ dragged: o,
856
+ draggedOver: i,
857
+ draggedItem: this.props.dataItem
858
+ });
859
+ }
860
+ }, this.onRelease = (r) => {
861
+ const t = r.event;
862
+ if (this.dragged) {
863
+ const a = [...this.dragged], n = this.draggedOver && [...this.draggedOver], o = this.state.clueProps.allowDrop;
864
+ this.dragged = null, this.draggedOver = null, this.setState({ clueProps: { ...ae } });
865
+ const i = this.props.dataItem;
866
+ o && this.props.onDrop && this.props.onDrop.call(void 0, {
867
+ nativeEvent: t.originalEvent,
868
+ dragged: a,
869
+ draggedOver: n,
870
+ draggedItem: i
871
+ });
872
+ }
873
+ };
874
+ }
875
+ /**
876
+ * @hidden
877
+ */
878
+ render() {
879
+ const { clueProps: r } = this.state;
880
+ return /* @__PURE__ */ l.createElement(l.Fragment, null, /* @__PURE__ */ l.createElement(
881
+ Pe,
882
+ {
883
+ ref: this.draggable,
884
+ onPress: this.onPress,
885
+ onDrag: this.onDrag,
886
+ onRelease: this.onRelease
887
+ },
888
+ /* @__PURE__ */ l.createElement(Y, { ...this.props })
889
+ ), /* @__PURE__ */ l.createElement(St, { ...r }));
890
+ }
891
+ }
892
+ class Vt extends l.Component {
893
+ /**
894
+ * @hidden
895
+ */
896
+ render() {
897
+ return /* @__PURE__ */ l.createElement(
898
+ "div",
899
+ {
900
+ className: "k-toolbar k-grid-toolbar"
901
+ },
902
+ this.props.children
903
+ );
904
+ }
905
+ }
906
+ const yt = [
907
+ { text: ce, operator: "contains" },
908
+ { text: de, operator: "doesnotcontain" },
909
+ { text: B, operator: "eq" },
910
+ { text: K, operator: "neq" },
911
+ { text: se, operator: "startswith" },
912
+ { text: he, operator: "endswith" },
913
+ { text: _, operator: "isnull" },
914
+ { text: q, operator: "isnotnull" },
915
+ { text: re, operator: "isempty" },
916
+ { text: ie, operator: "isnotempty" }
917
+ ], Dt = [
918
+ { text: B, operator: "eq" },
919
+ { text: K, operator: "neq" },
920
+ { text: ge, operator: "gte" },
921
+ { text: ue, operator: "gt" },
922
+ { text: me, operator: "lte" },
923
+ { text: fe, operator: "lt" },
924
+ { text: _, operator: "isnull" },
925
+ { text: q, operator: "isnotnull" }
926
+ ], Tt = [
927
+ { text: B, operator: "eq" },
928
+ { text: K, operator: "neq" },
929
+ { text: xe, operator: "gte" },
930
+ { text: be, operator: "gt" },
931
+ { text: Ee, operator: "lt" },
932
+ { text: Ie, operator: "lte" },
933
+ { text: _, operator: "isnull" },
934
+ { text: q, operator: "isnotnull" }
935
+ ], kt = [
936
+ { text: ve, operator: "" },
937
+ { text: pe, operator: !0 },
938
+ { text: Ce, operator: !1 }
939
+ ];
940
+ function V(e, r) {
941
+ return {
942
+ clearButtonTitle: e.toLanguageString(X, $[X]),
943
+ operators: r.map((t) => ({
944
+ text: e.toLanguageString(t.text, $[t.text]),
945
+ operator: t.operator
946
+ }))
947
+ };
948
+ }
949
+ const Ut = function(e) {
950
+ const { operators: r, ...t } = e;
951
+ return /* @__PURE__ */ l.createElement(
952
+ at,
953
+ {
954
+ ariaLabel: "text filter",
955
+ ...V(H(), r || yt),
956
+ ...t
957
+ }
958
+ );
959
+ }, Wt = function(e) {
960
+ const { operators: r, ...t } = e;
961
+ return /* @__PURE__ */ l.createElement(
962
+ nt,
963
+ {
964
+ ariaLabel: "numeric filter",
965
+ ...V(H(), r || Dt),
966
+ ...t
967
+ }
968
+ );
969
+ }, Xt = function(e) {
970
+ const { operators: r, ...t } = e;
971
+ return /* @__PURE__ */ l.createElement(
972
+ ot,
973
+ {
974
+ ariaLabel: "date filter",
975
+ ...V(H(), r || Tt),
976
+ ...t
977
+ }
978
+ );
979
+ }, Gt = function(e) {
980
+ const { operators: r, ...t } = e;
981
+ return /* @__PURE__ */ l.createElement(
982
+ lt,
983
+ {
984
+ ariaLabel: "boolean filter",
985
+ ...V(H(), r || kt),
986
+ ...t
987
+ }
988
+ );
989
+ }, Nt = (e) => {
990
+ const r = l.useCallback(
991
+ (o) => {
992
+ e.onChange && e.onChange({
993
+ dataItem: e.dataItem,
994
+ level: e.level,
995
+ field: e.field,
996
+ syntheticEvent: o,
997
+ value: o.target.value
998
+ });
999
+ },
1000
+ [e.onChange, e.dataItem, e.level, e.field]
1001
+ ), t = k(e.id), a = I({
1002
+ ["k-selected"]: e.isSelected
1003
+ }, e.className), n = /* @__PURE__ */ l.createElement(
1004
+ "td",
1005
+ {
1006
+ style: e.style,
1007
+ className: a,
1008
+ "aria-colindex": e.ariaColumnIndex,
1009
+ "aria-selected": e.isSelected,
1010
+ role: "gridcell",
1011
+ ...t,
1012
+ [L]: e.colIndex
1013
+ },
1014
+ /* @__PURE__ */ l.createElement(
1015
+ "input",
1016
+ {
1017
+ style: { width: "100%" },
1018
+ className: "k-input",
1019
+ value: C(e.field, e.dataItem) || "",
1020
+ onChange: r
1021
+ }
1022
+ )
1023
+ );
1024
+ return e.render ? e.render.call(void 0, n, e) : n;
1025
+ };
1026
+ Nt.displayName = "KendoReactTreeListTextEditor";
1027
+ const Lt = (e) => {
1028
+ const r = l.useCallback(
1029
+ (i) => {
1030
+ e.onChange && e.onChange({
1031
+ dataItem: e.dataItem,
1032
+ level: e.level,
1033
+ field: e.field,
1034
+ syntheticEvent: i.syntheticEvent,
1035
+ value: i.value
1036
+ });
1037
+ },
1038
+ [e.onChange, e.dataItem, e.level, e.field]
1039
+ ), t = C(e.field, e.dataItem), a = k(e.id), n = I({
1040
+ ["k-selected"]: e.isSelected
1041
+ }, e.className), o = /* @__PURE__ */ l.createElement(
1042
+ "td",
1043
+ {
1044
+ style: e.style,
1045
+ className: n,
1046
+ "aria-colindex": e.ariaColumnIndex,
1047
+ "aria-selected": e.isSelected,
1048
+ role: "gridcell",
1049
+ ...a,
1050
+ [L]: e.colIndex
1051
+ },
1052
+ /* @__PURE__ */ l.createElement(
1053
+ mt,
1054
+ {
1055
+ width: "100%",
1056
+ value: t === void 0 ? null : t,
1057
+ onChange: r
1058
+ }
1059
+ )
1060
+ );
1061
+ return e.render ? e.render.call(void 0, o, e) : o;
1062
+ };
1063
+ Lt.displayName = "KendoReactTreeListNumericEditor";
1064
+ const Ot = (e) => {
1065
+ const r = l.useCallback(
1066
+ (i) => {
1067
+ e.onChange && e.onChange({
1068
+ dataItem: e.dataItem,
1069
+ level: e.level,
1070
+ field: e.field,
1071
+ syntheticEvent: i,
1072
+ value: i.target.checked
1073
+ });
1074
+ },
1075
+ [e.onChange, e.dataItem, e.level, e.field]
1076
+ ), t = l.useMemo(() => z(), []), a = k(e.id), n = I({
1077
+ ["k-selected"]: e.isSelected
1078
+ }, e.className), o = /* @__PURE__ */ l.createElement(
1079
+ "td",
1080
+ {
1081
+ style: e.style,
1082
+ className: n,
1083
+ "aria-colindex": e.ariaColumnIndex,
1084
+ "aria-selected": e.isSelected,
1085
+ role: "gridcell",
1086
+ ...a,
1087
+ [L]: e.colIndex
1088
+ },
1089
+ /* @__PURE__ */ l.createElement(
1090
+ "input",
1091
+ {
1092
+ checked: C(e.field, e.dataItem) || !1,
1093
+ id: t,
1094
+ type: "checkbox",
1095
+ className: "k-checkbox k-checkbox-md k-rounded-md",
1096
+ onChange: r
1097
+ }
1098
+ ),
1099
+ /* @__PURE__ */ l.createElement("label", { className: "k-checkbox-label", htmlFor: t })
1100
+ );
1101
+ return e.render ? e.render.call(void 0, o, e) : o;
1102
+ };
1103
+ Ot.displayName = "KendoReactTreeListBooleanEditor";
1104
+ const Ft = (e) => {
1105
+ const r = l.useCallback(
1106
+ (o) => {
1107
+ e.onChange && e.onChange({
1108
+ dataItem: e.dataItem,
1109
+ level: e.level,
1110
+ field: e.field,
1111
+ syntheticEvent: o.syntheticEvent,
1112
+ value: o.value
1113
+ });
1114
+ },
1115
+ [e.onChange, e.dataItem, e.level, e.field]
1116
+ ), t = k(e.id), a = I({
1117
+ ["k-selected"]: e.isSelected
1118
+ }, e.className);
1119
+ let n = /* @__PURE__ */ l.createElement(
1120
+ "td",
1121
+ {
1122
+ style: e.style,
1123
+ className: a,
1124
+ "aria-colindex": e.ariaColumnIndex,
1125
+ "aria-selected": e.isSelected,
1126
+ role: "gridcell",
1127
+ ...t,
1128
+ [L]: e.colIndex
1129
+ },
1130
+ /* @__PURE__ */ l.createElement(
1131
+ ft,
1132
+ {
1133
+ width: "100%",
1134
+ value: C(e.field, e.dataItem),
1135
+ onChange: r
1136
+ }
1137
+ )
1138
+ );
1139
+ return e.render ? e.render.call(void 0, n, e) : n;
1140
+ };
1141
+ Ft.displayName = "KendoReactTreeListDateEditor";
1142
+ export {
1143
+ L as TREELIST_COL_INDEX_ATTRIBUTE,
1144
+ bt as TREELIST_PREVENT_SELECTION_ELEMENT,
1145
+ xt as TREELIST_ROW_INDEX_ATTRIBUTE,
1146
+ we as TreeList,
1147
+ Ot as TreeListBooleanEditor,
1148
+ Gt as TreeListBooleanFilter,
1149
+ le as TreeListCell,
1150
+ Ft as TreeListDateEditor,
1151
+ Xt as TreeListDateFilter,
1152
+ qt as TreeListDraggableRow,
1153
+ Kt as TreeListHeaderCell,
1154
+ _t as TreeListHeaderSelectionCell,
1155
+ Se as TreeListNoRecords,
1156
+ Lt as TreeListNumericEditor,
1157
+ Wt as TreeListNumericFilter,
1158
+ Y as TreeListRow,
1159
+ It as TreeListSelectionCell,
1160
+ Nt as TreeListTextEditor,
1161
+ Ut as TreeListTextFilter,
1162
+ Vt as TreeListToolbar,
1163
+ ea as createDataTree,
1164
+ ta as extendDataItem,
1165
+ aa as filterBy,
1166
+ na as flatData,
1167
+ oa as getItemPath,
1168
+ Yt as getNestedValue,
1169
+ la as getSelectedState,
1170
+ ra as getSelectedStateFromKeyDown,
1171
+ Jt as mapTree,
1172
+ Qt as mapTreeItem,
1173
+ ia as modifySubItems,
1174
+ sa as moveTreeItem,
1175
+ ca as orderBy,
1176
+ da as removeItems,
1177
+ Ct as setHeaderRowsTop,
1178
+ ha as setSelectedState,
1179
+ vt as tableRowsVirtualization,
1180
+ ga as treeToFlat
1181
+ };