@progress/kendo-react-data-tools 8.2.0-develop.23 → 8.2.0-develop.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/js/kendo-react-datatools.js +1 -1
- package/index.d.mts +18 -0
- package/index.d.ts +18 -0
- package/navigation/TableKeyboardNavigation.js +1 -1
- package/navigation/TableKeyboardNavigation.mjs +176 -122
- package/navigation/utils.js +1 -1
- package/navigation/utils.mjs +149 -101
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
|
@@ -6,197 +6,251 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import { guid as
|
|
10
|
-
import { focusFirstDataElement as
|
|
11
|
-
import { NavigatableMode as
|
|
12
|
-
const
|
|
13
|
-
const { navigatable:
|
|
14
|
-
|
|
9
|
+
import { guid as K, getActiveElement as L, Keys as r } from "@progress/kendo-react-common";
|
|
10
|
+
import { focusFirstDataElement as w, getFirstDataCell as B, tableKeyboardNavigationTools as t, focusFirstEditor as P, getCurrentIdIndexes as H, getFirstRowDataCell as U, getLastRowDataCell as O, getLastDataCell as V, getHeaderElement as G, getBodyElement as W, getNoRecordsElement as $, getNavigatableId as j, findNextIdByRowIndex as F, findNextIdByCellIndex as q } from "./utils.mjs";
|
|
11
|
+
import { NavigatableMode as D } from "./NavigatableSettings.mjs";
|
|
12
|
+
const S = (e) => {
|
|
13
|
+
const { navigatable: c, contextStateRef: o, navigationStateRef: n, idPrefix: i } = e;
|
|
14
|
+
c && (o.current = {
|
|
15
15
|
activeId: "",
|
|
16
16
|
level: 0
|
|
17
|
-
},
|
|
17
|
+
}, n.current = {
|
|
18
18
|
activeElementIsFocused: !1,
|
|
19
19
|
prevNavigationIndexes: void 0,
|
|
20
|
-
idPrefix: i ||
|
|
20
|
+
idPrefix: i || K(),
|
|
21
21
|
navigationMatrix: [],
|
|
22
22
|
lastHeaderIndex: -1
|
|
23
23
|
});
|
|
24
|
-
},
|
|
25
|
-
const { scope:
|
|
26
|
-
if (o.current &&
|
|
27
|
-
|
|
28
|
-
const i =
|
|
24
|
+
}, T = (e) => {
|
|
25
|
+
const { scope: c, contextStateRef: o, navigationStateRef: n } = e;
|
|
26
|
+
if (o.current && n.current && c) {
|
|
27
|
+
h(e);
|
|
28
|
+
const i = B(n.current.navigationMatrix);
|
|
29
29
|
if (i) {
|
|
30
|
-
const
|
|
31
|
-
|
|
30
|
+
const f = t.getActiveNavDataElement(c, i);
|
|
31
|
+
f && (o.current.activeId = i, f.setAttribute("tabIndex", "0"));
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
},
|
|
35
|
-
const { contextStateRef:
|
|
36
|
-
if (
|
|
37
|
-
const i =
|
|
38
|
-
|
|
34
|
+
}, z = (e) => {
|
|
35
|
+
const { contextStateRef: c, navigationStateRef: o, document: n } = e;
|
|
36
|
+
if (c.current && o.current && n) {
|
|
37
|
+
const i = L(n), f = t.getNavigatableId(i);
|
|
38
|
+
f && f === c.current.activeId && (o.current.activeElementIsFocused = !0);
|
|
39
39
|
}
|
|
40
|
-
},
|
|
41
|
-
const { scope:
|
|
42
|
-
if (i && (
|
|
43
|
-
if (!
|
|
44
|
-
const
|
|
45
|
-
|
|
40
|
+
}, J = (e) => {
|
|
41
|
+
const { scope: c, contextStateRef: o, navigationStateRef: n, focusFirst: i, newEditableRow: f, singleEditRow: s, lastActiveElement: v, navigatable: a } = e;
|
|
42
|
+
if (i && (S(e), T(e), w(e)), (!a || a && a.mode === D.inline) && (f && !s || f && s && !v) ? P(f) : a && a.mode === D.inline && f && s && v && v.focus(), h(e), o.current && n.current && c) {
|
|
43
|
+
if (!t.getActiveNavDataElement(c, o.current.activeId)) {
|
|
44
|
+
const b = B(n.current.navigationMatrix), I = t.getActiveNavDataElement(c, b);
|
|
45
|
+
b && I && (o.current.activeId = b, I.setAttribute("tabIndex", "0"), n.current.activeElementIsFocused && I.focus());
|
|
46
46
|
}
|
|
47
|
-
|
|
47
|
+
n.current.activeElementIsFocused = !1;
|
|
48
48
|
}
|
|
49
|
-
},
|
|
50
|
-
const { contextStateRef: o } =
|
|
49
|
+
}, Q = (e, c) => {
|
|
50
|
+
const { contextStateRef: o } = c;
|
|
51
51
|
if (e.isDefaultPrevented() || !o.current)
|
|
52
52
|
return;
|
|
53
|
-
const
|
|
53
|
+
const n = e.target, i = t.getNavigatableId(n);
|
|
54
54
|
if (i && i !== o.current.activeId) {
|
|
55
|
-
const
|
|
56
|
-
if (!
|
|
55
|
+
const f = t.getClosestScope(n);
|
|
56
|
+
if (!f)
|
|
57
57
|
return;
|
|
58
|
-
const
|
|
59
|
-
|
|
58
|
+
const s = t.getActiveNavDataElement(f, o.current.activeId);
|
|
59
|
+
s && !e.target.classList.contains("k-table-td") && !e.target.classList.contains("k-detail-cell") && s.setAttribute("tabIndex", "-1"), n.setAttribute("tabIndex", "0"), o.current.activeId = i;
|
|
60
60
|
}
|
|
61
|
-
},
|
|
62
|
-
var
|
|
61
|
+
}, X = async (e, c) => {
|
|
62
|
+
var C, p, N, R;
|
|
63
63
|
const {
|
|
64
64
|
contextStateRef: o,
|
|
65
|
-
navigationStateRef:
|
|
66
|
-
onNavigationAction: i
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
navigationStateRef: n,
|
|
66
|
+
onNavigationAction: i,
|
|
67
|
+
columns: f
|
|
68
|
+
} = c;
|
|
69
|
+
if (e.isDefaultPrevented() || !o.current || !n.current)
|
|
69
70
|
return;
|
|
70
|
-
let
|
|
71
|
-
if (e.keyCode ===
|
|
72
|
-
|
|
71
|
+
let s;
|
|
72
|
+
if (e.keyCode === r.esc && !c.navigatable.mode) {
|
|
73
|
+
s = t.getClosestNavigatableElement(e.target), t.focusElement({ elementForFocus: s, event: e, contextStateRef: o });
|
|
73
74
|
return;
|
|
74
75
|
}
|
|
75
|
-
const
|
|
76
|
-
if (
|
|
77
|
-
if (e.keyCode ===
|
|
78
|
-
const
|
|
79
|
-
if (
|
|
76
|
+
const v = e.target, a = v.className.indexOf("k-checkbox") === -1 ? v : t.getClosestNavigatableElement(v), m = t.getNavigatableId(a) || ((C = t.getParentCell(a)) == null ? void 0 : C.getAttribute("data-keyboardnavid")), b = m == null ? void 0 : m.endsWith("column"), I = t.getNavigatableLevel(a), y = t.getClosestScope(a), x = n.current.navigationMatrix, k = e.metaKey || e.ctrlKey, u = H(n, x, m);
|
|
77
|
+
if (c.navigatable && c.navigatable.mode === D.inline) {
|
|
78
|
+
if (e.keyCode === r.enter) {
|
|
79
|
+
const d = a.classList.contains("k-grid-remove-command"), l = a.classList.contains("k-grid-cancel-command"), g = t.getRowAriaRowIndex(a);
|
|
80
|
+
if (d) {
|
|
80
81
|
setTimeout(() => {
|
|
81
|
-
const
|
|
82
|
-
|
|
82
|
+
const E = t.getRemoveButtonByAriaRowIndex(g.current) || t.getRemoveButtonByAriaRowIndex(g.prev);
|
|
83
|
+
E && E.focus();
|
|
83
84
|
});
|
|
84
85
|
return;
|
|
85
|
-
} else if (
|
|
86
|
-
const
|
|
86
|
+
} else if (l && a.parentElement) {
|
|
87
|
+
const E = (p = t.getClosestNavigatableElement(a)) == null ? void 0 : p.getAttribute("data-keyboardnavid");
|
|
87
88
|
setTimeout(() => {
|
|
88
|
-
|
|
89
|
+
E && t.getTableCellByKeyboardNavId(E).focus();
|
|
89
90
|
});
|
|
90
91
|
return;
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
if (e.keyCode ===
|
|
94
|
-
const
|
|
95
|
-
|
|
96
|
-
const
|
|
97
|
-
|
|
94
|
+
if (e.keyCode === r.esc) {
|
|
95
|
+
const d = t.getClosestCancelButton(a);
|
|
96
|
+
d && d.click();
|
|
97
|
+
const l = await t.getClosestEditButton(a);
|
|
98
|
+
l && l.focus();
|
|
98
99
|
return;
|
|
99
100
|
}
|
|
101
|
+
} else if (c.navigatable && c.navigatable.mode === D.incell) {
|
|
102
|
+
const d = (N = a.closest(".k-table-td")) == null ? void 0 : N.classList.contains("k-grid-edit-cell");
|
|
103
|
+
if (e.keyCode === r.esc) {
|
|
104
|
+
a.focus(), a.blur();
|
|
105
|
+
const l = v && v.parentElement && v.parentElement.closest(".k-grid-edit-row"), g = t.getClosestCellNavId(a), E = await t.waitForElementToBeVisible(`[data-keyboardnavid='${g}']:not(.k-grid-edit-cell)`, l);
|
|
106
|
+
E && E.focus();
|
|
107
|
+
} else if (e.keyCode === r.enter) {
|
|
108
|
+
let l;
|
|
109
|
+
if (u) {
|
|
110
|
+
const [g, E] = u;
|
|
111
|
+
l = F(g, E, m, x, !1);
|
|
112
|
+
}
|
|
113
|
+
if (!d)
|
|
114
|
+
(R = t.getParentCell(a)) == null || R.click();
|
|
115
|
+
else if (d && l) {
|
|
116
|
+
const g = l && l[0] && t.getTableCellByKeyboardNavId(l[0]);
|
|
117
|
+
g && g.click();
|
|
118
|
+
}
|
|
119
|
+
} else if (e.keyCode === r.left) {
|
|
120
|
+
if (d)
|
|
121
|
+
return;
|
|
122
|
+
} else if (e.keyCode === r.right) {
|
|
123
|
+
if (d)
|
|
124
|
+
return;
|
|
125
|
+
} else if (e.keyCode === r.up) {
|
|
126
|
+
if (d)
|
|
127
|
+
return;
|
|
128
|
+
} else if (e.keyCode === r.down) {
|
|
129
|
+
if (d)
|
|
130
|
+
return;
|
|
131
|
+
} else if (e.keyCode === r.tab && d) {
|
|
132
|
+
if (e.shiftKey) {
|
|
133
|
+
const l = u && f && t.getPrevEditableCell(u, f, m, x);
|
|
134
|
+
if (l && l.prevCell && l.prevCell.click(), l && l.elementToFocus !== "gridcell") {
|
|
135
|
+
a.blur();
|
|
136
|
+
const g = t.getClosestCellNavId(a);
|
|
137
|
+
setTimeout(() => {
|
|
138
|
+
g && t.getTableCellByKeyboardNavId(g).focus();
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
e.preventDefault();
|
|
142
|
+
} else {
|
|
143
|
+
const l = u && f && t.getNextEditableCell(u, f, m, x);
|
|
144
|
+
if (l && l.nextCell && l.elementToFocus === "gridcell" && l.nextCell.click(), l && l.elementToFocus !== "gridcell") {
|
|
145
|
+
a.blur();
|
|
146
|
+
const g = t.getClosestCellNavId(a);
|
|
147
|
+
g && t.getTableCellByKeyboardNavId(g).focus();
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
e.preventDefault();
|
|
151
|
+
}
|
|
152
|
+
e.preventDefault();
|
|
153
|
+
}
|
|
100
154
|
}
|
|
101
|
-
if (
|
|
102
|
-
if (e.keyCode ===
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
105
|
-
|
|
106
|
-
elementForFocus:
|
|
155
|
+
if (I !== void 0 && y) {
|
|
156
|
+
if (e.keyCode === r.enter) {
|
|
157
|
+
const d = t.getNavigatableElement(a, { level: I + 1 });
|
|
158
|
+
if (d) {
|
|
159
|
+
t.focusElement({
|
|
160
|
+
elementForFocus: d,
|
|
107
161
|
event: e,
|
|
108
162
|
contextStateRef: o,
|
|
109
|
-
prevElement:
|
|
163
|
+
prevElement: a
|
|
110
164
|
});
|
|
111
165
|
return;
|
|
112
166
|
} else {
|
|
113
|
-
|
|
167
|
+
s = t.getFocusableElements(a)[0], t.focusElement({ elementForFocus: s, event: e, contextStateRef: o, prevElement: a });
|
|
114
168
|
return;
|
|
115
169
|
}
|
|
116
170
|
}
|
|
117
|
-
if (e.keyCode ===
|
|
118
|
-
if (
|
|
119
|
-
|
|
171
|
+
if (e.keyCode === r.home && u)
|
|
172
|
+
if (k)
|
|
173
|
+
w(
|
|
120
174
|
{
|
|
121
|
-
scope:
|
|
122
|
-
navigationStateRef:
|
|
175
|
+
scope: y,
|
|
176
|
+
navigationStateRef: n,
|
|
123
177
|
contextStateRef: o
|
|
124
178
|
},
|
|
125
179
|
e
|
|
126
180
|
);
|
|
127
181
|
else {
|
|
128
|
-
const
|
|
129
|
-
|
|
182
|
+
const d = U(n.current.navigationMatrix, u[0]);
|
|
183
|
+
s = t.getActiveNavDataElement(y, d), t.focusElement({ elementForFocus: s, event: e, contextStateRef: o });
|
|
130
184
|
}
|
|
131
|
-
if (e.keyCode ===
|
|
132
|
-
if (
|
|
133
|
-
const
|
|
134
|
-
|
|
185
|
+
if (e.keyCode === r.end && u)
|
|
186
|
+
if (k) {
|
|
187
|
+
const d = V(n.current.navigationMatrix);
|
|
188
|
+
s = t.getActiveNavDataElement(y, d), t.focusElement({ elementForFocus: s, event: e, contextStateRef: o });
|
|
135
189
|
} else {
|
|
136
|
-
const
|
|
137
|
-
|
|
190
|
+
const d = O(n.current.navigationMatrix, u[0]);
|
|
191
|
+
s = t.getActiveNavDataElement(y, d), t.focusElement({ elementForFocus: s, event: e, contextStateRef: o });
|
|
138
192
|
}
|
|
139
|
-
if (e.keyCode ===
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
142
|
-
const [
|
|
143
|
-
|
|
193
|
+
if (e.keyCode === r.up || e.keyCode === r.down || e.keyCode === r.left || e.keyCode === r.right) {
|
|
194
|
+
const d = e.keyCode === r.up || e.keyCode === r.left, l = e.keyCode === r.up || e.keyCode === r.down;
|
|
195
|
+
if (u) {
|
|
196
|
+
const [g, E] = u, [A, M] = l ? F(g, E, m, x, d) : q(g, E, m, x, d);
|
|
197
|
+
A && (s = t.getActiveNavDataElement(y, A), t.focusElement({ elementForFocus: s, event: e, contextStateRef: o, prevElement: a }), n.current.prevNavigationIndexes = M);
|
|
144
198
|
}
|
|
145
199
|
}
|
|
146
|
-
if (
|
|
147
|
-
i && i({ focusElement:
|
|
200
|
+
if (k && e.keyCode === r.left && b) {
|
|
201
|
+
i && i({ focusElement: a, event: e, action: "reorderToLeft" }), e.preventDefault();
|
|
148
202
|
return;
|
|
149
203
|
}
|
|
150
|
-
if (
|
|
151
|
-
i && i({ focusElement:
|
|
204
|
+
if (k && e.keyCode === r.right && b) {
|
|
205
|
+
i && i({ focusElement: a, event: e, action: "reorderToRight" }), e.preventDefault();
|
|
152
206
|
return;
|
|
153
207
|
}
|
|
154
|
-
if (e.keyCode ===
|
|
155
|
-
i && i({ focusElement:
|
|
208
|
+
if (e.keyCode === r.pageUp) {
|
|
209
|
+
i && i({ focusElement: s, event: e, action: "moveToNextPage" }), e.preventDefault();
|
|
156
210
|
return;
|
|
157
211
|
}
|
|
158
|
-
if (e.keyCode ===
|
|
159
|
-
i && i({ focusElement:
|
|
212
|
+
if (e.keyCode === r.pageDown) {
|
|
213
|
+
i && i({ focusElement: s, event: e, action: "moveToPrevPage" }), e.preventDefault();
|
|
160
214
|
return;
|
|
161
215
|
}
|
|
162
|
-
i && i({ focusElement:
|
|
216
|
+
i && i({ focusElement: s, event: e });
|
|
163
217
|
}
|
|
164
|
-
},
|
|
165
|
-
const { navigationStateRef:
|
|
166
|
-
if (!
|
|
218
|
+
}, h = (e) => {
|
|
219
|
+
const { navigationStateRef: c, scope: o } = e;
|
|
220
|
+
if (!c.current || !o)
|
|
167
221
|
return;
|
|
168
|
-
const
|
|
169
|
-
if (!i || !
|
|
222
|
+
const n = [], i = G(o), f = W(o), s = $(o) || { children: [] };
|
|
223
|
+
if (!i || !f)
|
|
170
224
|
return;
|
|
171
|
-
const
|
|
172
|
-
[...
|
|
173
|
-
Array.from(
|
|
174
|
-
const y =
|
|
225
|
+
const v = Array.from(i.children), a = Array.from(f.children);
|
|
226
|
+
[...v, ...a, s].forEach((m, b) => {
|
|
227
|
+
Array.from(m.children).forEach((I) => {
|
|
228
|
+
const y = j(I);
|
|
175
229
|
if (!y)
|
|
176
230
|
return;
|
|
177
|
-
const
|
|
178
|
-
let
|
|
179
|
-
for (let
|
|
180
|
-
if (
|
|
181
|
-
const
|
|
182
|
-
|
|
231
|
+
const x = I.rowSpan || 1, k = I.colSpan || 1;
|
|
232
|
+
let u;
|
|
233
|
+
for (let C = b, p = b + x; C < p; C++) {
|
|
234
|
+
if (n[C] || (n[C] = []), u === void 0) {
|
|
235
|
+
const N = n[C].findIndex((R) => !R);
|
|
236
|
+
u = N > -1 ? N : n[C].length;
|
|
183
237
|
}
|
|
184
|
-
|
|
238
|
+
n[C][u] = y || "";
|
|
185
239
|
}
|
|
186
|
-
for (let
|
|
187
|
-
|
|
240
|
+
for (let C = u + 1, p = u + k; C < p; C++)
|
|
241
|
+
n[b][C] = y || "";
|
|
188
242
|
});
|
|
189
|
-
}),
|
|
190
|
-
},
|
|
191
|
-
onConstructor:
|
|
192
|
-
onComponentDidMount:
|
|
193
|
-
onGetSnapshotBeforeUpdate:
|
|
194
|
-
onComponentDidUpdate:
|
|
195
|
-
onFocus:
|
|
196
|
-
onKeyDown:
|
|
197
|
-
generateMatrix:
|
|
198
|
-
focusFirstDataElement:
|
|
243
|
+
}), c.current.navigationMatrix = n.filter((m) => !!m), c.current.lastHeaderIndex = v.length - 1;
|
|
244
|
+
}, ee = {
|
|
245
|
+
onConstructor: S,
|
|
246
|
+
onComponentDidMount: T,
|
|
247
|
+
onGetSnapshotBeforeUpdate: z,
|
|
248
|
+
onComponentDidUpdate: J,
|
|
249
|
+
onFocus: Q,
|
|
250
|
+
onKeyDown: X,
|
|
251
|
+
generateMatrix: h,
|
|
252
|
+
focusFirstDataElement: w
|
|
199
253
|
};
|
|
200
254
|
export {
|
|
201
|
-
|
|
255
|
+
ee as tableKeyboardNavigation
|
|
202
256
|
};
|
package/navigation/utils.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@progress/kendo-react-common"),a=require("./constants.js"),m=(e,t,n="cell")=>`${t}_${e}_${n}`,B=e=>{if(e)return parseInt(e.getAttribute(a.KEYBOARD_NAV_DATA_LEVEL)||"",10)},b=e=>{if(!e)return;const t=e.getAttribute(a.KEYBOARD_NAV_DATA_ID);return t||void 0},A=e=>e?!!e.getAttribute(a.KEYBOARD_NAV_DATA_ID):!1,x=(e,t={level:0})=>e.querySelector(`[${a.KEYBOARD_NAV_DATA_LEVEL}='${t.level}']`),N=e=>e&&e.parentElement&&e.parentElement.closest(`[${a.KEYBOARD_NAV_DATA_LEVEL}]`),v=(e,t)=>e.querySelector(`[${a.KEYBOARD_NAV_DATA_ID}='${t}']`),y=e=>e&&e.parentElement&&e.parentElement.closest(`[${a.KEYBOARD_NAV_DATA_SCOPE}]`),w=e=>{const t=e&&e.parentElement&&e.parentElement.closest(".k-grid-edit-row");return t&&t.querySelector("."+a.KEYBOARD_NAV_CANCEL_BUTTON_CLASS)},T=e=>document.querySelector(`[aria-rowindex="${e}"] .k-grid-remove-command`),u=e=>document.querySelector(`[data-keyboardnavid="${e}"]`),p=e=>{var r;const t=e&&e.parentElement&&e.parentElement.closest(".k-table-row");let n;return(r=t==null?void 0:t.parentElement)==null||r.childNodes.forEach(l=>{if(t===l){const o=l.previousSibling;n={current:t.getAttribute("aria-rowindex"),prev:o&&o.getAttribute("aria-rowindex")}}}),n};async function R(e,t,n=5e3){const r=Date.now();if(t)for(;Date.now()-r<n;){const l=t.querySelector(e);if(l)return l;await new Promise(o=>setTimeout(o,20))}return!1}const L=async e=>{const t=e&&e.parentElement&&e.parentElement.closest(".k-grid-edit-row");return await R("."+a.KEYBOARD_NAV_EDIT_BUTTON_CLASS,t)},S=e=>(e==null?void 0:e.closest(".k-table-td"))||null,F=e=>e.querySelector(`[${a.KEYBOARD_NAV_DATA_HEADER}]`),O=e=>e.querySelector(`[${a.KEYBOARD_NAV_DATA_BODY}]`),W=e=>e.querySelector(".k-grid-norecords"),X=e=>{const t=e.querySelector(".k-grid-edit-cell"),n=t&&t.querySelector("input");n?n.focus():(t==null?void 0:t.firstChild).focus()},h=(e,t)=>{const{scope:n,navigationStateRef:r,contextStateRef:l}=e;if(!r.current||!n)return;const o=M(r.current.navigationMatrix),s=v(n,o);C({elementForFocus:s,contextStateRef:l,event:t})},V=(e,t={focusable:!1})=>{const n=t.focusable?g.FOCUSABLE_ELEMENTS:g.TABBABLE_ELEMENTS;return Array.from(e.querySelectorAll(n.join(",")))},$=(e,t={level:0})=>{if(!e)return[];const n=g.FOCUSABLE_ELEMENTS.map(r=>r+`[${a.KEYBOARD_NAV_DATA_LEVEL}='${t.level}']`).join(",");return Array.from(e.querySelectorAll(n))},k=(e={level:0})=>{const t=g.FOCUSABLE_ELEMENTS.map(n=>n+`[${a.KEYBOARD_NAV_DATA_LEVEL}='${e.level}']`).join(",");return n=>n.matches(t)},C=e=>{const{elementForFocus:t,event:n,contextStateRef:r,prevElement:l}=e;if(r.current&&t&&t.focus){n==null||n.preventDefault();const o=t.querySelector(".k-checkbox-wrap .k-checkbox");o&&o.focus?o.focus():t.focus(),A(t)&&(t.setAttribute("tabIndex","0"),r.current.activeId=b(t)),l&&A(l)&&l.setAttribute("tabIndex","-1")}},K=e=>e.current?e.current.idPrefix:"",q=(e,t,n,r,l)=>{if(!n)return[];let o=e+(l?-1:1);for(;o>=0&&o<r.length;){const s=r[o][t];if(s!==n)return[s,[o,t]];o=o+(l?-1:1)}return[]},d=(e,t,n,r,l)=>{if(!n)return[];let o=t+(l?-1:1);for(;o>=0&&r[e]&&o<r[e].length;){const s=r[e][o];if(s!==n)return[s,[e,o]];o=o+(l?-1:1)}return[]},f=(e,t)=>{if(t){for(let n=0;n<e.length;n++)for(let r=0;r<e[n].length;r++)if(e[n][r]===t)return[n,r]}},_=(e,t,n)=>{let r;do if(e=e+1,r=t[n-e],r&&r.editable)break;while(n-e>=0);return r},Y=(e,t,n,r)=>{var I;let l;const[o,s]=e;let c;const i=0,E=t.length;return c=_(i,t,s),c?l=d(o,c.ariaColumnIndex,n,r,!0):(c=_(i,t,E),l=d(o-1,c.ariaColumnIndex,n,r,!0)),{prevCell:l&&l[0]&&u(l[0]),elementToFocus:l&&l[0]&&((I=u(l[0]))==null?void 0:I.getAttribute("role"))}},D=(e,t,n)=>{let r;do if(e=e+1,r=t[n+e],r&&r.editable)break;while(n+e-1<t.length);return r},P=(e,t,n,r)=>{var o;let l;if(e){const[s,c]=e;let i,E=0;i=D(E,t,c),i?l=d(s,i.ariaColumnIndex,n,r,!0):(E=-1,i=D(E,t,0),l=d(s+1,i.ariaColumnIndex,n,r,!0))}return{nextCell:l&&l[0]&&u(l[0]),elementToFocus:l&&l[0]&&((o=u(l[0]))==null?void 0:o.getAttribute("role"))}},U=e=>e.current?e.current.navigationMatrix.length:0,M=e=>e.flat().find(t=>t.endsWith("cell")),z=e=>e.flat().reverse().find(t=>t.endsWith("cell")),G=(e,t)=>e[t][0],J=(e,t)=>Array.from(e[t]).reverse()[0],j=e=>e?`${e}${a.KEYBOARD_NAV_FILTER_COL_SUFFIX}`:"",Q=(e,t,n)=>{let r;if(e.current&&e.current.prevNavigationIndexes){const[l,o]=e.current.prevNavigationIndexes,s=t[l];s&&s[o]===n?r=e.current.prevNavigationIndexes:r=f(t,n)}else r=f(t,n);return r},H=e=>{var t;return((t=N(e))==null?void 0:t.getAttribute("data-keyboardnavid"))||e.getAttribute("data-keyboardnavid")},Z={generateNavigatableId:m,getNavigatableId:b,getNavigatableLevel:B,getNavigatableElement:x,getClosestNavigatableElement:N,getActiveNavDataElement:v,getClosestScope:y,getHeaderElement:F,getBodyElement:O,getFocusableElements:V,getNavigatableElements:$,filterNavigatableElements:k,focusElement:C,getIdPrefix:K,isNavigatable:A,findNextIdByRowIndex:q,findNextIdByCellIndex:d,findId:f,getNextNavigationIndex:U,getFilterColumnId:j,focusFirstDataElement:h,getClosestCancelButton:w,getClosestEditButton:L,getRowAriaRowIndex:p,getRemoveButtonByAriaRowIndex:T,getTableCellByKeyboardNavId:u,getParentCell:S,waitForElementToBeVisible:R,getNextEditableCell:P,getPrevEditableCell:Y,getClosestCellNavId:H};exports.filterNavigatableElements=k;exports.findId=f;exports.findNextIdByCellIndex=d;exports.findNextIdByRowIndex=q;exports.focusElement=C;exports.focusFirstDataElement=h;exports.focusFirstEditor=X;exports.generateNavigatableId=m;exports.getActiveNavDataElement=v;exports.getBodyElement=O;exports.getClosestCancelButton=w;exports.getClosestCellNavId=H;exports.getClosestEditButton=L;exports.getClosestNavigatableElement=N;exports.getClosestScope=y;exports.getCurrentIdIndexes=Q;exports.getFilterColumnId=j;exports.getFirstDataCell=M;exports.getFirstRowDataCell=G;exports.getFocusableElements=V;exports.getHeaderElement=F;exports.getIdPrefix=K;exports.getLastDataCell=z;exports.getLastRowDataCell=J;exports.getNavigatableElement=x;exports.getNavigatableElements=$;exports.getNavigatableId=b;exports.getNavigatableLevel=B;exports.getNextEditableCell=P;exports.getNextNavigationIndex=U;exports.getNoRecordsElement=W;exports.getParentCell=S;exports.getPrevEditableCell=Y;exports.getRemoveButtonByAriaRowIndex=T;exports.getRowAriaRowIndex=p;exports.getTableCellByKeyboardNavId=u;exports.isNavigatable=A;exports.tableKeyboardNavigationTools=Z;
|