@progress/kendo-react-data-tools 7.3.0-develop.4 → 7.4.0-develop.1

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/index.mjs CHANGED
@@ -12,144 +12,142 @@ import { ColumnResizer as a } from "./drag/ColumnResizer.mjs";
12
12
  import { CommonDragLogic as p } from "./drag/CommonDragLogic.mjs";
13
13
  import { DragClue as x } from "./drag/DragClue.mjs";
14
14
  import { DropClue as f } from "./drag/DropClue.mjs";
15
- import { createDataTree as E, extendDataItem as A, filterBy as T, flatData as _, getItemPath as d, modifySubItems as D, moveTreeItem as s, orderBy as F, removeItems as N, treeToFlat as g } from "./utils/data-operations.mjs";
16
- import { getGroupIds as b, setExpandedState as O, setGroupIds as R } from "./utils/group-operations.mjs";
17
- import { useTableKeyboardNavigation as I } from "./navigation/hooks.mjs";
18
- import { FOCUSABLE_ELEMENTS as L, KEYBOARD_NAV_DATA_BODY as M, KEYBOARD_NAV_DATA_HEADER as K, KEYBOARD_NAV_DATA_ID as y, KEYBOARD_NAV_DATA_LEVEL as v, KEYBOARD_NAV_DATA_SCOPE as V, KEYBOARD_NAV_DATA_ZONE as Y, KEYBOARD_NAV_FILTER_COL_SUFFIX as H, TABBABLE_ELEMENTS as P, tableKeyboardNavigationBodyAttributes as w, tableKeyboardNavigationHeaderAttributes as z, tableKeyboardNavigationScopeAttributes as U } from "./navigation/constants.mjs";
19
- import { tableKeyboardNavigation as G } from "./navigation/TableKeyboardNavigation.mjs";
20
- import { TableKeyboardNavigationContext as W } from "./navigation/TableKeyboardNavigationContext.mjs";
21
- import { tableKeyboardNavigationTools as j } from "./navigation/utils.mjs";
22
- import { TableSelection as q } from "./selection/TableSelection.mjs";
23
- import { TABLE_COL_INDEX_ATTRIBUTE as Q, TABLE_PREVENT_SELECTION_ELEMENT as $, TABLE_ROW_INDEX_ATTRIBUTE as ee } from "./selection/constants.mjs";
24
- import { closestTagName as re, getColumnIndex as te, getOffset as me, getRowIndex as le, getSelectedState as ae, getSelectedStateFromKeyDown as ne, getSelectionOptions as pe, relativeContextElement as ie, setSelectedState as xe } from "./selection/utils.mjs";
25
- import { ClipboardService as fe } from "./clipboard/clipboard.service.mjs";
26
- import { ClipboardActionType as Ee, populateClipboardData as Ae } from "./clipboard/common.mjs";
27
- import { createFilterComponent as _e } from "./filteringCells/FilterComponent.mjs";
28
- import { BooleanFilterCell as De } from "./filteringCells/BooleanFilter.mjs";
29
- import { DateFilterCell as Fe } from "./filteringCells/DateFilter.mjs";
30
- import { NumericFilterCell as ge } from "./filteringCells/NumericFilter.mjs";
31
- import { TextFilterCell as be } from "./filteringCells/TextFilter.mjs";
15
+ import { createDataTree as A, extendDataItem as E, filterBy as T, flatData as d, getItemPath as _, modifySubItems as D, moveTreeItem as s, orderBy as F, removeItems as N, treeToFlat as g } from "./utils/data-operations.mjs";
16
+ import { getGroupIds as R, setExpandedState as O, setGroupIds as B } from "./utils/group-operations.mjs";
17
+ import { useTableKeyboardNavigation as c } from "./navigation/hooks.mjs";
18
+ import { KEYBOARD_NAV_DATA_BODY as K, KEYBOARD_NAV_DATA_HEADER as L, KEYBOARD_NAV_DATA_ID as y, KEYBOARD_NAV_DATA_LEVEL as M, KEYBOARD_NAV_DATA_SCOPE as v, KEYBOARD_NAV_DATA_ZONE as V, KEYBOARD_NAV_FILTER_COL_SUFFIX as Y, tableKeyboardNavigationBodyAttributes as H, tableKeyboardNavigationHeaderAttributes as P, tableKeyboardNavigationScopeAttributes as w } from "./navigation/constants.mjs";
19
+ import { tableKeyboardNavigation as h } from "./navigation/TableKeyboardNavigation.mjs";
20
+ import { TableKeyboardNavigationContext as U } from "./navigation/TableKeyboardNavigationContext.mjs";
21
+ import { tableKeyboardNavigationTools as W } from "./navigation/utils.mjs";
22
+ import { TableSelection as j } from "./selection/TableSelection.mjs";
23
+ import { TABLE_COL_INDEX_ATTRIBUTE as q, TABLE_PREVENT_SELECTION_ELEMENT as J, TABLE_ROW_INDEX_ATTRIBUTE as Q } from "./selection/constants.mjs";
24
+ import { closestTagName as ee, getColumnIndex as oe, getOffset as re, getRowIndex as te, getSelectedState as me, getSelectedStateFromKeyDown as le, getSelectionOptions as ae, relativeContextElement as ne, setSelectedState as pe } from "./selection/utils.mjs";
25
+ import { ClipboardService as xe } from "./clipboard/clipboard.service.mjs";
26
+ import { ClipboardActionType as fe, populateClipboardData as Ce } from "./clipboard/common.mjs";
27
+ import { createFilterComponent as Ee } from "./filteringCells/FilterComponent.mjs";
28
+ import { BooleanFilterCell as de } from "./filteringCells/BooleanFilter.mjs";
29
+ import { DateFilterCell as De } from "./filteringCells/DateFilter.mjs";
30
+ import { NumericFilterCell as Fe } from "./filteringCells/NumericFilter.mjs";
31
+ import { TextFilterCell as ge } from "./filteringCells/TextFilter.mjs";
32
32
  import { ColumnDefaultProps as Re } from "./header/ColumnProps.mjs";
