@progress/kendo-react-data-tools 13.3.0-develop.2 → 13.3.0-develop.4
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 +231 -9
- package/index.d.ts +231 -9
- package/index.js +1 -1
- package/index.mjs +175 -168
- package/navigation/TableKeyboardNavigation.js +1 -1
- package/navigation/TableKeyboardNavigation.mjs +38 -47
- package/navigation/stackedKeyboardNavigation.js +8 -0
- package/navigation/stackedKeyboardNavigation.mjs +73 -0
- package/navigation/utils.js +1 -1
- package/navigation/utils.mjs +113 -93
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +2 -2
- package/package.json +10 -10
package/index.mjs
CHANGED
|
@@ -7,190 +7,197 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { Pager as t } from "./pager/Pager.mjs";
|
|
9
9
|
import { ColumnResize as a } from "./drag/ColumnResize.mjs";
|
|
10
|
-
import { ColumnResizer as
|
|
11
|
-
import { CommonDragLogic as
|
|
10
|
+
import { ColumnResizer as m } from "./drag/ColumnResizer.mjs";
|
|
11
|
+
import { CommonDragLogic as p } from "./drag/CommonDragLogic.mjs";
|
|
12
12
|
import { DragClue as x } from "./drag/DragClue.mjs";
|
|
13
|
-
import { DropClue as
|
|
14
|
-
import { combineFilters as C, createDataTree as
|
|
13
|
+
import { DropClue as u } from "./drag/DropClue.mjs";
|
|
14
|
+
import { combineFilters as C, createDataTree as s, extendDataItem as T, filterBy as E, flatData as A, getItemPath as g, getSearchFromString as _, getStringFromSearch as D, modifySubItems as N, moveTreeItem as c, orderBy as S, removeItems as b, treeToFlat as I } from "./utils/data-operations.mjs";
|
|
15
15
|
import { getGroupIds as F, setExpandedState as R, setGroupIds as B } from "./utils/group-operations.mjs";
|
|
16
|
-
import { useTableKeyboardNavigation as
|
|
17
|
-
import { KEYBOARD_NAV_CANCEL_BUTTON_CLASS as
|
|
18
|
-
import { NavigatableMode as
|
|
19
|
-
import { tableKeyboardNavigation as
|
|
16
|
+
import { useTableKeyboardNavigation as y } from "./navigation/hooks.mjs";
|
|
17
|
+
import { KEYBOARD_NAV_CANCEL_BUTTON_CLASS as v, KEYBOARD_NAV_DATA_BODY as M, KEYBOARD_NAV_DATA_HEADER as P, KEYBOARD_NAV_DATA_ID as V, KEYBOARD_NAV_DATA_LEVEL as h, KEYBOARD_NAV_DATA_SCOPE as Y, KEYBOARD_NAV_DATA_ZONE as H, KEYBOARD_NAV_EDIT_BUTTON_CLASS as U, KEYBOARD_NAV_FILTER_COL_SUFFIX as G, tableKeyboardNavigationBodyAttributes as k, tableKeyboardNavigationHeaderAttributes as X, tableKeyboardNavigationScopeAttributes as w } from "./navigation/constants.mjs";
|
|
18
|
+
import { NavigatableMode as W } from "./navigation/NavigatableSettings.mjs";
|
|
19
|
+
import { tableKeyboardNavigation as j } from "./navigation/TableKeyboardNavigation.mjs";
|
|
20
20
|
import { TableKeyboardNavigationContext as J } from "./navigation/TableKeyboardNavigationContext.mjs";
|
|
21
21
|
import { tableKeyboardNavigationTools as $ } from "./navigation/utils.mjs";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
import {
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
22
|
+
import { handleNavigationKeysInEditMode as oe, handleStackedCellEnterKey as te, handleStackedCellEscapeKey as re, handleStackedCellTabNavigation as ae, handleStackedKeyboardNavigation as le, stackedKeyboardNavigationTools as me } from "./navigation/stackedKeyboardNavigation.mjs";
|
|
23
|
+
import { TableSelection as pe } from "./selection/TableSelection.mjs";
|
|
24
|
+
import { TABLE_COL_INDEX_ATTRIBUTE as xe, TABLE_PREVENT_SELECTION_ELEMENT as de, TABLE_ROW_INDEX_ATTRIBUTE as ue } from "./selection/constants.mjs";
|
|
25
|
+
import { closestTagName as Ce, getColumnIndex as se, getOffset as Te, getRowIndex as Ee, getSelectedState as Ae, getSelectedStateFromKeyDown as ge, getSelectionOptions as _e, isInNonSelectable as De, relativeContextElement as Ne, setSelectedState as ce } from "./selection/utils.mjs";
|
|
26
|
+
import { getEditableOptions as be } from "./editing/utils.mjs";
|
|
27
|
+
import { EDIT_ACTION as Oe, editReducer as Fe } from "./editing/editReducer.mjs";
|
|
28
|
+
import { getDetailExpandableOptions as Be } from "./detail-expansion/utils.mjs";
|
|
29
|
+
import { DETAIL_EXPAND_ACTION as ye, detailExpandReducer as Le } from "./detail-expansion/expandReducer.mjs";
|
|
30
|
+
import { GROUP_EXPAND_ACTION as Me, findGroupExpand as Pe, flatToTree as Ve, getGroupExpandableOptions as he, groupExpandReducer as Ye, isExpanded as He } from "./group-expansion/groupExpandReducer.mjs";
|
|
31
|
+
import { ClipboardService as Ge } from "./clipboard/clipboard.service.mjs";
|
|
32
|
+
import { ClipboardActionType as Xe, addHeaders as we, getClipboardData as ze, getClipboardItemsToPaste as We, getClipboardText as Ze, getItemsToPaste as je, getItemsToUpdateOnPaste as qe, getPastedItems as Je, getPreviouslyCopiedItemsData as Qe, getSelectedItems as $e, itemToString as eo, populateClipboardData as oo } from "./clipboard/common.mjs";
|
|
33
|
+
import { useDataSource as ro } from "./data-source/use-data-source.mjs";
|
|
34
|
+
import { useRemoteDataSource as lo } from "./data-source/use-remote-data-source.mjs";
|
|
35
|
+
import { useODataDataSource as no } from "./data-source/use-odata-data-source.mjs";
|
|
36
|
+
import { createFilterComponent as io } from "./filteringCells/FilterComponent.mjs";
|
|
37
|
+
import { BooleanFilterCell as uo } from "./filteringCells/BooleanFilter.mjs";
|
|
38
|
+
import { DateFilterCell as Co } from "./filteringCells/DateFilter.mjs";
|
|
39
|
+
import { NumericFilterCell as To } from "./filteringCells/NumericFilter.mjs";
|
|
40
|
+
import { TextFilterCell as Ao } from "./filteringCells/TextFilter.mjs";
|
|
41
|
+
import { ColumnDefaultProps as _o } from "./header/ColumnProps.mjs";
|
|
42
|
+
import { FILTER_ROW_CLASS as No, FilterRow as co } from "./header/FilterRow.mjs";
|
|
43
|
+
import { Header as bo } from "./header/Header.mjs";
|
|
44
|
+
import { HeaderCell as Oo } from "./header/HeaderCell.mjs";
|
|
45
|
+
import { HeaderRow as Ro } from "./header/HeaderRow.mjs";
|
|
46
|
+
import { HeaderSelectionCell as Ko } from "./header/HeaderSelectionCell.mjs";
|
|
47
|
+
import { normalize as Lo } from "./header/SortSettings.mjs";
|
|
48
|
+
import { getIndex as Mo, isRtl as Po, mapColumns as Vo, nextColumn as ho, readColumns as Yo, updateLeft as Ho, updateRight as Uo } from "./header/utils/index.mjs";
|
|
49
|
+
import { HeaderThElement as ko } from "./header/HeaderThElement.mjs";
|
|
50
|
+
import { HeaderTdElement as wo } from "./header/HeaderTdElement.mjs";
|
|
51
|
+
import { tableColumnsVirtualization as Wo } from "./virtualization/columns.mjs";
|
|
52
|
+
import { TextFilter as jo } from "./filter/filters/TextFilter.mjs";
|
|
53
|
+
import { NumericFilter as Jo } from "./filter/filters/NumericFilter.mjs";
|
|
54
|
+
import { DateFilter as $o } from "./filter/filters/DateFilter.mjs";
|
|
55
|
+
import { BooleanFilter as ot } from "./filter/filters/BooleanFilter.mjs";
|
|
56
|
+
import { EnumFilter as rt } from "./filter/filters/EnumFilter.mjs";
|
|
57
|
+
import { Expression as lt } from "./filter/Expression.mjs";
|
|
58
|
+
import { Filter as nt, selectors as pt } from "./filter/Filter.mjs";
|
|
59
|
+
import { Group as xt } from "./filter/Group.mjs";
|
|
60
|
+
import { Operators as ut, stringOperator as ft, unaryOperator as Ct } from "./filter/operators.mjs";
|
|
61
|
+
import { ColumnMenuBooleanColumn as Tt, ColumnMenuDateColumn as Et, ColumnMenuNumericColumn as At, ColumnMenuTextColumn as gt } from "./columnmenu/ColumnMenu.mjs";
|
|
62
|
+
import { ColumnMenuFilterForm as Dt, ColumnMenuForm as Nt } from "./columnmenu/ColumnMenuFilterForm.mjs";
|
|
63
|
+
import { ColumnMenuFilterLogic as St } from "./columnmenu/ColumnMenuFilterLogic.mjs";
|
|
64
|
+
import { ColumnMenuBooleanFilter as It, ColumnMenuDateFilter as Ot, ColumnMenuNumericFilter as Ft, ColumnMenuTextFilter as Rt } from "./columnmenu/ColumnMenuFilters.mjs";
|
|
65
|
+
import { ColumnMenuItem as Kt } from "./columnmenu/ColumnMenuItem.mjs";
|
|
66
|
+
import { ColumnMenuOperators as Lt } from "./columnmenu/ColumnMenuOperators.mjs";
|
|
66
67
|
export {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
68
|
+
ot as BooleanFilter,
|
|
69
|
+
uo as BooleanFilterCell,
|
|
70
|
+
Xe as ClipboardActionType,
|
|
71
|
+
Ge as ClipboardService,
|
|
72
|
+
_o as ColumnDefaultProps,
|
|
73
|
+
Tt as ColumnMenuBooleanColumn,
|
|
74
|
+
It as ColumnMenuBooleanFilter,
|
|
75
|
+
Et as ColumnMenuDateColumn,
|
|
76
|
+
Ot as ColumnMenuDateFilter,
|
|
77
|
+
Dt as ColumnMenuFilterForm,
|
|
78
|
+
St as ColumnMenuFilterLogic,
|
|
79
|
+
Nt as ColumnMenuForm,
|
|
80
|
+
Kt as ColumnMenuItem,
|
|
81
|
+
At as ColumnMenuNumericColumn,
|
|
82
|
+
Ft as ColumnMenuNumericFilter,
|
|
83
|
+
Lt as ColumnMenuOperators,
|
|
84
|
+
gt as ColumnMenuTextColumn,
|
|
85
|
+
Rt as ColumnMenuTextFilter,
|
|
85
86
|
a as ColumnResize,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
m as ColumnResizer,
|
|
88
|
+
p as CommonDragLogic,
|
|
89
|
+
ye as DETAIL_EXPAND_ACTION,
|
|
90
|
+
$o as DateFilter,
|
|
91
|
+
Co as DateFilterCell,
|
|
91
92
|
x as DragClue,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
93
|
+
u as DropClue,
|
|
94
|
+
Oe as EDIT_ACTION,
|
|
95
|
+
rt as EnumFilter,
|
|
96
|
+
lt as Expression,
|
|
97
|
+
No as FILTER_ROW_CLASS,
|
|
98
|
+
nt as Filter,
|
|
99
|
+
co as FilterRow,
|
|
100
|
+
Me as GROUP_EXPAND_ACTION,
|
|
101
|
+
xt as Group,
|
|
102
|
+
bo as Header,
|
|
103
|
+
Oo as HeaderCell,
|
|
104
|
+
Ro as HeaderRow,
|
|
105
|
+
Ko as HeaderSelectionCell,
|
|
106
|
+
wo as HeaderTdElement,
|
|
107
|
+
ko as HeaderThElement,
|
|
108
|
+
v as KEYBOARD_NAV_CANCEL_BUTTON_CLASS,
|
|
109
|
+
M as KEYBOARD_NAV_DATA_BODY,
|
|
109
110
|
P as KEYBOARD_NAV_DATA_HEADER,
|
|
110
111
|
V as KEYBOARD_NAV_DATA_ID,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
112
|
+
h as KEYBOARD_NAV_DATA_LEVEL,
|
|
113
|
+
Y as KEYBOARD_NAV_DATA_SCOPE,
|
|
114
|
+
H as KEYBOARD_NAV_DATA_ZONE,
|
|
115
|
+
U as KEYBOARD_NAV_EDIT_BUTTON_CLASS,
|
|
116
|
+
G as KEYBOARD_NAV_FILTER_COL_SUFFIX,
|
|
117
|
+
W as NavigatableMode,
|
|
118
|
+
Jo as NumericFilter,
|
|
119
|
+
To as NumericFilterCell,
|
|
120
|
+
ut as Operators,
|
|
120
121
|
t as Pager,
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
xe as TABLE_COL_INDEX_ATTRIBUTE,
|
|
123
|
+
de as TABLE_PREVENT_SELECTION_ELEMENT,
|
|
124
|
+
ue as TABLE_ROW_INDEX_ATTRIBUTE,
|
|
124
125
|
J as TableKeyboardNavigationContext,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
126
|
+
pe as TableSelection,
|
|
127
|
+
jo as TextFilter,
|
|
128
|
+
Ao as TextFilterCell,
|
|
129
|
+
we as addHeaders,
|
|
130
|
+
Ce as closestTagName,
|
|
130
131
|
C as combineFilters,
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
132
|
+
s as createDataTree,
|
|
133
|
+
io as createFilterComponent,
|
|
134
|
+
Le as detailExpandReducer,
|
|
135
|
+
Fe as editReducer,
|
|
136
|
+
T as extendDataItem,
|
|
137
|
+
E as filterBy,
|
|
138
|
+
Pe as findGroupExpand,
|
|
139
|
+
A as flatData,
|
|
140
|
+
Ve as flatToTree,
|
|
141
|
+
ze as getClipboardData,
|
|
142
|
+
We as getClipboardItemsToPaste,
|
|
143
|
+
Ze as getClipboardText,
|
|
144
|
+
se as getColumnIndex,
|
|
145
|
+
Be as getDetailExpandableOptions,
|
|
146
|
+
be as getEditableOptions,
|
|
147
|
+
he as getGroupExpandableOptions,
|
|
147
148
|
F as getGroupIds,
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
149
|
+
Mo as getIndex,
|
|
150
|
+
g as getItemPath,
|
|
151
|
+
je as getItemsToPaste,
|
|
152
|
+
qe as getItemsToUpdateOnPaste,
|
|
153
|
+
Te as getOffset,
|
|
154
|
+
Je as getPastedItems,
|
|
155
|
+
Qe as getPreviouslyCopiedItemsData,
|
|
156
|
+
Ee as getRowIndex,
|
|
157
|
+
_ as getSearchFromString,
|
|
158
|
+
$e as getSelectedItems,
|
|
159
|
+
Ae as getSelectedState,
|
|
160
|
+
ge as getSelectedStateFromKeyDown,
|
|
161
|
+
_e as getSelectionOptions,
|
|
162
|
+
D as getStringFromSearch,
|
|
163
|
+
Ye as groupExpandReducer,
|
|
164
|
+
oe as handleNavigationKeysInEditMode,
|
|
165
|
+
te as handleStackedCellEnterKey,
|
|
166
|
+
re as handleStackedCellEscapeKey,
|
|
167
|
+
ae as handleStackedCellTabNavigation,
|
|
168
|
+
le as handleStackedKeyboardNavigation,
|
|
169
|
+
He as isExpanded,
|
|
170
|
+
De as isInNonSelectable,
|
|
171
|
+
Po as isRtl,
|
|
172
|
+
eo as itemToString,
|
|
173
|
+
Vo as mapColumns,
|
|
168
174
|
N as modifySubItems,
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
175
|
+
c as moveTreeItem,
|
|
176
|
+
ho as nextColumn,
|
|
177
|
+
Lo as normalize,
|
|
178
|
+
S as orderBy,
|
|
179
|
+
oo as populateClipboardData,
|
|
180
|
+
Yo as readColumns,
|
|
181
|
+
Ne as relativeContextElement,
|
|
176
182
|
b as removeItems,
|
|
177
|
-
|
|
183
|
+
pt as selectors,
|
|
178
184
|
R as setExpandedState,
|
|
179
185
|
B as setGroupIds,
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
ce as setSelectedState,
|
|
187
|
+
me as stackedKeyboardNavigationTools,
|
|
188
|
+
ft as stringOperator,
|
|
189
|
+
Wo as tableColumnsVirtualization,
|
|
190
|
+
j as tableKeyboardNavigation,
|
|
191
|
+
k as tableKeyboardNavigationBodyAttributes,
|
|
192
|
+
X as tableKeyboardNavigationHeaderAttributes,
|
|
193
|
+
w as tableKeyboardNavigationScopeAttributes,
|
|
187
194
|
$ as tableKeyboardNavigationTools,
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
195
|
+
I as treeToFlat,
|
|
196
|
+
Ct as unaryOperator,
|
|
197
|
+
Ho as updateLeft,
|
|
198
|
+
Uo as updateRight,
|
|
199
|
+
ro as useDataSource,
|
|
200
|
+
no as useODataDataSource,
|
|
201
|
+
lo as useRemoteDataSource,
|
|
202
|
+
y as useTableKeyboardNavigation
|
|
196
203
|
};
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
9
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@progress/kendo-react-common"),t=require("./utils.js"),p=require("./NavigatableSettings.js"),S=e=>{const{navigatable:r,contextStateRef:n,navigationStateRef:i,idPrefix:s}=e;r&&(n.current={activeId:"",level:0},i.current={activeElementIsFocused:!1,prevNavigationIndexes:void 0,idPrefix:s||l.guid(),navigationMatrix:[],lastHeaderIndex:-1})},B=e=>{const{scope:r,contextStateRef:n,navigationStateRef:i}=e;if(n.current&&i.current&&r){R(e);const s=t.getFirstDataCell(i.current.navigationMatrix);if(s){const g=t.tableKeyboardNavigationTools.getActiveNavDataElement(r,s);g&&(n.current.activeId=s,g.setAttribute("tabIndex","0"))}}},L=e=>{const{contextStateRef:r,navigationStateRef:n,document:i}=e;if(r.current&&n.current&&i){const s=l.getActiveElement(i),g=t.tableKeyboardNavigationTools.getNavigatableId(s);g&&g===r.current.activeId&&(n.current.activeElementIsFocused=!0)}},P=e=>{const{scope:r,contextStateRef:n,navigationStateRef:i,focusFirst:s,newEditableRow:g,singleEditRow:c,lastActiveElement:u,navigatable:a}=e;if(s&&(S(e),B(e),t.focusFirstDataElement(e)),(!a||a&&a.mode===p.NavigatableMode.inline)&&(g&&!c||g&&c&&!u)?t.focusFirstEditor(g):a&&a.mode===p.NavigatableMode.inline&&g&&c&&u&&u.focus(),R(e),n.current&&i.current&&r){if(!t.tableKeyboardNavigationTools.getActiveNavDataElement(r,n.current.activeId)){const y=r.className.indexOf("k-treelist")===-1?t.getFirstDataCell(i.current.navigationMatrix):i.current.navigationMatrix[0][0],N=t.tableKeyboardNavigationTools.getActiveNavDataElement(r,y);y&&N&&(n.current.activeId=y,N.setAttribute("tabIndex","0"),i.current.activeElementIsFocused&&N.focus())}i.current.activeElementIsFocused=!1}},H=(e,r)=>{const{contextStateRef:n}=r;if(e.isDefaultPrevented()||!n.current)return;const i=e.target,s=t.tableKeyboardNavigationTools.getNavigatableId(i);if(s&&s!==n.current.activeId){const g=t.tableKeyboardNavigationTools.getClosestScope(i);if(!g)return;const c=t.tableKeyboardNavigationTools.getActiveNavDataElement(g,n.current.activeId);c&&!e.target.classList.contains("k-table-td")&&!e.target.classList.contains("k-detail-cell")&&c.setAttribute("tabIndex","-1"),i.setAttribute("tabIndex","0"),n.current.activeId=s}else if(i.closest(".k-filtercell")&&r.navigatable){const g=i.closest(".k-table-td");l.enableNavigatableContainer(g)}},q=async(e,r)=>{var x,D,w,F,h;const{contextStateRef:n,navigationStateRef:i,onNavigationAction:s,columns:g}=r;if(e.isDefaultPrevented()||!n.current||!i.current)return;let c;if(e.keyCode===l.Keys.esc&&!r.navigatable.mode){c=t.tableKeyboardNavigationTools.getClosestNavigatableElement(e.target),t.tableKeyboardNavigationTools.focusElement({elementForFocus:c,event:e,contextStateRef:n}),e.target.closest(".k-filtercell")&&c&&r.navigatable&&l.disableNavigatableContainer(c);return}const u=e.target,a=u.className.indexOf("k-checkbox")===-1?u:t.tableKeyboardNavigationTools.getClosestNavigatableElement(u),f=t.tableKeyboardNavigationTools.getNavigatableId(a)||((x=t.tableKeyboardNavigationTools.getParentCell(a))==null?void 0:x.getAttribute("data-keyboardnavid")),y=f==null?void 0:f.endsWith("column"),N=f==null?void 0:f.endsWith("column_filter"),k=t.tableKeyboardNavigationTools.getNavigatableLevel(a),C=t.tableKeyboardNavigationTools.getClosestScope(a),K=i.current.navigationMatrix,v=e.metaKey||e.ctrlKey,d=t.getCurrentIdIndexes(i,K,f),I=a.closest(".k-table-td"),E=(D=a.closest(".k-table-td"))==null?void 0:D.classList.contains("k-grid-edit-cell");if(r.navigatable&&r.navigatable.mode===p.NavigatableMode.inline){if(e.keyCode===l.Keys.enter){const o=a.classList.contains("k-grid-remove-command"),b=a.classList.contains("k-grid-cancel-command"),m=t.tableKeyboardNavigationTools.getRowAriaRowIndex(a);if(o){setTimeout(()=>{const T=t.tableKeyboardNavigationTools.getRemoveButtonByAriaRowIndex(m.current)||t.tableKeyboardNavigationTools.getRemoveButtonByAriaRowIndex(m.prev);T&&T.focus()});return}else if(b&&a.parentElement){const T=(w=t.tableKeyboardNavigationTools.getClosestNavigatableElement(a))==null?void 0:w.getAttribute("data-keyboardnavid");setTimeout(()=>{T&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(T).focus()});return}}if(e.keyCode===l.Keys.esc){const o=t.tableKeyboardNavigationTools.getClosestCancelButton(a);o&&o.click();const b=await t.tableKeyboardNavigationTools.getClosestEditButton(a);b&&b.focus();return}}else if(r.navigatable&&r.navigatable.mode===p.NavigatableMode.incell){if(e.keyCode===l.Keys.esc){a.focus(),a.blur();const o=((F=u==null?void 0:u.parentElement)==null?void 0:F.closest(".k-grid-edit-row"))||null,b=t.tableKeyboardNavigationTools.getClosestCellNavId(a),m=await t.tableKeyboardNavigationTools.waitForElementToBeVisible(`[data-keyboardnavid='${b}']:not(.k-grid-edit-cell)`,o);m&&m.focus()}else if(e.keyCode===l.Keys.enter){let o;if(d){const[b,m]=d;o=t.findNextIdByRowIndex(b,m,f,K,!1)}if(!E)(h=t.tableKeyboardNavigationTools.getParentCell(a))==null||h.click();else if(E&&o){const b=o&&o[0]&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(o[0]);b&&b.click()}}else if(e.keyCode===l.Keys.left||e.keyCode===l.Keys.right||e.keyCode===l.Keys.up||e.keyCode===l.Keys.down){if(E)return}else if(e.key==="Tab"&&E){if(e.shiftKey){const o=d&&g&&t.tableKeyboardNavigationTools.getPrevEditableCell(d,g,f,K);if(o&&o.prevCell&&o.prevCell.click(),o&&o.elementToFocus!=="gridcell"){a.blur();const b=t.tableKeyboardNavigationTools.getClosestCellNavId(a);setTimeout(()=>{b&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(b).focus()})}e.preventDefault()}else{const o=d&&g&&t.tableKeyboardNavigationTools.getNextEditableCell(d,g,f,K);if(o&&o.nextCell&&o.elementToFocus==="gridcell"&&o.nextCell.click(),o&&o.elementToFocus!=="gridcell"){a.blur();const b=t.tableKeyboardNavigationTools.getClosestCellNavId(a);b&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(b).focus();return}e.preventDefault()}e.preventDefault()}}if(a.closest(".k-filtercell")&&I&&r.navigatable){l.keepFocusInContainer(e,I,l.TABBABLE_ELEMENTS);return}if(k!==void 0&&C){if(e.keyCode===l.Keys.enter){const o=t.tableKeyboardNavigationTools.getNavigatableElement(a,{level:k+1});if(o){t.tableKeyboardNavigationTools.focusElement({elementForFocus:o,event:e,contextStateRef:n,prevElement:a});return}a.querySelector(".k-filtercell")&&r.navigatable&&l.enableNavigatableContainer(a),c=t.tableKeyboardNavigationTools.getFocusableElements(a)[0],t.tableKeyboardNavigationTools.focusElement({elementForFocus:c,event:e,contextStateRef:n,prevElement:a})}if(e.keyCode===l.Keys.home&&d)if(v)t.focusFirstDataElement({scope:C,navigationStateRef:i,contextStateRef:n},e);else{const o=t.getFirstRowDataCell(i.current.navigationMatrix,d[0]);c=t.tableKeyboardNavigationTools.getActiveNavDataElement(C,o),t.tableKeyboardNavigationTools.focusElement({elementForFocus:c,event:e,contextStateRef:n})}if(e.keyCode===l.Keys.end&&d)if(v){const o=t.getLastDataCell(i.current.navigationMatrix);c=t.tableKeyboardNavigationTools.getActiveNavDataElement(C,o),t.tableKeyboardNavigationTools.focusElement({elementForFocus:c,event:e,contextStateRef:n})}else{const o=t.getLastRowDataCell(i.current.navigationMatrix,d[0]);c=t.tableKeyboardNavigationTools.getActiveNavDataElement(C,o),t.tableKeyboardNavigationTools.focusElement({elementForFocus:c,event:e,contextStateRef:n})}if(e.keyCode===l.Keys.up||e.keyCode===l.Keys.down||e.keyCode===l.Keys.left||e.keyCode===l.Keys.right){const o=e.keyCode===l.Keys.up||e.keyCode===l.Keys.left,b=e.keyCode===l.Keys.up||e.keyCode===l.Keys.down;if(d){const[m,T]=d,[A,M]=b?t.findNextIdByRowIndex(m,T,f,K,o):t.findNextIdByCellIndex(m,T,f,K,o);A&&(c=t.tableKeyboardNavigationTools.getActiveNavDataElement(C,A),t.tableKeyboardNavigationTools.focusElement({elementForFocus:c,event:e,contextStateRef:n,prevElement:a}),i.current.prevNavigationIndexes=M)}}if(v&&e.keyCode===l.Keys.left&&y){s&&s({focusElement:a,event:e,action:"reorderToLeft"}),e.preventDefault();return}if(v&&e.keyCode===l.Keys.right&&y){s&&s({focusElement:a,event:e,action:"reorderToRight"}),e.preventDefault();return}if(e.keyCode===l.Keys.pageUp){s&&s({focusElement:c,event:e,action:"moveToNextPage"}),e.preventDefault();return}if(e.keyCode===l.Keys.pageDown){s&&s({focusElement:c,event:e,action:"moveToPrevPage"}),e.preventDefault();return}if(!y&&!N&&!E&&(e.keyCode===l.Keys.space||e.keyCode===l.Keys.enter||e.shiftKey&&(e.keyCode===l.Keys.up||e.keyCode===l.Keys.down||e.keyCode===l.Keys.left||e.keyCode===l.Keys.right))){s&&s({focusElement:c,event:e,action:"select"});return}s&&s({focusElement:c,event:e})}},R=e=>{const{navigationStateRef:r,scope:n}=e;if(!r.current||!n)return;const i=[],s=t.getHeaderElement(n),g=t.getBodyElement(n),c=t.getNoRecordsElement(n)||{children:[]};if(!s||!g)return;const u=Array.from(s.children),a=Array.from(g.children);[...u,...a,c].forEach((f,y)=>{Array.from(f.children).forEach(N=>{const k=t.getNavigatableId(N);if(!k)return;const C=N.rowSpan||1,K=N.colSpan||1;let v;for(let d=y,I=y+C;d<I;d++){if(i[d]||(i[d]=[]),v===void 0){const E=i[d].findIndex(x=>!x);v=E>-1?E:i[d].length}i[d][v]=k||""}for(let d=v+1,I=v+K;d<I;d++)i[y][d]=k||""})}),r.current.navigationMatrix=i.filter(f=>!!f),r.current.lastHeaderIndex=u.length-1},O={onConstructor:S,onComponentDidMount:B,onGetSnapshotBeforeUpdate:L,onComponentDidUpdate:P,onFocus:H,onKeyDown:q,generateMatrix:R,focusFirstDataElement:t.focusFirstDataElement};exports.tableKeyboardNavigation=O;
|
|
@@ -50,8 +50,8 @@ const P = (e) => {
|
|
|
50
50
|
} = e;
|
|
51
51
|
if (c && (P(e), H(e), w(e)), (!a || a && a.mode === D.inline) && (f && !s || f && s && !m) ? G(f) : a && a.mode === D.inline && f && s && m && m.focus(), h(e), l.current && n.current && r) {
|
|
52
52
|
if (!t.getActiveNavDataElement(r, l.current.activeId)) {
|
|
53
|
-
const C = r.className.indexOf("k-treelist") === -1 ? L(n.current.navigationMatrix) : n.current.navigationMatrix[0][0],
|
|
54
|
-
C &&
|
|
53
|
+
const C = r.className.indexOf("k-treelist") === -1 ? L(n.current.navigationMatrix) : n.current.navigationMatrix[0][0], v = t.getActiveNavDataElement(r, C);
|
|
54
|
+
C && v && (l.current.activeId = C, v.setAttribute("tabIndex", "0"), n.current.activeElementIsFocused && v.focus());
|
|
55
55
|
}
|
|
56
56
|
n.current.activeElementIsFocused = !1;
|
|
57
57
|
}
|
|
@@ -80,13 +80,13 @@ const P = (e) => {
|
|
|
80
80
|
s = t.getClosestNavigatableElement(e.target), t.focusElement({ elementForFocus: s, event: e, contextStateRef: l }), e.target.closest(".k-filtercell") && s && r.navigatable && W(s);
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
const m = e.target, a = m.className.indexOf("k-checkbox") === -1 ? m : t.getClosestNavigatableElement(m), g = t.getNavigatableId(a) || ((R = t.getParentCell(a)) == null ? void 0 : R.getAttribute("data-keyboardnavid")), C = g == null ? void 0 : g.endsWith("column"),
|
|
83
|
+
const m = e.target, a = m.className.indexOf("k-checkbox") === -1 ? m : t.getClosestNavigatableElement(m), g = t.getNavigatableId(a) || ((R = t.getParentCell(a)) == null ? void 0 : R.getAttribute("data-keyboardnavid")), C = g == null ? void 0 : g.endsWith("column"), v = g == null ? void 0 : g.endsWith("column_filter"), p = t.getNavigatableLevel(a), y = t.getClosestScope(a), k = n.current.navigationMatrix, b = e.metaKey || e.ctrlKey, d = $(n, k, g), N = a.closest(".k-table-td"), I = (A = a.closest(".k-table-td")) == null ? void 0 : A.classList.contains("k-grid-edit-cell");
|
|
84
84
|
if (r.navigatable && r.navigatable.mode === D.inline) {
|
|
85
85
|
if (e.keyCode === i.enter) {
|
|
86
|
-
const o = a.classList.contains("k-grid-remove-command"), u = a.classList.contains("k-grid-cancel-command"),
|
|
86
|
+
const o = a.classList.contains("k-grid-remove-command"), u = a.classList.contains("k-grid-cancel-command"), E = t.getRowAriaRowIndex(a);
|
|
87
87
|
if (o) {
|
|
88
88
|
setTimeout(() => {
|
|
89
|
-
const x = t.getRemoveButtonByAriaRowIndex(
|
|
89
|
+
const x = t.getRemoveButtonByAriaRowIndex(E.current) || t.getRemoveButtonByAriaRowIndex(E.prev);
|
|
90
90
|
x && x.focus();
|
|
91
91
|
});
|
|
92
92
|
return;
|
|
@@ -108,38 +108,29 @@ const P = (e) => {
|
|
|
108
108
|
} else if (r.navigatable && r.navigatable.mode === D.incell) {
|
|
109
109
|
if (e.keyCode === i.esc) {
|
|
110
110
|
a.focus(), a.blur();
|
|
111
|
-
const o = ((F = m == null ? void 0 : m.parentElement) == null ? void 0 : F.closest(".k-grid-edit-row")) || null, u = t.getClosestCellNavId(a),
|
|
111
|
+
const o = ((F = m == null ? void 0 : m.parentElement) == null ? void 0 : F.closest(".k-grid-edit-row")) || null, u = t.getClosestCellNavId(a), E = await t.waitForElementToBeVisible(
|
|
112
112
|
`[data-keyboardnavid='${u}']:not(.k-grid-edit-cell)`,
|
|
113
113
|
o
|
|
114
114
|
);
|
|
115
|
-
|
|
115
|
+
E && E.focus();
|
|
116
116
|
} else if (e.keyCode === i.enter) {
|
|
117
117
|
let o;
|
|
118
118
|
if (d) {
|
|
119
|
-
const [u,
|
|
120
|
-
o = M(u,
|
|
119
|
+
const [u, E] = d;
|
|
120
|
+
o = M(u, E, g, k, !1);
|
|
121
121
|
}
|
|
122
|
-
if (!
|
|
122
|
+
if (!I)
|
|
123
123
|
(S = t.getParentCell(a)) == null || S.click();
|
|
124
|
-
else if (
|
|
124
|
+
else if (I && o) {
|
|
125
125
|
const u = o && o[0] && t.getTableCellByKeyboardNavId(o[0]);
|
|
126
126
|
u && u.click();
|
|
127
127
|
}
|
|
128
|
-
} else if (e.keyCode === i.left) {
|
|
129
|
-
if (
|
|
130
|
-
return;
|
|
131
|
-
} else if (e.keyCode === i.right) {
|
|
132
|
-
if (b)
|
|
133
|
-
return;
|
|
134
|
-
} else if (e.keyCode === i.up) {
|
|
135
|
-
if (b)
|
|
136
|
-
return;
|
|
137
|
-
} else if (e.keyCode === i.down) {
|
|
138
|
-
if (b)
|
|
128
|
+
} else if (e.keyCode === i.left || e.keyCode === i.right || e.keyCode === i.up || e.keyCode === i.down) {
|
|
129
|
+
if (I)
|
|
139
130
|
return;
|
|
140
|
-
} else if (e.
|
|
131
|
+
} else if (e.key === "Tab" && I) {
|
|
141
132
|
if (e.shiftKey) {
|
|
142
|
-
const o = d && f && t.getPrevEditableCell(d, f, g,
|
|
133
|
+
const o = d && f && t.getPrevEditableCell(d, f, g, k);
|
|
143
134
|
if (o && o.prevCell && o.prevCell.click(), o && o.elementToFocus !== "gridcell") {
|
|
144
135
|
a.blur();
|
|
145
136
|
const u = t.getClosestCellNavId(a);
|
|
@@ -149,7 +140,7 @@ const P = (e) => {
|
|
|
149
140
|
}
|
|
150
141
|
e.preventDefault();
|
|
151
142
|
} else {
|
|
152
|
-
const o = d && f && t.getNextEditableCell(d, f, g,
|
|
143
|
+
const o = d && f && t.getNextEditableCell(d, f, g, k);
|
|
153
144
|
if (o && o.nextCell && o.elementToFocus === "gridcell" && o.nextCell.click(), o && o.elementToFocus !== "gridcell") {
|
|
154
145
|
a.blur();
|
|
155
146
|
const u = t.getClosestCellNavId(a);
|
|
@@ -165,7 +156,7 @@ const P = (e) => {
|
|
|
165
156
|
_(e, N, q);
|
|
166
157
|
return;
|
|
167
158
|
}
|
|
168
|
-
if (p !== void 0 &&
|
|
159
|
+
if (p !== void 0 && y) {
|
|
169
160
|
if (e.keyCode === i.enter) {
|
|
170
161
|
const o = t.getNavigatableElement(a, { level: p + 1 });
|
|
171
162
|
if (o) {
|
|
@@ -180,10 +171,10 @@ const P = (e) => {
|
|
|
180
171
|
a.querySelector(".k-filtercell") && r.navigatable && K(a), s = t.getFocusableElements(a)[0], t.focusElement({ elementForFocus: s, event: e, contextStateRef: l, prevElement: a });
|
|
181
172
|
}
|
|
182
173
|
if (e.keyCode === i.home && d)
|
|
183
|
-
if (
|
|
174
|
+
if (b)
|
|
184
175
|
w(
|
|
185
176
|
{
|
|
186
|
-
scope:
|
|
177
|
+
scope: y,
|
|
187
178
|
navigationStateRef: n,
|
|
188
179
|
contextStateRef: l
|
|
189
180
|
},
|
|
@@ -194,31 +185,31 @@ const P = (e) => {
|
|
|
194
185
|
n.current.navigationMatrix,
|
|
195
186
|
d[0]
|
|
196
187
|
);
|
|
197
|
-
s = t.getActiveNavDataElement(
|
|
188
|
+
s = t.getActiveNavDataElement(y, o), t.focusElement({ elementForFocus: s, event: e, contextStateRef: l });
|
|
198
189
|
}
|
|
199
190
|
if (e.keyCode === i.end && d)
|
|
200
|
-
if (
|
|
191
|
+
if (b) {
|
|
201
192
|
const o = J(n.current.navigationMatrix);
|
|
202
|
-
s = t.getActiveNavDataElement(
|
|
193
|
+
s = t.getActiveNavDataElement(y, o), t.focusElement({ elementForFocus: s, event: e, contextStateRef: l });
|
|
203
194
|
} else {
|
|
204
195
|
const o = z(
|
|
205
196
|
n.current.navigationMatrix,
|
|
206
197
|
d[0]
|
|
207
198
|
);
|
|
208
|
-
s = t.getActiveNavDataElement(
|
|
199
|
+
s = t.getActiveNavDataElement(y, o), t.focusElement({ elementForFocus: s, event: e, contextStateRef: l });
|
|
209
200
|
}
|
|
210
201
|
if (e.keyCode === i.up || e.keyCode === i.down || e.keyCode === i.left || e.keyCode === i.right) {
|
|
211
202
|
const o = e.keyCode === i.up || e.keyCode === i.left, u = e.keyCode === i.up || e.keyCode === i.down;
|
|
212
203
|
if (d) {
|
|
213
|
-
const [
|
|
214
|
-
T && (s = t.getActiveNavDataElement(
|
|
204
|
+
const [E, x] = d, [T, O] = u ? M(E, x, g, k, o) : ee(E, x, g, k, o);
|
|
205
|
+
T && (s = t.getActiveNavDataElement(y, T), t.focusElement({ elementForFocus: s, event: e, contextStateRef: l, prevElement: a }), n.current.prevNavigationIndexes = O);
|
|
215
206
|
}
|
|
216
207
|
}
|
|
217
|
-
if (
|
|
208
|
+
if (b && e.keyCode === i.left && C) {
|
|
218
209
|
c && c({ focusElement: a, event: e, action: "reorderToLeft" }), e.preventDefault();
|
|
219
210
|
return;
|
|
220
211
|
}
|
|
221
|
-
if (
|
|
212
|
+
if (b && e.keyCode === i.right && C) {
|
|
222
213
|
c && c({ focusElement: a, event: e, action: "reorderToRight" }), e.preventDefault();
|
|
223
214
|
return;
|
|
224
215
|
}
|
|
@@ -230,7 +221,7 @@ const P = (e) => {
|
|
|
230
221
|
c && c({ focusElement: s, event: e, action: "moveToPrevPage" }), e.preventDefault();
|
|
231
222
|
return;
|
|
232
223
|
}
|
|
233
|
-
if (!C && !
|
|
224
|
+
if (!C && !v && !I && (e.keyCode === i.space || e.keyCode === i.enter || e.shiftKey && (e.keyCode === i.up || e.keyCode === i.down || e.keyCode === i.left || e.keyCode === i.right))) {
|
|
234
225
|
c && c({ focusElement: s, event: e, action: "select" });
|
|
235
226
|
return;
|
|
236
227
|
}
|
|
@@ -245,20 +236,20 @@ const P = (e) => {
|
|
|
245
236
|
return;
|
|
246
237
|
const m = Array.from(c.children), a = Array.from(f.children);
|
|
247
238
|
[...m, ...a, s].forEach((g, C) => {
|
|
248
|
-
Array.from(g.children).forEach((
|
|
249
|
-
const p = Z(
|
|
239
|
+
Array.from(g.children).forEach((v) => {
|
|
240
|
+
const p = Z(v);
|
|
250
241
|
if (!p)
|
|
251
242
|
return;
|
|
252
|
-
const
|
|
253
|
-
let
|
|
254
|
-
for (let d = C, N = C +
|
|
255
|
-
if (n[d] || (n[d] = []),
|
|
256
|
-
const
|
|
257
|
-
|
|
243
|
+
const y = v.rowSpan || 1, k = v.colSpan || 1;
|
|
244
|
+
let b;
|
|
245
|
+
for (let d = C, N = C + y; d < N; d++) {
|
|
246
|
+
if (n[d] || (n[d] = []), b === void 0) {
|
|
247
|
+
const I = n[d].findIndex((R) => !R);
|
|
248
|
+
b = I > -1 ? I : n[d].length;
|
|
258
249
|
}
|
|
259
|
-
n[d][
|
|
250
|
+
n[d][b] = p || "";
|
|
260
251
|
}
|
|
261
|
-
for (let d =
|
|
252
|
+
for (let d = b + 1, N = b + k; d < N; d++)
|
|
262
253
|
n[C][d] = p || "";
|
|
263
254
|
});
|
|
264
255
|
}), r.current.navigationMatrix = n.filter((g) => !!g), r.current.lastHeaderIndex = m.length - 1;
|