33
- import { FILTER_ROW_CLASS as Ie, FilterRow as ce } from "./header/FilterRow.mjs";
34
- import { Header as Me } from "./header/Header.mjs";
35
- import { HeaderCell as ye } from "./header/HeaderCell.mjs";
36
- import { HeaderRow as Ve } from "./header/HeaderRow.mjs";
37
- import { HeaderSelectionCell as He } from "./header/HeaderSelectionCell.mjs";
38
- import { normalize as we } from "./header/SortSettings.mjs";
39
- import { getIndex as Ue, isRtl as he, mapColumns as Ge, nextColumn as Xe, readColumns as We, updateLeft as Ze, updateRight as je } from "./header/utils/index.mjs";
40
- import { HeaderThElement as qe } from "./header/HeaderThElement.mjs";
41
- import { tableColumnsVirtualization as Qe } from "./virtualization/columns.mjs";
42
- import { TextFilter as eo } from "./filter/filters/TextFilter.mjs";
43
- import { NumericFilter as ro } from "./filter/filters/NumericFilter.mjs";
44
- import { DateFilter as mo } from "./filter/filters/DateFilter.mjs";
45
- import { BooleanFilter as ao } from "./filter/filters/BooleanFilter.mjs";
46
- import { EnumFilter as po } from "./filter/filters/EnumFilter.mjs";
47
- import { Expression as xo } from "./filter/Expression.mjs";
48
- import { Filter as fo } from "./filter/Filter.mjs";
49
- import { Group as Eo } from "./filter/Group.mjs";
50
- import { Operators as To, stringOperator as _o, unaryOperator as Do } from "./filter/operators.mjs";
51
- import { ColumnMenuBooleanColumn as Fo, ColumnMenuDateColumn as No, ColumnMenuNumericColumn as go, ColumnMenuTextColumn as Bo } from "./columnmenu/ColumnMenu.mjs";
52
- import { ColumnMenuFilterForm as Oo, ColumnMenuForm as Ro } from "./columnmenu/ColumnMenuFilterForm.mjs";
53
- import { ColumnMenuFilterLogic as Io } from "./columnmenu/ColumnMenuFilterLogic.mjs";
54
- import { ColumnMenuBooleanFilter as Lo, ColumnMenuDateFilter as Mo, ColumnMenuNumericFilter as Ko, ColumnMenuTextFilter as yo } from "./columnmenu/ColumnMenuFilters.mjs";
55
- import { ColumnMenuItem as Vo } from "./columnmenu/ColumnMenuItem.mjs";
56
- import { ColumnMenuOperators as Ho } from "./columnmenu/ColumnMenuOperators.mjs";
33
+ import { FILTER_ROW_CLASS as Be, FilterRow as Ie } from "./header/FilterRow.mjs";
34
+ import { Header as Se } from "./header/Header.mjs";
35
+ import { HeaderCell as Le } from "./header/HeaderCell.mjs";
36
+ import { HeaderRow as Me } from "./header/HeaderRow.mjs";
37
+ import { HeaderSelectionCell as Ve } from "./header/HeaderSelectionCell.mjs";
38
+ import { normalize as He } from "./header/SortSettings.mjs";
39
+ import { getIndex as we, isRtl as ze, mapColumns as he, nextColumn as Ge, readColumns as Ue, updateLeft as Xe, updateRight as We } from "./header/utils/index.mjs";
40
+ import { HeaderThElement as je } from "./header/HeaderThElement.mjs";
41
+ import { tableColumnsVirtualization as qe } from "./virtualization/columns.mjs";
42
+ import { TextFilter as Qe } from "./filter/filters/TextFilter.mjs";
43
+ import { NumericFilter as eo } from "./filter/filters/NumericFilter.mjs";
44
+ import { DateFilter as ro } from "./filter/filters/DateFilter.mjs";
45
+ import { BooleanFilter as mo } from "./filter/filters/BooleanFilter.mjs";
46
+ import { EnumFilter as ao } from "./filter/filters/EnumFilter.mjs";
47
+ import { Expression as po } from "./filter/Expression.mjs";
48
+ import { Filter as xo } from "./filter/Filter.mjs";
49
+ import { Group as fo } from "./filter/Group.mjs";
50
+ import { Operators as Ao, stringOperator as Eo, unaryOperator as To } from "./filter/operators.mjs";
51
+ import { ColumnMenuBooleanColumn as Do, ColumnMenuDateColumn as so, ColumnMenuNumericColumn as Fo, ColumnMenuTextColumn as No } from "./columnmenu/ColumnMenu.mjs";
52
+ import { ColumnMenuFilterForm as bo, ColumnMenuForm as Ro } from "./columnmenu/ColumnMenuFilterForm.mjs";
53
+ import { ColumnMenuFilterLogic as Bo } from "./columnmenu/ColumnMenuFilterLogic.mjs";
54
+ import { ColumnMenuBooleanFilter as co, ColumnMenuDateFilter as So, ColumnMenuNumericFilter as Ko, ColumnMenuTextFilter as Lo } from "./columnmenu/ColumnMenuFilters.mjs";
55
+ import { ColumnMenuItem as Mo } from "./columnmenu/ColumnMenuItem.mjs";
56
+ import { ColumnMenuOperators as Vo } from "./columnmenu/ColumnMenuOperators.mjs";
57
57
  export {
58
- ao as BooleanFilter,
59
- De as BooleanFilterCell,
60
- Ee as ClipboardActionType,
61
- fe as ClipboardService,
58
+ mo as BooleanFilter,
59
+ de as BooleanFilterCell,
60
+ fe as ClipboardActionType,
61
+ xe as ClipboardService,
62
62
  Re as ColumnDefaultProps,
63
- Fo as ColumnMenuBooleanColumn,
64
- Lo as ColumnMenuBooleanFilter,
65
- No as ColumnMenuDateColumn,
66
- Mo as ColumnMenuDateFilter,
67
- Oo as ColumnMenuFilterForm,
68
- Io as ColumnMenuFilterLogic,
63
+ Do as ColumnMenuBooleanColumn,
64
+ co as ColumnMenuBooleanFilter,
65
+ so as ColumnMenuDateColumn,
66
+ So as ColumnMenuDateFilter,
67
+ bo as ColumnMenuFilterForm,
68
+ Bo as ColumnMenuFilterLogic,
69
69
  Ro as ColumnMenuForm,
70
- Vo as ColumnMenuItem,
71
- go as ColumnMenuNumericColumn,
70
+ Mo as ColumnMenuItem,
71
+ Fo as ColumnMenuNumericColumn,
72
72
  Ko as ColumnMenuNumericFilter,
73
- Ho as ColumnMenuOperators,
74
- Bo as ColumnMenuTextColumn,
75
- yo as ColumnMenuTextFilter,
73
+ Vo as ColumnMenuOperators,
74
+ No as ColumnMenuTextColumn,
75
+ Lo as ColumnMenuTextFilter,
76
76
  m as ColumnResize,
77
77
  a as ColumnResizer,
78
78
  p as CommonDragLogic,
79
- mo as DateFilter,
80
- Fe as DateFilterCell,
79
+ ro as DateFilter,
80
+ De as DateFilterCell,
81
81
  x as DragClue,
82
82
  f as DropClue,
83
- po as EnumFilter,
84
- xo as Expression,
85
- Ie as FILTER_ROW_CLASS,
86
- L as FOCUSABLE_ELEMENTS,
87
- fo as Filter,
88
- ce as FilterRow,
89
- Eo as Group,
90
- Me as Header,
91
- ye as HeaderCell,
92
- Ve as HeaderRow,
93
- He as HeaderSelectionCell,
94
- qe as HeaderThElement,
95
- M as KEYBOARD_NAV_DATA_BODY,
96
- K as KEYBOARD_NAV_DATA_HEADER,
83
+ ao as EnumFilter,
84
+ po as Expression,
85
+ Be as FILTER_ROW_CLASS,
86
+ xo as Filter,
87
+ Ie as FilterRow,
88
+ fo as Group,
89
+ Se as Header,
90
+ Le as HeaderCell,
91
+ Me as HeaderRow,
92
+ Ve as HeaderSelectionCell,
93
+ je as HeaderThElement,
94
+ K as KEYBOARD_NAV_DATA_BODY,
95
+ L as KEYBOARD_NAV_DATA_HEADER,
97
96
  y as KEYBOARD_NAV_DATA_ID,
98
- v as KEYBOARD_NAV_DATA_LEVEL,
99
- V as KEYBOARD_NAV_DATA_SCOPE,
100
- Y as KEYBOARD_NAV_DATA_ZONE,
101
- H as KEYBOARD_NAV_FILTER_COL_SUFFIX,
102
- ro as NumericFilter,
103
- ge as NumericFilterCell,
104
- To as Operators,
97
+ M as KEYBOARD_NAV_DATA_LEVEL,
98
+ v as KEYBOARD_NAV_DATA_SCOPE,
99
+ V as KEYBOARD_NAV_DATA_ZONE,
100
+ Y as KEYBOARD_NAV_FILTER_COL_SUFFIX,
101
+ eo as NumericFilter,
102
+ Fe as NumericFilterCell,
103
+ Ao as Operators,
105
104
  r as Pager,
106
- P as TABBABLE_ELEMENTS,
107
- Q as TABLE_COL_INDEX_ATTRIBUTE,
108
- $ as TABLE_PREVENT_SELECTION_ELEMENT,
109
- ee as TABLE_ROW_INDEX_ATTRIBUTE,
110
- W as TableKeyboardNavigationContext,
111
- q as TableSelection,
112
- eo as TextFilter,
113
- be as TextFilterCell,
114
- re as closestTagName,
115
- E as createDataTree,
116
- _e as createFilterComponent,
117
- A as extendDataItem,
105
+ q as TABLE_COL_INDEX_ATTRIBUTE,
106
+ J as TABLE_PREVENT_SELECTION_ELEMENT,
107
+ Q as TABLE_ROW_INDEX_ATTRIBUTE,
108
+ U as TableKeyboardNavigationContext,
109
+ j as TableSelection,
110
+ Qe as TextFilter,
111
+ ge as TextFilterCell,
112
+ ee as closestTagName,
113
+ A as createDataTree,
114
+ Ee as createFilterComponent,
115
+ E as extendDataItem,
118
116
  T as filterBy,
119
- _ as flatData,
120
- te as getColumnIndex,
121
- b as getGroupIds,
122
- Ue as getIndex,
123
- d as getItemPath,
124
- me as getOffset,
125
- le as getRowIndex,
126
- ae as getSelectedState,
127
- ne as getSelectedStateFromKeyDown,
128
- pe as getSelectionOptions,
129
- he as isRtl,
130
- Ge as mapColumns,
117
+ d as flatData,
118
+ oe as getColumnIndex,
119
+ R as getGroupIds,
120
+ we as getIndex,
121
+ _ as getItemPath,
122
+ re as getOffset,
123
+ te as getRowIndex,
124
+ me as getSelectedState,
125
+ le as getSelectedStateFromKeyDown,
126
+ ae as getSelectionOptions,
127
+ ze as isRtl,
128
+ he as mapColumns,
131
129
  D as modifySubItems,
132
130
  s as moveTreeItem,
133
- Xe as nextColumn,
134
- we as normalize,
131
+ Ge as nextColumn,
132
+ He as normalize,
135
133
  F as orderBy,
136
- Ae as populateClipboardData,
137
- We as readColumns,
138
- ie as relativeContextElement,
134
+ Ce as populateClipboardData,
135
+ Ue as readColumns,
136
+ ne as relativeContextElement,
139
137
  N as removeItems,
140
138
  O as setExpandedState,
141
- R as setGroupIds,
142
- xe as setSelectedState,
143
- _o as stringOperator,
144
- Qe as tableColumnsVirtualization,
145
- G as tableKeyboardNavigation,
146
- w as tableKeyboardNavigationBodyAttributes,
147
- z as tableKeyboardNavigationHeaderAttributes,
148
- U as tableKeyboardNavigationScopeAttributes,
149
- j as tableKeyboardNavigationTools,
139
+ B as setGroupIds,
140
+ pe as setSelectedState,
141
+ Eo as stringOperator,
142
+ qe as tableColumnsVirtualization,
143
+ h as tableKeyboardNavigation,
144
+ H as tableKeyboardNavigationBodyAttributes,
145
+ P as tableKeyboardNavigationHeaderAttributes,
146
+ w as tableKeyboardNavigationScopeAttributes,
147
+ W as tableKeyboardNavigationTools,
150
148
  g as treeToFlat,
151
- Do as unaryOperator,
152
- Ze as updateLeft,
153
- je as updateRight,
154
- I as useTableKeyboardNavigation
149
+ To as unaryOperator,
150
+ Xe as updateLeft,
151
+ We as updateRight,
152
+ c as useTableKeyboardNavigation
155
153
  };
@@ -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 l=require("@progress/kendo-react-common"),n=require("./utils.js"),p=e=>{const{navigatable:r,contextStateRef:o,navigationStateRef:t,idPrefix:i}=e;r&&(o.current={activeId:"",level:0},t.current={activeElementIsFocused:!1,prevNavigationIndexes:void 0,idPrefix:i||l.guid(),navigationMatrix:[],lastHeaderIndex:-1})},K=e=>{const{scope:r,contextStateRef:o,navigationStateRef:t}=e;if(o.current&&t.current&&r){N(e);const i=t.current.navigationMatrix[0][0],a=n.tableKeyboardNavigationTools.getActiveElement(r,i);i&&a&&(o.current.activeId=i,a.setAttribute("tabIndex","0"))}},S=e=>{const{contextStateRef:r,navigationStateRef:o,document:t}=e;if(r.current&&o.current&&t){const i=l.getActiveElement(t),a=n.tableKeyboardNavigationTools.getNavigatableId(i);a&&a===r.current.activeId&&(o.current.activeElementIsFocused=!0)}},T=e=>{const{scope:r,contextStateRef:o,navigationStateRef:t}=e;if(N(e),o.current&&t.current&&r){if(!n.tableKeyboardNavigationTools.getActiveElement(r,o.current.activeId)){const a=t.current.navigationMatrix[0][0],c=n.tableKeyboardNavigationTools.getActiveElement(r,a);a&&c&&(o.current.activeId=a,c.setAttribute("tabIndex","0"),t.current.activeElementIsFocused&&c.focus())}t.current.activeElementIsFocused=!1}},C=(e,r)=>{const{contextStateRef:o}=r;if(e.isDefaultPrevented()||!o.current)return;const t=e.target,i=n.tableKeyboardNavigationTools.getNavigatableId(t);if(i&&i!==o.current.activeId){const a=n.tableKeyboardNavigationTools.getClosestScope(t);if(!a)return;const c=n.tableKeyboardNavigationTools.getActiveElement(a,o.current.activeId);c&&c.setAttribute("tabIndex","-1"),t.setAttribute("tabIndex","0"),o.current.activeId=i}},R=(e,r)=>{const{contextStateRef:o,navigationStateRef:t,onNavigationAction:i}=r;if(e.isDefaultPrevented()||!o.current||!t.current)return;if(e.keyCode===l.Keys.esc){const d=n.tableKeyboardNavigationTools.getClosestNavigatableElement(e.target);n.tableKeyboardNavigationTools.focusElement({elementForFocus:d,event:e,contextStateRef:o});return}const a=e.target,c=n.tableKeyboardNavigationTools.getNavigatableId(a),x=n.tableKeyboardNavigationTools.getNavigatableLevel(a),b=n.tableKeyboardNavigationTools.getClosestScope(a),f=t.current.navigationMatrix;if(x!==void 0&&b){if(e.keyCode===l.Keys.enter){const d=n.tableKeyboardNavigationTools.getNavigatableElement(a,{level:x+1});if(d){n.tableKeyboardNavigationTools.focusElement({elementForFocus:d,event:e,contextStateRef:o,prevElement:a});return}else{const g=n.tableKeyboardNavigationTools.getFocusableElements(a)[0];n.tableKeyboardNavigationTools.focusElement({elementForFocus:g,event:e,contextStateRef:o,prevElement:a});return}}if(e.keyCode===l.Keys.up||e.keyCode===l.Keys.down||e.keyCode===l.Keys.left||e.keyCode===l.Keys.right){const d=e.keyCode===l.Keys.up||e.keyCode===l.Keys.left,g=e.keyCode===l.Keys.up||e.keyCode===l.Keys.down;let v;if(t.current&&t.current.prevNavigationIndexes){const[m,u]=t.current.prevNavigationIndexes;f[m][u]===c?v=t.current.prevNavigationIndexes:v=n.findId(f,c)}else v=n.findId(f,c);if(v){const[m,u]=v,[s,y]=g?n.findNextIdByRowIndex(m,u,c,f,d):n.findNextIdByCellIndex(m,u,c,f,d);if(s){const I=n.tableKeyboardNavigationTools.getActiveElement(b,s);n.tableKeyboardNavigationTools.focusElement({elementForFocus:I,event:e,contextStateRef:o,prevElement:a}),t.current.prevNavigationIndexes=y,i&&i({focusElement:I,event:e})}}}}},N=e=>{const{navigationStateRef:r,scope:o}=e;if(!r.current||!o)return;const t=[],i=n.getHeaderElement(o),a=n.getBodyElement(o);if(!i||!a)return;const c=Array.from(i.children),x=Array.from(a.children);[...c,...x].forEach((b,f)=>{Array.from(b.children).forEach(d=>{const g=n.getNavigatableId(d);if(!g)return;const v=d.rowSpan||1,m=d.colSpan||1;let u;for(let s=f,y=f+v;s<y;s++){if(t[s]||(t[s]=[]),u===void 0){const I=t[s].findIndex(E=>!E);u=I>-1?I:t[s].length}t[s][u]=g||""}for(let s=u+1,y=u+m;s<y;s++)t[f][s]=g||""})}),r.current.navigationMatrix=t.filter(b=>!!b),r.current.lastHeaderIndex=c.length-1},F={onConstructor:p,onComponentDidMount:K,onGetSnapshotBeforeUpdate:S,onComponentDidUpdate:T,onFocus:C,onKeyDown:R,generateMatrix:N};exports.tableKeyboardNavigation=F;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@progress/kendo-react-common"),a=require("./utils.js"),K=e=>{const{navigatable:i,contextStateRef:o,navigationStateRef:t,idPrefix:r}=e;i&&(o.current={activeId:"",level:0},t.current={activeElementIsFocused:!1,prevNavigationIndexes:void 0,idPrefix:r||l.guid(),navigationMatrix:[],lastHeaderIndex:-1})},p=e=>{const{scope:i,contextStateRef:o,navigationStateRef:t}=e;if(o.current&&t.current&&i){E(e);const r=t.current.navigationMatrix.flat().find(n=>n.endsWith("cell"));if(r){const n=a.tableKeyboardNavigationTools.getActiveNavDataElement(i,r);n&&(o.current.activeId=r,n.setAttribute("tabIndex","0"))}}},S=e=>{const{contextStateRef:i,navigationStateRef:o,document:t}=e;if(i.current&&o.current&&t){const r=l.getActiveElement(t),n=a.tableKeyboardNavigationTools.getNavigatableId(r);n&&n===i.current.activeId&&(o.current.activeElementIsFocused=!0)}},T=e=>{const{scope:i,contextStateRef:o,navigationStateRef:t}=e;if(E(e),o.current&&t.current&&i){if(!a.tableKeyboardNavigationTools.getActiveNavDataElement(i,o.current.activeId)){const n=t.current.navigationMatrix[0][0],c=a.tableKeyboardNavigationTools.getActiveNavDataElement(i,n);n&&c&&(o.current.activeId=n,c.setAttribute("tabIndex","0"),t.current.activeElementIsFocused&&c.focus())}t.current.activeElementIsFocused=!1}},C=(e,i)=>{const{contextStateRef:o}=i;if(e.isDefaultPrevented()||!o.current)return;const t=e.target,r=a.tableKeyboardNavigationTools.getNavigatableId(t);if(r&&r!==o.current.activeId){const n=a.tableKeyboardNavigationTools.getClosestScope(t);if(!n)return;const c=a.tableKeyboardNavigationTools.getActiveNavDataElement(n,o.current.activeId);c&&c.setAttribute("tabIndex","-1"),t.setAttribute("tabIndex","0"),o.current.activeId=r}},h=(e,i)=>{const{contextStateRef:o,navigationStateRef:t,onNavigationAction:r}=i;if(e.isDefaultPrevented()||!o.current||!t.current)return;if(e.keyCode===l.Keys.esc){const d=a.tableKeyboardNavigationTools.getClosestNavigatableElement(e.target);a.tableKeyboardNavigationTools.focusElement({elementForFocus:d,event:e,contextStateRef:o});return}const n=e.target,c=n.className.indexOf("k-checkbox")===-1?n:a.tableKeyboardNavigationTools.getClosestNavigatableElement(n),g=a.tableKeyboardNavigationTools.getNavigatableId(c),b=a.tableKeyboardNavigationTools.getNavigatableLevel(c),m=a.tableKeyboardNavigationTools.getClosestScope(c),f=t.current.navigationMatrix;if(b!==void 0&&m){if(e.keyCode===l.Keys.enter){const d=a.tableKeyboardNavigationTools.getNavigatableElement(c,{level:b+1});if(d){a.tableKeyboardNavigationTools.focusElement({elementForFocus:d,event:e,contextStateRef:o,prevElement:c});return}else{const I=a.tableKeyboardNavigationTools.getFocusableElements(c)[0];a.tableKeyboardNavigationTools.focusElement({elementForFocus:I,event:e,contextStateRef:o,prevElement:c});return}}if(e.keyCode===l.Keys.up||e.keyCode===l.Keys.down||e.keyCode===l.Keys.left||e.keyCode===l.Keys.right){const d=e.keyCode===l.Keys.up||e.keyCode===l.Keys.left,I=e.keyCode===l.Keys.up||e.keyCode===l.Keys.down;let v;if(t.current&&t.current.prevNavigationIndexes){const[u,s]=t.current.prevNavigationIndexes;f[u][s]===g?v=t.current.prevNavigationIndexes:v=a.findId(f,g)}else v=a.findId(f,g);if(v){const[u,s]=v,[y,N]=I?a.findNextIdByRowIndex(u,s,g,f,d):a.findNextIdByCellIndex(u,s,g,f,d);if(y){const x=a.tableKeyboardNavigationTools.getActiveNavDataElement(m,y);a.tableKeyboardNavigationTools.focusElement({elementForFocus:x,event:e,contextStateRef:o,prevElement:c}),t.current.prevNavigationIndexes=N,r&&r({focusElement:x,event:e})}}}}},E=e=>{const{navigationStateRef:i,scope:o}=e;if(!i.current||!o)return;const t=[],r=a.getHeaderElement(o),n=a.getBodyElement(o);if(!r||!n)return;const c=Array.from(r.children),g=Array.from(n.children);[...c,...g].forEach((b,m)=>{Array.from(b.children).forEach(f=>{const d=a.getNavigatableId(f);if(!d)return;const I=f.rowSpan||1,v=f.colSpan||1;let u;for(let s=m,y=m+I;s<y;s++){if(t[s]||(t[s]=[]),u===void 0){const N=t[s].findIndex(x=>!x);u=N>-1?N:t[s].length}t[s][u]=d||""}for(let s=u+1,y=u+v;s<y;s++)t[m][s]=d||""})}),i.current.navigationMatrix=t.filter(b=>!!b),i.current.lastHeaderIndex=c.length-1},R={onConstructor:K,onComponentDidMount:p,onGetSnapshotBeforeUpdate:S,onComponentDidUpdate:T,onFocus:C,onKeyDown:h,generateMatrix:E};exports.tableKeyboardNavigation=R;
@@ -6,9 +6,9 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import { guid as C, getActiveElement as N, Keys as u } from "@progress/kendo-react-common";
10
- import { tableKeyboardNavigationTools as i, findId as y, findNextIdByRowIndex as F, findNextIdByCellIndex as R, getHeaderElement as h, getBodyElement as A, getNavigatableId as k } from "./utils.mjs";
11
- const w = (e) => {
9
+ import { guid as S, getActiveElement as C, Keys as f } from "@progress/kendo-react-common";
10
+ import { tableKeyboardNavigationTools as a, findId as y, findNextIdByRowIndex as h, findNextIdByCellIndex as F, getHeaderElement as R, getBodyElement as A, getNavigatableId as D } from "./utils.mjs";
11
+ const k = (e) => {
12
12
  const { navigatable: o, contextStateRef: n, navigationStateRef: t, idPrefix: c } = e;
13
13
  o && (n.current = {
14
14
  activeId: "",
@@ -16,29 +16,32 @@ const w = (e) => {
16
16
  }, t.current = {
17
17
  activeElementIsFocused: !1,
18
18
  prevNavigationIndexes: void 0,
19
- idPrefix: c || C(),
19
+ idPrefix: c || S(),
20
20
  navigationMatrix: [],
21
21
  lastHeaderIndex: -1
22
22
  });
23
- }, D = (e) => {
23
+ }, w = (e) => {
24
24
  const { scope: o, contextStateRef: n, navigationStateRef: t } = e;
25
25
  if (n.current && t.current && o) {
26
- b(e);
27
- const c = t.current.navigationMatrix[0][0], r = i.getActiveElement(o, c);
28
- c && r && (n.current.activeId = c, r.setAttribute("tabIndex", "0"));
26
+ N(e);
27
+ const c = t.current.navigationMatrix.flat().find((r) => r.endsWith("cell"));
28
+ if (c) {
29
+ const r = a.getActiveNavDataElement(o, c);
30
+ r && (n.current.activeId = c, r.setAttribute("tabIndex", "0"));
31
+ }
29
32
  }
30
33
  }, M = (e) => {
31
34
  const { contextStateRef: o, navigationStateRef: n, document: t } = e;
32
35
  if (o.current && n.current && t) {
33
- const c = N(t), r = i.getNavigatableId(c);
36
+ const c = C(t), r = a.getNavigatableId(c);
34
37
  r && r === o.current.activeId && (n.current.activeElementIsFocused = !0);
35
38
  }
36
39
  }, B = (e) => {
37
40
  const { scope: o, contextStateRef: n, navigationStateRef: t } = e;
38
- if (b(e), n.current && t.current && o) {
39
- if (!i.getActiveElement(o, n.current.activeId)) {
40
- const r = t.current.navigationMatrix[0][0], a = i.getActiveElement(o, r);
41
- r && a && (n.current.activeId = r, a.setAttribute("tabIndex", "0"), t.current.activeElementIsFocused && a.focus());
41
+ if (N(e), n.current && t.current && o) {
42
+ if (!a.getActiveNavDataElement(o, n.current.activeId)) {
43
+ const r = t.current.navigationMatrix[0][0], i = a.getActiveNavDataElement(o, r);
44
+ r && i && (n.current.activeId = r, i.setAttribute("tabIndex", "0"), t.current.activeElementIsFocused && i.focus());
42
45
  }
43
46
  t.current.activeElementIsFocused = !1;
44
47
  }
@@ -46,13 +49,13 @@ const w = (e) => {
46
49
  const { contextStateRef: n } = o;
47
50
  if (e.isDefaultPrevented() || !n.current)
48
51
  return;
49
- const t = e.target, c = i.getNavigatableId(t);
52
+ const t = e.target, c = a.getNavigatableId(t);
50
53
  if (c && c !== n.current.activeId) {
51
- const r = i.getClosestScope(t);
54
+ const r = a.getClosestScope(t);
52
55
  if (!r)
53
56
  return;
54
- const a = i.getActiveElement(r, n.current.activeId);
55
- a && a.setAttribute("tabIndex", "-1"), t.setAttribute("tabIndex", "0"), n.current.activeId = c;
57
+ const i = a.getActiveNavDataElement(r, n.current.activeId);
58
+ i && i.setAttribute("tabIndex", "-1"), t.setAttribute("tabIndex", "0"), n.current.activeId = c;
56
59
  }
57
60
  }, P = (e, o) => {
58
61
  const {
@@ -62,80 +65,80 @@ const w = (e) => {
62
65
  } = o;
63
66
  if (e.isDefaultPrevented() || !n.current || !t.current)
64
67
  return;
65
- if (e.keyCode === u.esc) {
66
- const d = i.getClosestNavigatableElement(e.target);
67
- i.focusElement({ elementForFocus: d, event: e, contextStateRef: n });
68
+ if (e.keyCode === f.esc) {
69
+ const l = a.getClosestNavigatableElement(e.target);
70
+ a.focusElement({ elementForFocus: l, event: e, contextStateRef: n });
68
71
  return;
69
72
  }
70
- const r = e.target, a = i.getNavigatableId(r), E = i.getNavigatableLevel(r), v = i.getClosestScope(r), f = t.current.navigationMatrix;
71
- if (E !== void 0 && v) {
72
- if (e.keyCode === u.enter) {
73
- const d = i.getNavigatableElement(r, { level: E + 1 });
74
- if (d) {
75
- i.focusElement({
76
- elementForFocus: d,
73
+ const r = e.target, i = r.className.indexOf("k-checkbox") === -1 ? r : a.getClosestNavigatableElement(r), v = a.getNavigatableId(i), m = a.getNavigatableLevel(i), I = a.getClosestScope(i), u = t.current.navigationMatrix;
74
+ if (m !== void 0 && I) {
75
+ if (e.keyCode === f.enter) {
76
+ const l = a.getNavigatableElement(i, { level: m + 1 });
77
+ if (l) {
78
+ a.focusElement({
79
+ elementForFocus: l,
77
80
  event: e,
78
81
  contextStateRef: n,
79
- prevElement: r
82
+ prevElement: i
80
83
  });
81
84
  return;
82
85
  } else {
83
- const g = i.getFocusableElements(r)[0];
84
- i.focusElement({ elementForFocus: g, event: e, contextStateRef: n, prevElement: r });
86
+ const E = a.getFocusableElements(i)[0];
87
+ a.focusElement({ elementForFocus: E, event: e, contextStateRef: n, prevElement: i });
85
88
  return;
86
89
  }
87
90
  }
88
- if (e.keyCode === u.up || e.keyCode === u.down || e.keyCode === u.left || e.keyCode === u.right) {
89
- const d = e.keyCode === u.up || e.keyCode === u.left, g = e.keyCode === u.up || e.keyCode === u.down;
90
- let m;
91
+ if (e.keyCode === f.up || e.keyCode === f.down || e.keyCode === f.left || e.keyCode === f.right) {
92
+ const l = e.keyCode === f.up || e.keyCode === f.left, E = e.keyCode === f.up || e.keyCode === f.down;
93
+ let g;
91
94
  if (t.current && t.current.prevNavigationIndexes) {
92
- const [I, l] = t.current.prevNavigationIndexes;
93
- f[I][l] === a ? m = t.current.prevNavigationIndexes : m = y(f, a);
95
+ const [d, s] = t.current.prevNavigationIndexes;
96
+ u[d][s] === v ? g = t.current.prevNavigationIndexes : g = y(u, v);
94
97
  } else
95
- m = y(f, a);
96
- if (m) {
97
- const [I, l] = m, [s, x] = g ? F(I, l, a, f, d) : R(I, l, a, f, d);
98
- if (s) {
99
- const p = i.getActiveElement(v, s);
100
- i.focusElement({ elementForFocus: p, event: e, contextStateRef: n, prevElement: r }), t.current.prevNavigationIndexes = x, c && c({ focusElement: p, event: e });
98
+ g = y(u, v);
99
+ if (g) {
100
+ const [d, s] = g, [x, p] = E ? h(d, s, v, u, l) : F(d, s, v, u, l);
101
+ if (x) {
102
+ const b = a.getActiveNavDataElement(I, x);
103
+ a.focusElement({ elementForFocus: b, event: e, contextStateRef: n, prevElement: i }), t.current.prevNavigationIndexes = p, c && c({ focusElement: b, event: e });
101
104
  }
102
105
  }
103
106
  }
104
107
  }
105
- }, b = (e) => {
108
+ }, N = (e) => {
106
109
  const { navigationStateRef: o, scope: n } = e;
107
110
  if (!o.current || !n)
108
111
  return;
109
- const t = [], c = h(n), r = A(n);
112
+ const t = [], c = R(n), r = A(n);
110
113
  if (!c || !r)
111
114
  return;
112
- const a = Array.from(c.children), E = Array.from(r.children);
113
- [...a, ...E].forEach((v, f) => {
114
- Array.from(v.children).forEach((d) => {
115
- const g = k(d);
116
- if (!g)
115
+ const i = Array.from(c.children), v = Array.from(r.children);
116
+ [...i, ...v].forEach((m, I) => {
117
+ Array.from(m.children).forEach((u) => {
118
+ const l = D(u);
119
+ if (!l)
117
120
  return;
118
- const m = d.rowSpan || 1, I = d.colSpan || 1;
119
- let l;
120
- for (let s = f, x = f + m; s < x; s++) {
121
- if (t[s] || (t[s] = []), l === void 0) {
122
- const p = t[s].findIndex((S) => !S);
123
- l = p > -1 ? p : t[s].length;
121
+ const E = u.rowSpan || 1, g = u.colSpan || 1;
122
+ let d;
123
+ for (let s = I, x = I + E; s < x; s++) {
124
+ if (t[s] || (t[s] = []), d === void 0) {
125
+ const p = t[s].findIndex((b) => !b);
126
+ d = p > -1 ? p : t[s].length;
124
127
  }
125
- t[s][l] = g || "";
128
+ t[s][d] = l || "";
126
129
  }
127
- for (let s = l + 1, x = l + I; s < x; s++)
128
- t[f][s] = g || "";
130
+ for (let s = d + 1, x = d + g; s < x; s++)
131
+ t[I][s] = l || "";
129
132
  });
130
- }), o.current.navigationMatrix = t.filter((v) => !!v), o.current.lastHeaderIndex = a.length - 1;
133
+ }), o.current.navigationMatrix = t.filter((m) => !!m), o.current.lastHeaderIndex = i.length - 1;
131
134
  }, U = {
132
- onConstructor: w,
133
- onComponentDidMount: D,
135
+ onConstructor: k,
136
+ onComponentDidMount: w,
134
137
  onGetSnapshotBeforeUpdate: M,
135
138
  onComponentDidUpdate: B,
136
139
  onFocus: K,
137
140
  onKeyDown: P,
138
- generateMatrix: b
141
+ generateMatrix: N
139
142
  };
140
143
  export {
141
144
  U as tableKeyboardNavigation
@@ -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 _="data-keyboardnavlevel",t="data-keyboardnavscope",e="data-keyboardnavheader",a="data-keyboardnavbody",E="data-keyboardnavid",n="data-keyboardnavzone",d="_filter",A=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]"],b=[...A,"[tabindex]"],i=[...A,"[tabindex]"].map(o=>o+':not([tabindex="-1"])'),r={[t]:!0},D={[e]:!0},s={[a]:!0};exports.FOCUSABLE_ELEMENTS=b;exports.KEYBOARD_NAV_DATA_BODY=a;exports.KEYBOARD_NAV_DATA_HEADER=e;exports.KEYBOARD_NAV_DATA_ID=E;exports.KEYBOARD_NAV_DATA_LEVEL=_;exports.KEYBOARD_NAV_DATA_SCOPE=t;exports.KEYBOARD_NAV_DATA_ZONE=n;exports.KEYBOARD_NAV_FILTER_COL_SUFFIX=d;exports.TABBABLE_ELEMENTS=i;exports.tableKeyboardNavigationBodyAttributes=s;exports.tableKeyboardNavigationHeaderAttributes=D;exports.tableKeyboardNavigationScopeAttributes=r;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="data-keyboardnavlevel",A="data-keyboardnavscope",t="data-keyboardnavheader",a="data-keyboardnavbody",_="data-keyboardnavid",o="data-keyboardnavzone",D="_filter",r={[A]:!0},E={[t]:!0},b={[a]:!0};exports.KEYBOARD_NAV_DATA_BODY=a;exports.KEYBOARD_NAV_DATA_HEADER=t;exports.KEYBOARD_NAV_DATA_ID=_;exports.KEYBOARD_NAV_DATA_LEVEL=e;exports.KEYBOARD_NAV_DATA_SCOPE=A;exports.KEYBOARD_NAV_DATA_ZONE=o;exports.KEYBOARD_NAV_FILTER_COL_SUFFIX=D;exports.tableKeyboardNavigationBodyAttributes=b;exports.tableKeyboardNavigationHeaderAttributes=E;exports.tableKeyboardNavigationScopeAttributes=r;
@@ -6,38 +6,22 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- const d = "data-keyboardnavlevel", e = "data-keyboardnavscope", o = "data-keyboardnavheader", n = "data-keyboardnavbody", A = "data-keyboardnavid", b = "data-keyboardnavzone", r = "_filter", t = [
10
- "input:not([disabled]):not([type=hidden])",
11
- "select:not([disabled])",
12
- "textarea:not([disabled])",
13
- "button:not([disabled])",
14
- "a[href]",
15
- "area[href]",
16
- "summary",
17
- "iframe",
18
- "object",
19
- "embed",
20
- "audio[controls]",
21
- "video[controls]",
22
- "[contenteditable]"
23
- ], E = [...t, "[tabindex]"], _ = [...t, "[tabindex]"].map((a) => a + ':not([tabindex="-1"])'), s = {
9
+ const A = "data-keyboardnavlevel", a = "data-keyboardnavscope", t = "data-keyboardnavheader", e = "data-keyboardnavbody", o = "data-keyboardnavid", _ = "data-keyboardnavzone", n = "_filter", d = {
10
+ [a]: !0
11
+ }, r = {
12
+ [t]: !0
13
+ }, b = {
24
14
  [e]: !0
25
- }, i = {
26
- [o]: !0
27
- }, c = {
28
- [n]: !0
29
15
  };
30
16
  export {
31
- E as FOCUSABLE_ELEMENTS,
32
- n as KEYBOARD_NAV_DATA_BODY,
33
- o as KEYBOARD_NAV_DATA_HEADER,
34
- A as KEYBOARD_NAV_DATA_ID,
35
- d as KEYBOARD_NAV_DATA_LEVEL,
36
- e as KEYBOARD_NAV_DATA_SCOPE,
37
- b as KEYBOARD_NAV_DATA_ZONE,
38
- r as KEYBOARD_NAV_FILTER_COL_SUFFIX,
39
- _ as TABBABLE_ELEMENTS,
40
- c as tableKeyboardNavigationBodyAttributes,
41
- i as tableKeyboardNavigationHeaderAttributes,
42
- s as tableKeyboardNavigationScopeAttributes
17
+ e as KEYBOARD_NAV_DATA_BODY,
18
+ t as KEYBOARD_NAV_DATA_HEADER,
19
+ o as KEYBOARD_NAV_DATA_ID,
20
+ A as KEYBOARD_NAV_DATA_LEVEL,
21
+ a as KEYBOARD_NAV_DATA_SCOPE,
22
+ _ as KEYBOARD_NAV_DATA_ZONE,
23
+ n as KEYBOARD_NAV_FILTER_COL_SUFFIX,
24
+ b as tableKeyboardNavigationBodyAttributes,
25
+ r as tableKeyboardNavigationHeaderAttributes,
26
+ d as tableKeyboardNavigationScopeAttributes
43
27
  };
@@ -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 n=require("./constants.js"),E=(e,t,r="cell")=>`${t}_${e}_${r}`,A=e=>{if(e)return parseInt(e.getAttribute(n.KEYBOARD_NAV_DATA_LEVEL)||"",10)},u=e=>{if(!e)return;const t=e.getAttribute(n.KEYBOARD_NAV_DATA_ID);return t||void 0},c=e=>e?!!e.getAttribute(n.KEYBOARD_NAV_DATA_ID):!1,i=(e,t={level:0})=>e.querySelector(`[${n.KEYBOARD_NAV_DATA_LEVEL}='${t.level}']`),g=e=>e.parentElement&&e.parentElement.closest(`[${n.KEYBOARD_NAV_DATA_LEVEL}]`),d=(e,t)=>e.querySelector(`[${n.KEYBOARD_NAV_DATA_ID}='${t}']`),_=e=>e.parentElement&&e.parentElement.closest(`[${n.KEYBOARD_NAV_DATA_SCOPE}]`),N=e=>e.querySelector(`[${n.KEYBOARD_NAV_DATA_HEADER}]`),f=e=>e.querySelector(`[${n.KEYBOARD_NAV_DATA_BODY}]`),b=(e,t={focusable:!1})=>{let r=t.focusable?n.FOCUSABLE_ELEMENTS:n.TABBABLE_ELEMENTS;return Array.from(e.querySelectorAll(r.join(",")))},v=(e,t={level:0})=>{if(!e)return[];let r=n.FOCUSABLE_ELEMENTS.map(l=>l+`[${n.KEYBOARD_NAV_DATA_LEVEL}='${t.level}']`).join(",");return Array.from(e.querySelectorAll(r))},I=(e={level:0})=>{let t=n.FOCUSABLE_ELEMENTS.map(r=>r+`[${n.KEYBOARD_NAV_DATA_LEVEL}='${e.level}']`).join(",");return r=>r.matches(t)},D=e=>{const{elementForFocus:t,event:r,contextStateRef:l,prevElement:o}=e;l.current&&t&&t.focus&&(r.preventDefault(),t.focus(),c(t)&&(t.setAttribute("tabIndex","0"),l.current.activeId=u(t)),o&&c(o)&&o.setAttribute("tabIndex","-1"))},B=e=>e.current?e.current.idPrefix:"",m=(e,t,r,l,o)=>{if(!r)return[];let a=e+(o?-1:1);for(;a>=0&&a<l.length;){const s=l[a][t];if(s!==r)return[s,[a,t]];a=a+(o?-1:1)}return[]},L=(e,t,r,l,o)=>{if(!r)return[];let a=t+(o?-1:1);for(;a>=0&&a<l[e].length;){const s=l[e][a];if(s!==r)return[s,[e,a]];a=a+(o?-1:1)}return[]},T=(e,t)=>{if(t){for(let r=0;r<e.length;r++)for(let l=0;l<e[r].length;l++)if(e[r][l]===t)return[r,l]}},O=e=>e.current?e.current.navigationMatrix.length:0,y=e=>e?`${e}${n.KEYBOARD_NAV_FILTER_COL_SUFFIX}`:"",S={generateNavigatableId:E,getNavigatableId:u,getNavigatableLevel:A,getNavigatableElement:i,getClosestNavigatableElement:g,getActiveElement:d,getClosestScope:_,getHeaderElement:N,getBodyElement:f,getFocusableElements:b,getNavigatableElements:v,filterNavigatableElements:I,focusElement:D,getIdPrefix:B,isNavigatable:c,findNextIdByRowIndex:m,findNextIdByCellIndex:L,findId:T,getNextNavigationIndex:O,getFilterColumnId:y};exports.filterNavigatableElements=I;exports.findId=T;exports.findNextIdByCellIndex=L;exports.findNextIdByRowIndex=m;exports.focusElement=D;exports.generateNavigatableId=E;exports.getActiveElement=d;exports.getBodyElement=f;exports.getClosestNavigatableElement=g;exports.getClosestScope=_;exports.getFilterColumnId=y;exports.getFocusableElements=b;exports.getHeaderElement=N;exports.getIdPrefix=B;exports.getNavigatableElement=i;exports.getNavigatableElements=v;exports.getNavigatableId=u;exports.getNavigatableLevel=A;exports.getNextNavigationIndex=O;exports.isNavigatable=c;exports.tableKeyboardNavigationTools=S;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@progress/kendo-react-common"),o=require("./constants.js"),i=(e,t,r="cell")=>`${t}_${e}_${r}`,A=e=>{if(e)return parseInt(e.getAttribute(o.KEYBOARD_NAV_DATA_LEVEL)||"",10)},E=e=>{if(!e)return;const t=e.getAttribute(o.KEYBOARD_NAV_DATA_ID);return t||void 0},u=e=>e?!!e.getAttribute(o.KEYBOARD_NAV_DATA_ID):!1,g=(e,t={level:0})=>e.querySelector(`[${o.KEYBOARD_NAV_DATA_LEVEL}='${t.level}']`),d=e=>e.parentElement&&e.parentElement.closest(`[${o.KEYBOARD_NAV_DATA_LEVEL}]`),N=(e,t)=>e.querySelector(`[${o.KEYBOARD_NAV_DATA_ID}='${t}']`),_=e=>e.parentElement&&e.parentElement.closest(`[${o.KEYBOARD_NAV_DATA_SCOPE}]`),f=e=>e.querySelector(`[${o.KEYBOARD_NAV_DATA_HEADER}]`),b=e=>e.querySelector(`[${o.KEYBOARD_NAV_DATA_BODY}]`),v=(e,t={focusable:!1})=>{let r=t.focusable?s.FOCUSABLE_ELEMENTS:s.TABBABLE_ELEMENTS;return Array.from(e.querySelectorAll(r.join(",")))},D=(e,t={level:0})=>{if(!e)return[];let r=s.FOCUSABLE_ELEMENTS.map(l=>l+`[${o.KEYBOARD_NAV_DATA_LEVEL}='${t.level}']`).join(",");return Array.from(e.querySelectorAll(r))},I=(e={level:0})=>{let t=s.FOCUSABLE_ELEMENTS.map(r=>r+`[${o.KEYBOARD_NAV_DATA_LEVEL}='${e.level}']`).join(",");return r=>r.matches(t)},m=e=>{const{elementForFocus:t,event:r,contextStateRef:l,prevElement:a}=e;if(l.current&&t&&t.focus){r.preventDefault();const n=t.querySelector(".k-checkbox-wrap .k-checkbox");n&&n.focus?n.focus():t.focus(),u(t)&&(t.setAttribute("tabIndex","0"),l.current.activeId=E(t)),a&&u(a)&&a.setAttribute("tabIndex","-1")}},B=e=>e.current?e.current.idPrefix:"",L=(e,t,r,l,a)=>{if(!r)return[];let n=e+(a?-1:1);for(;n>=0&&n<l.length;){const c=l[n][t];if(c!==r)return[c,[n,t]];n=n+(a?-1:1)}return[]},T=(e,t,r,l,a)=>{if(!r)return[];let n=t+(a?-1:1);for(;n>=0&&n<l[e].length;){const c=l[e][n];if(c!==r)return[c,[e,n]];n=n+(a?-1:1)}return[]},x=(e,t)=>{if(t){for(let r=0;r<e.length;r++)for(let l=0;l<e[r].length;l++)if(e[r][l]===t)return[r,l]}},y=e=>e.current?e.current.navigationMatrix.length:0,O=e=>e?`${e}${o.KEYBOARD_NAV_FILTER_COL_SUFFIX}`:"",S={generateNavigatableId:i,getNavigatableId:E,getNavigatableLevel:A,getNavigatableElement:g,getClosestNavigatableElement:d,getActiveNavDataElement:N,getClosestScope:_,getHeaderElement:f,getBodyElement:b,getFocusableElements:v,getNavigatableElements:D,filterNavigatableElements:I,focusElement:m,getIdPrefix:B,isNavigatable:u,findNextIdByRowIndex:L,findNextIdByCellIndex:T,findId:x,getNextNavigationIndex:y,getFilterColumnId:O};exports.filterNavigatableElements=I;exports.findId=x;exports.findNextIdByCellIndex=T;exports.findNextIdByRowIndex=L;exports.focusElement=m;exports.generateNavigatableId=i;exports.getActiveNavDataElement=N;exports.getBodyElement=b;exports.getClosestNavigatableElement=d;exports.getClosestScope=_;exports.getFilterColumnId=O;exports.getFocusableElements=v;exports.getHeaderElement=f;exports.getIdPrefix=B;exports.getNavigatableElement=g;exports.getNavigatableElements=D;exports.getNavigatableId=E;exports.getNavigatableLevel=A;exports.getNextNavigationIndex=y;exports.isNavigatable=u;exports.tableKeyboardNavigationTools=S;