@progress/kendo-react-data-tools 8.2.0-develop.8 → 8.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/cdn/js/kendo-react-datatools.js +1 -1
  2. package/drag/ColumnDraggable.js +1 -1
  3. package/drag/ColumnDraggable.mjs +2 -1
  4. package/drag/ColumnResizer.js +1 -1
  5. package/drag/ColumnResizer.mjs +1 -0
  6. package/filter/Expression.js +1 -1
  7. package/filter/Expression.mjs +12 -10
  8. package/filter/Filter.js +1 -1
  9. package/filter/Filter.mjs +103 -35
  10. package/filter/Group.js +1 -1
  11. package/filter/Group.mjs +17 -17
  12. package/filter/filters/DateFilter.js +1 -1
  13. package/filter/filters/DateFilter.mjs +4 -3
  14. package/filter/filters/EnumFilter.js +1 -1
  15. package/filter/filters/EnumFilter.mjs +2 -1
  16. package/filter/filters/NumericFilter.js +1 -1
  17. package/filter/filters/NumericFilter.mjs +2 -1
  18. package/filter/filters/TextFilter.js +1 -1
  19. package/filter/filters/TextFilter.mjs +2 -1
  20. package/header/FilterRow.js +1 -1
  21. package/header/FilterRow.mjs +34 -27
  22. package/header/Header.js +1 -1
  23. package/header/Header.mjs +7 -3
  24. package/header/HeaderThElement.js +1 -1
  25. package/header/HeaderThElement.mjs +27 -23
  26. package/index.d.mts +86 -12
  27. package/index.d.ts +86 -12
  28. package/index.js +1 -1
  29. package/index.mjs +130 -125
  30. package/navigation/NavigatableSettings.js +8 -0
  31. package/navigation/NavigatableSettings.mjs +12 -0
  32. package/navigation/TableKeyboardNavigation.js +1 -1
  33. package/navigation/TableKeyboardNavigation.mjs +197 -113
  34. package/navigation/constants.js +1 -1
  35. package/navigation/constants.mjs +11 -9
  36. package/navigation/utils.js +1 -1
  37. package/navigation/utils.mjs +173 -80
  38. package/package-metadata.mjs +1 -1
  39. package/package.json +9 -9
package/index.mjs CHANGED
@@ -12,143 +12,148 @@ 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 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 b } from "./utils/data-operations.mjs";
16
- import { getGroupIds as R, setExpandedState as I, setGroupIds as O } from "./utils/group-operations.mjs";
17
- import { useTableKeyboardNavigation as B } 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, isInNonSelectable as ne, relativeContextElement as pe, setSelectedState as ie } from "./selection/utils.mjs";
25
- import { ClipboardService as ue } from "./clipboard/clipboard.service.mjs";
26
- import { ClipboardActionType as Ce, populateClipboardData as Ae } from "./clipboard/common.mjs";
27
- import { createFilterComponent as Te } from "./filteringCells/FilterComponent.mjs";
28
- import { BooleanFilterCell as _e } from "./filteringCells/BooleanFilter.mjs";
29
- import { DateFilterCell as se } from "./filteringCells/DateFilter.mjs";
30
- import { NumericFilterCell as Ne } from "./filteringCells/NumericFilter.mjs";
31
- import { TextFilterCell as ge } from "./filteringCells/TextFilter.mjs";
32
- import { ColumnDefaultProps as Ie } from "./header/ColumnProps.mjs";
33
- import { FILTER_ROW_CLASS as ce, FilterRow as Be } from "./header/FilterRow.mjs";
34
- import { Header as Ke } 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 Ye } from "./header/HeaderSelectionCell.mjs";
38
- import { normalize as Pe } from "./header/SortSettings.mjs";
39
- import { getIndex as ze, isRtl as he, mapColumns as Ge, nextColumn as Ue, readColumns as Xe, updateLeft as We, updateRight as Ze } from "./header/utils/index.mjs";
40
- import { HeaderThElement as ke } from "./header/HeaderThElement.mjs";
41
- import { tableColumnsVirtualization as Je } from "./virtualization/columns.mjs";
42
- import { TextFilter as $e } from "./filter/filters/TextFilter.mjs";
43
- import { NumericFilter as oo } from "./filter/filters/NumericFilter.mjs";
44
- import { DateFilter as to } from "./filter/filters/DateFilter.mjs";
45
- import { BooleanFilter as lo } from "./filter/filters/BooleanFilter.mjs";
46
- import { EnumFilter as no } from "./filter/filters/EnumFilter.mjs";
47
- import { Expression as io } from "./filter/Expression.mjs";
48
- import { Filter as uo } from "./filter/Filter.mjs";
49
- import { Group as Co } from "./filter/Group.mjs";
50
- import { Operators as Eo, stringOperator as To, unaryOperator as _o } from "./filter/operators.mjs";
51
- import { ColumnMenuBooleanColumn as so, ColumnMenuDateColumn as Fo, ColumnMenuNumericColumn as No, ColumnMenuTextColumn as bo } from "./columnmenu/ColumnMenu.mjs";
52
- import { ColumnMenuFilterForm as Ro, ColumnMenuForm as Io } from "./columnmenu/ColumnMenuFilterForm.mjs";
53
- import { ColumnMenuFilterLogic as co } from "./columnmenu/ColumnMenuFilterLogic.mjs";
54
- import { ColumnMenuBooleanFilter as So, ColumnMenuDateFilter as Ko, ColumnMenuNumericFilter as Lo, ColumnMenuTextFilter as yo } from "./columnmenu/ColumnMenuFilters.mjs";
55
- import { ColumnMenuItem as vo } from "./columnmenu/ColumnMenuItem.mjs";
56
- import { ColumnMenuOperators as Yo } from "./columnmenu/ColumnMenuOperators.mjs";
15
+ import { createDataTree as A, extendDataItem as _, filterBy as T, flatData as E, getItemPath as d, modifySubItems as D, moveTreeItem as s, orderBy as N, removeItems as F, treeToFlat as b } from "./utils/data-operations.mjs";
16
+ import { getGroupIds as O, setExpandedState as B, setGroupIds as R } from "./utils/group-operations.mjs";
17
+ import { useTableKeyboardNavigation as I } from "./navigation/hooks.mjs";
18
+ import { KEYBOARD_NAV_CANCEL_BUTTON_CLASS as L, KEYBOARD_NAV_DATA_BODY as K, KEYBOARD_NAV_DATA_HEADER as M, 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_EDIT_BUTTON_CLASS as H, KEYBOARD_NAV_FILTER_COL_SUFFIX as P, tableKeyboardNavigationBodyAttributes as U, tableKeyboardNavigationHeaderAttributes as w, tableKeyboardNavigationScopeAttributes as z } from "./navigation/constants.mjs";
19
+ import { NavigatableMode as G } from "./navigation/NavigatableSettings.mjs";
20
+ import { tableKeyboardNavigation as W } from "./navigation/TableKeyboardNavigation.mjs";
21
+ import { TableKeyboardNavigationContext as j } from "./navigation/TableKeyboardNavigationContext.mjs";
22
+ import { tableKeyboardNavigationTools as q } from "./navigation/utils.mjs";
23
+ import { TableSelection as Q } from "./selection/TableSelection.mjs";
24
+ import { TABLE_COL_INDEX_ATTRIBUTE as ee, TABLE_PREVENT_SELECTION_ELEMENT as oe, TABLE_ROW_INDEX_ATTRIBUTE as re } from "./selection/constants.mjs";
25
+ import { closestTagName as me, getColumnIndex as le, getOffset as ae, getRowIndex as ne, getSelectedState as pe, getSelectedStateFromKeyDown as ie, getSelectionOptions as xe, isInNonSelectable as ue, relativeContextElement as fe, setSelectedState as Ce } from "./selection/utils.mjs";
26
+ import { ClipboardService as _e } from "./clipboard/clipboard.service.mjs";
27
+ import { ClipboardActionType as Ee, populateClipboardData as de } from "./clipboard/common.mjs";
28
+ import { createFilterComponent as se } from "./filteringCells/FilterComponent.mjs";
29
+ import { BooleanFilterCell as Fe } from "./filteringCells/BooleanFilter.mjs";
30
+ import { DateFilterCell as ge } from "./filteringCells/DateFilter.mjs";
31
+ import { NumericFilterCell as Be } from "./filteringCells/NumericFilter.mjs";
32
+ import { TextFilterCell as Se } from "./filteringCells/TextFilter.mjs";
33
+ import { ColumnDefaultProps as ce } from "./header/ColumnProps.mjs";
34
+ import { FILTER_ROW_CLASS as Ke, FilterRow as Me } from "./header/FilterRow.mjs";
35
+ import { Header as ve } from "./header/Header.mjs";
36
+ import { HeaderCell as Ye } from "./header/HeaderCell.mjs";
37
+ import { HeaderRow as Pe } from "./header/HeaderRow.mjs";
38
+ import { HeaderSelectionCell as we } from "./header/HeaderSelectionCell.mjs";
39
+ import { normalize as he } from "./header/SortSettings.mjs";
40
+ import { getIndex as Xe, isRtl as We, mapColumns as Ze, nextColumn as je, readColumns as ke, updateLeft as qe, updateRight as Je } from "./header/utils/index.mjs";
41
+ import { HeaderThElement as $e } from "./header/HeaderThElement.mjs";
42
+ import { tableColumnsVirtualization as oo } from "./virtualization/columns.mjs";
43
+ import { TextFilter as to } from "./filter/filters/TextFilter.mjs";
44
+ import { NumericFilter as lo } from "./filter/filters/NumericFilter.mjs";
45
+ import { DateFilter as no } from "./filter/filters/DateFilter.mjs";
46
+ import { BooleanFilter as io } from "./filter/filters/BooleanFilter.mjs";
47
+ import { EnumFilter as uo } from "./filter/filters/EnumFilter.mjs";
48
+ import { Expression as Co } from "./filter/Expression.mjs";
49
+ import { Filter as _o, selectors as To } from "./filter/Filter.mjs";
50
+ import { Group as Do } from "./filter/Group.mjs";
51
+ import { Operators as No, stringOperator as Fo, unaryOperator as bo } from "./filter/operators.mjs";
52
+ import { ColumnMenuBooleanColumn as Oo, ColumnMenuDateColumn as Bo, ColumnMenuNumericColumn as Ro, ColumnMenuTextColumn as So } from "./columnmenu/ColumnMenu.mjs";
53
+ import { ColumnMenuFilterForm as co, ColumnMenuForm as Lo } from "./columnmenu/ColumnMenuFilterForm.mjs";
54
+ import { ColumnMenuFilterLogic as Mo } from "./columnmenu/ColumnMenuFilterLogic.mjs";
55
+ import { ColumnMenuBooleanFilter as vo, ColumnMenuDateFilter as Vo, ColumnMenuNumericFilter as Yo, ColumnMenuTextFilter as Ho } from "./columnmenu/ColumnMenuFilters.mjs";
56
+ import { ColumnMenuItem as Uo } from "./columnmenu/ColumnMenuItem.mjs";
57
+ import { ColumnMenuOperators as zo } from "./columnmenu/ColumnMenuOperators.mjs";
57
58
  export {
58
- lo as BooleanFilter,
59
- _e as BooleanFilterCell,
60
- Ce as ClipboardActionType,
61
- ue as ClipboardService,
62
- Ie as ColumnDefaultProps,
63
- so as ColumnMenuBooleanColumn,
64
- So as ColumnMenuBooleanFilter,
65
- Fo as ColumnMenuDateColumn,
66
- Ko as ColumnMenuDateFilter,
67
- Ro as ColumnMenuFilterForm,
68
- co as ColumnMenuFilterLogic,
69
- Io as ColumnMenuForm,
70
- vo as ColumnMenuItem,
71
- No as ColumnMenuNumericColumn,
72
- Lo as ColumnMenuNumericFilter,
73
- Yo as ColumnMenuOperators,
74
- bo as ColumnMenuTextColumn,
75
- yo as ColumnMenuTextFilter,
59
+ io as BooleanFilter,
60
+ Fe as BooleanFilterCell,
61
+ Ee as ClipboardActionType,
62
+ _e as ClipboardService,
63
+ ce as ColumnDefaultProps,
64
+ Oo as ColumnMenuBooleanColumn,
65
+ vo as ColumnMenuBooleanFilter,
66
+ Bo as ColumnMenuDateColumn,
67
+ Vo as ColumnMenuDateFilter,
68
+ co as ColumnMenuFilterForm,
69
+ Mo as ColumnMenuFilterLogic,
70
+ Lo as ColumnMenuForm,
71
+ Uo as ColumnMenuItem,
72
+ Ro as ColumnMenuNumericColumn,
73
+ Yo as ColumnMenuNumericFilter,
74
+ zo as ColumnMenuOperators,
75
+ So as ColumnMenuTextColumn,
76
+ Ho as ColumnMenuTextFilter,
76
77
  m as ColumnResize,
77
78
  a as ColumnResizer,
78
79
  p as CommonDragLogic,
79
- to as DateFilter,
80
- se as DateFilterCell,
80
+ no as DateFilter,
81
+ ge as DateFilterCell,
81
82
  x as DragClue,
82
83
  f as DropClue,
83
- no as EnumFilter,
84
- io as Expression,
85
- ce as FILTER_ROW_CLASS,
86
- uo as Filter,
87
- Be as FilterRow,
88
- Co as Group,
89
- Ke as Header,
90
- ye as HeaderCell,
91
- ve as HeaderRow,
92
- Ye as HeaderSelectionCell,
93
- ke as HeaderThElement,
84
+ uo as EnumFilter,
85
+ Co as Expression,
86
+ Ke as FILTER_ROW_CLASS,
87
+ _o as Filter,
88
+ Me as FilterRow,
89
+ Do as Group,
90
+ ve as Header,
91
+ Ye as HeaderCell,
92
+ Pe as HeaderRow,
93
+ we as HeaderSelectionCell,
94
+ $e as HeaderThElement,
95
+ L as KEYBOARD_NAV_CANCEL_BUTTON_CLASS,
94
96
  K as KEYBOARD_NAV_DATA_BODY,
95
- L as KEYBOARD_NAV_DATA_HEADER,
97
+ M as KEYBOARD_NAV_DATA_HEADER,
96
98
  y as KEYBOARD_NAV_DATA_ID,
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
- oo as NumericFilter,
102
- Ne as NumericFilterCell,
103
- Eo as Operators,
99
+ v as KEYBOARD_NAV_DATA_LEVEL,
100
+ V as KEYBOARD_NAV_DATA_SCOPE,
101
+ Y as KEYBOARD_NAV_DATA_ZONE,
102
+ H as KEYBOARD_NAV_EDIT_BUTTON_CLASS,
103
+ P as KEYBOARD_NAV_FILTER_COL_SUFFIX,
104
+ G as NavigatableMode,
105
+ lo as NumericFilter,
106
+ Be as NumericFilterCell,
107
+ No as Operators,
104
108
  r as Pager,
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
- $e as TextFilter,
111
- ge as TextFilterCell,
112
- ee as closestTagName,
109
+ ee as TABLE_COL_INDEX_ATTRIBUTE,
110
+ oe as TABLE_PREVENT_SELECTION_ELEMENT,
111
+ re as TABLE_ROW_INDEX_ATTRIBUTE,
112
+ j as TableKeyboardNavigationContext,
113
+ Q as TableSelection,
114
+ to as TextFilter,
115
+ Se as TextFilterCell,
116
+ me as closestTagName,
113
117
  A as createDataTree,
114
- Te as createFilterComponent,
115
- E as extendDataItem,
118
+ se as createFilterComponent,
119
+ _ as extendDataItem,
116
120
  T as filterBy,
117
- d as flatData,
118
- oe as getColumnIndex,
119
- R as getGroupIds,
120
- ze 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
- ne as isInNonSelectable,
128
- he as isRtl,
129
- Ge as mapColumns,
121
+ E as flatData,
122
+ le as getColumnIndex,
123
+ O as getGroupIds,
124
+ Xe as getIndex,
125
+ d as getItemPath,
126
+ ae as getOffset,
127
+ ne as getRowIndex,
128
+ pe as getSelectedState,
129
+ ie as getSelectedStateFromKeyDown,
130
+ xe as getSelectionOptions,
131
+ ue as isInNonSelectable,
132
+ We as isRtl,
133
+ Ze as mapColumns,
130
134
  D as modifySubItems,
131
135
  s as moveTreeItem,
132
- Ue as nextColumn,
133
- Pe as normalize,
134
- F as orderBy,
135
- Ae as populateClipboardData,
136
- Xe as readColumns,
137
- pe as relativeContextElement,
138
- N as removeItems,
139
- I as setExpandedState,
140
- O as setGroupIds,
141
- ie as setSelectedState,
142
- To as stringOperator,
143
- Je as tableColumnsVirtualization,
144
- h as tableKeyboardNavigation,
145
- H as tableKeyboardNavigationBodyAttributes,
146
- P as tableKeyboardNavigationHeaderAttributes,
147
- w as tableKeyboardNavigationScopeAttributes,
148
- W as tableKeyboardNavigationTools,
136
+ je as nextColumn,
137
+ he as normalize,
138
+ N as orderBy,
139
+ de as populateClipboardData,
140
+ ke as readColumns,
141
+ fe as relativeContextElement,
142
+ F as removeItems,
143
+ To as selectors,
144
+ B as setExpandedState,
145
+ R as setGroupIds,
146
+ Ce as setSelectedState,
147
+ Fo as stringOperator,
148
+ oo as tableColumnsVirtualization,
149
+ W as tableKeyboardNavigation,
150
+ U as tableKeyboardNavigationBodyAttributes,
151
+ w as tableKeyboardNavigationHeaderAttributes,
152
+ z as tableKeyboardNavigationScopeAttributes,
153
+ q as tableKeyboardNavigationTools,
149
154
  b as treeToFlat,
150
- _o as unaryOperator,
151
- We as updateLeft,
152
- Ze as updateRight,
153
- B as useTableKeyboardNavigation
155
+ bo as unaryOperator,
156
+ qe as updateLeft,
157
+ Je as updateRight,
158
+ I as useTableKeyboardNavigation
154
159
  };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var i=(e=>(e.incell="incell",e.inline="inline",e))(i||{});exports.NavigatableMode=i;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2024 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use client";
9
+ var e = /* @__PURE__ */ ((n) => (n.incell = "incell", n.inline = "inline", n))(e || {});
10
+ export {
11
+ e as NavigatableMode
12
+ };
@@ -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 s=require("@progress/kendo-react-common"),t=require("./utils.js"),C=e=>{const{navigatable:r,contextStateRef:o,navigationStateRef:a,idPrefix:i}=e;r&&(o.current={activeId:"",level:0},a.current={activeElementIsFocused:!1,prevNavigationIndexes:void 0,idPrefix:i||s.guid(),navigationMatrix:[],lastHeaderIndex:-1})},D=e=>{const{scope:r,contextStateRef:o,navigationStateRef:a}=e;if(o.current&&a.current&&r){I(e);const i=t.getFirstDataCell(a.current.navigationMatrix);if(i){const n=t.tableKeyboardNavigationTools.getActiveNavDataElement(r,i);n&&(o.current.activeId=i,n.setAttribute("tabIndex","0"))}}},T=e=>{const{contextStateRef:r,navigationStateRef:o,document:a}=e;if(r.current&&o.current&&a){const i=s.getActiveElement(a),n=t.tableKeyboardNavigationTools.getNavigatableId(i);n&&n===r.current.activeId&&(o.current.activeElementIsFocused=!0)}},R=e=>{const{scope:r,contextStateRef:o,navigationStateRef:a,focusFirst:i}=e;if(i&&(C(e),D(e),t.focusFirstDataElement(e)),I(e),o.current&&a.current&&r){if(!t.tableKeyboardNavigationTools.getActiveNavDataElement(r,o.current.activeId)){const f=t.getFirstDataCell(a.current.navigationMatrix),c=t.tableKeyboardNavigationTools.getActiveNavDataElement(r,f);f&&c&&(o.current.activeId=f,c.setAttribute("tabIndex","0"),a.current.activeElementIsFocused&&c.focus())}a.current.activeElementIsFocused=!1}},S=(e,r)=>{const{contextStateRef:o}=r;if(e.isDefaultPrevented()||!o.current)return;const a=e.target,i=t.tableKeyboardNavigationTools.getNavigatableId(a);if(i&&i!==o.current.activeId){const n=t.tableKeyboardNavigationTools.getClosestScope(a);if(!n)return;const f=t.tableKeyboardNavigationTools.getActiveNavDataElement(n,o.current.activeId);f&&!e.target.classList.contains("k-table-td")&&!e.target.classList.contains("k-detail-cell")&&f.setAttribute("tabIndex","-1"),a.setAttribute("tabIndex","0"),o.current.activeId=i}},h=(e,r)=>{const{contextStateRef:o,navigationStateRef:a,onNavigationAction:i}=r;if(e.isDefaultPrevented()||!o.current||!a.current)return;let n;if(e.keyCode===s.Keys.esc){n=t.tableKeyboardNavigationTools.getClosestNavigatableElement(e.target),t.tableKeyboardNavigationTools.focusElement({elementForFocus:n,event:e,contextStateRef:o});return}const f=e.target,c=f.className.indexOf("k-checkbox")===-1?f:t.tableKeyboardNavigationTools.getClosestNavigatableElement(f),g=t.tableKeyboardNavigationTools.getNavigatableId(c),y=g==null?void 0:g.endsWith("column"),m=t.tableKeyboardNavigationTools.getNavigatableLevel(c),u=t.tableKeyboardNavigationTools.getClosestScope(c),v=a.current.navigationMatrix,N=e.metaKey||e.ctrlKey,b=t.getCurrentIdIndexes(a,v,g);if(m!==void 0&&u){if(e.keyCode===s.Keys.enter){const l=t.tableKeyboardNavigationTools.getNavigatableElement(c,{level:m+1});if(l){t.tableKeyboardNavigationTools.focusElement({elementForFocus:l,event:e,contextStateRef:o,prevElement:c});return}else{n=t.tableKeyboardNavigationTools.getFocusableElements(c)[0],t.tableKeyboardNavigationTools.focusElement({elementForFocus:n,event:e,contextStateRef:o,prevElement:c});return}}if(e.keyCode===s.Keys.home&&b)if(N)t.focusFirstDataElement({scope:u,navigationStateRef:a,contextStateRef:o},e);else{const l=t.getFirstRowDataCell(a.current.navigationMatrix,b[0]);n=t.tableKeyboardNavigationTools.getActiveNavDataElement(u,l),t.tableKeyboardNavigationTools.focusElement({elementForFocus:n,event:e,contextStateRef:o})}if(e.keyCode===s.Keys.end&&b)if(N){const l=t.getLastDataCell(a.current.navigationMatrix);n=t.tableKeyboardNavigationTools.getActiveNavDataElement(u,l),t.tableKeyboardNavigationTools.focusElement({elementForFocus:n,event:e,contextStateRef:o})}else{const l=t.getLastRowDataCell(a.current.navigationMatrix,b[0]);n=t.tableKeyboardNavigationTools.getActiveNavDataElement(u,l),t.tableKeyboardNavigationTools.focusElement({elementForFocus:n,event:e,contextStateRef:o})}if(e.keyCode===s.Keys.up||e.keyCode===s.Keys.down||e.keyCode===s.Keys.left||e.keyCode===s.Keys.right){const l=e.keyCode===s.Keys.up||e.keyCode===s.Keys.left,d=e.keyCode===s.Keys.up||e.keyCode===s.Keys.down;if(b){const[E,K]=b,[x,p]=d?t.findNextIdByRowIndex(E,K,g,v,l):t.findNextIdByCellIndex(E,K,g,v,l);x&&(n=t.tableKeyboardNavigationTools.getActiveNavDataElement(u,x),t.tableKeyboardNavigationTools.focusElement({elementForFocus:n,event:e,contextStateRef:o,prevElement:c}),a.current.prevNavigationIndexes=p)}}if(N&&e.keyCode===s.Keys.left&&y){i&&i({focusElement:c,event:e,action:"reorderToLeft"}),e.preventDefault();return}if(N&&e.keyCode===s.Keys.right&&y){i&&i({focusElement:c,event:e,action:"reorderToRight"}),e.preventDefault();return}if(e.keyCode===s.Keys.pageUp){i&&i({focusElement:n,event:e,action:"moveToNextPage"}),e.preventDefault();return}if(e.keyCode===s.Keys.pageDown){i&&i({focusElement:n,event:e,action:"moveToPrevPage"}),e.preventDefault();return}i&&i({focusElement:n,event:e})}},I=e=>{const{navigationStateRef:r,scope:o}=e;if(!r.current||!o)return;const a=[],i=t.getHeaderElement(o),n=t.getBodyElement(o),f=t.getNoRecordsElement(o)||{children:[]};if(!i||!n)return;const c=Array.from(i.children),g=Array.from(n.children);[...c,...g,f].forEach((y,m)=>{Array.from(y.children).forEach(u=>{const v=t.getNavigatableId(u);if(!v)return;const N=u.rowSpan||1,b=u.colSpan||1;let l;for(let d=m,E=m+N;d<E;d++){if(a[d]||(a[d]=[]),l===void 0){const K=a[d].findIndex(x=>!x);l=K>-1?K:a[d].length}a[d][l]=v||""}for(let d=l+1,E=l+b;d<E;d++)a[m][d]=v||""})}),r.current.navigationMatrix=a.filter(y=>!!y),r.current.lastHeaderIndex=c.length-1},k={onConstructor:C,onComponentDidMount:D,onGetSnapshotBeforeUpdate:T,onComponentDidUpdate:R,onFocus:S,onKeyDown:h,generateMatrix:I,focusFirstDataElement:t.focusFirstDataElement};exports.tableKeyboardNavigation=k;
8
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@progress/kendo-react-common"),t=require("./utils.js"),p=require("./NavigatableSettings.js"),F=e=>{const{navigatable:n,contextStateRef:i,navigationStateRef:o,idPrefix:r}=e;n&&(i.current={activeId:"",level:0},o.current={activeElementIsFocused:!1,prevNavigationIndexes:void 0,idPrefix:r||l.guid(),navigationMatrix:[],lastHeaderIndex:-1})},h=e=>{const{scope:n,contextStateRef:i,navigationStateRef:o}=e;if(i.current&&o.current&&n){R(e);const r=t.getFirstDataCell(o.current.navigationMatrix);if(r){const g=t.tableKeyboardNavigationTools.getActiveNavDataElement(n,r);g&&(i.current.activeId=r,g.setAttribute("tabIndex","0"))}}},S=e=>{const{contextStateRef:n,navigationStateRef:i,document:o}=e;if(n.current&&i.current&&o){const r=l.getActiveElement(o),g=t.tableKeyboardNavigationTools.getNavigatableId(r);g&&g===n.current.activeId&&(i.current.activeElementIsFocused=!0)}},B=e=>{const{scope:n,contextStateRef:i,navigationStateRef:o,focusFirst:r,newEditableRow:g,singleEditRow:c,lastActiveElement:v,navigatable:a}=e;if(r&&(F(e),h(e),t.focusFirstDataElement(e)),(!a||a&&a.mode===p.NavigatableMode.inline)&&(g&&!c||g&&c&&!v)?t.focusFirstEditor(g):a&&a.mode===p.NavigatableMode.inline&&g&&c&&v&&v.focus(),R(e),i.current&&o.current&&n){if(!t.tableKeyboardNavigationTools.getActiveNavDataElement(n,i.current.activeId)){const N=n.className.indexOf("k-treelist")===-1?t.getFirstDataCell(o.current.navigationMatrix):o.current.navigationMatrix[0][0],C=t.tableKeyboardNavigationTools.getActiveNavDataElement(n,N);N&&C&&(i.current.activeId=N,C.setAttribute("tabIndex","0"),o.current.activeElementIsFocused&&C.focus())}o.current.activeElementIsFocused=!1}},M=(e,n)=>{const{contextStateRef:i}=n;if(e.isDefaultPrevented()||!i.current)return;const o=e.target,r=t.tableKeyboardNavigationTools.getNavigatableId(o);if(r&&r!==i.current.activeId){const g=t.tableKeyboardNavigationTools.getClosestScope(o);if(!g)return;const c=t.tableKeyboardNavigationTools.getActiveNavDataElement(g,i.current.activeId);c&&!e.target.classList.contains("k-table-td")&&!e.target.classList.contains("k-detail-cell")&&c.setAttribute("tabIndex","-1"),o.setAttribute("tabIndex","0"),i.current.activeId=r}else if(o.closest(".k-filtercell")&&n.navigatable){const g=o.closest(".k-table-th");l.enableNavigatableContainer(g)}},L=async(e,n)=>{var T,x,k,D;const{contextStateRef:i,navigationStateRef:o,onNavigationAction:r,columns:g}=n;if(e.isDefaultPrevented()||!i.current||!o.current)return;let c;if(e.keyCode===l.Keys.esc&&!n.navigatable.mode){c=t.tableKeyboardNavigationTools.getClosestNavigatableElement(e.target),t.tableKeyboardNavigationTools.focusElement({elementForFocus:c,event:e,contextStateRef:i}),e.target.closest(".k-filtercell")&&c&&n.navigatable&&l.disableNavigatableContainer(c);return}const v=e.target,a=v.className.indexOf("k-checkbox")===-1?v:t.tableKeyboardNavigationTools.getClosestNavigatableElement(v),u=t.tableKeyboardNavigationTools.getNavigatableId(a)||((T=t.tableKeyboardNavigationTools.getParentCell(a))==null?void 0:T.getAttribute("data-keyboardnavid")),N=u==null?void 0:u.endsWith("column"),C=t.tableKeyboardNavigationTools.getNavigatableLevel(a),K=t.tableKeyboardNavigationTools.getClosestScope(a),E=o.current.navigationMatrix,I=e.metaKey||e.ctrlKey,b=t.getCurrentIdIndexes(o,E,u),y=a.closest(".k-table-th");if(n.navigatable&&n.navigatable.mode===p.NavigatableMode.inline){if(e.keyCode===l.Keys.enter){const d=a.classList.contains("k-grid-remove-command"),s=a.classList.contains("k-grid-cancel-command"),f=t.tableKeyboardNavigationTools.getRowAriaRowIndex(a);if(d){setTimeout(()=>{const m=t.tableKeyboardNavigationTools.getRemoveButtonByAriaRowIndex(f.current)||t.tableKeyboardNavigationTools.getRemoveButtonByAriaRowIndex(f.prev);m&&m.focus()});return}else if(s&&a.parentElement){const m=(x=t.tableKeyboardNavigationTools.getClosestNavigatableElement(a))==null?void 0:x.getAttribute("data-keyboardnavid");setTimeout(()=>{m&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(m).focus()});return}}if(e.keyCode===l.Keys.esc){const d=t.tableKeyboardNavigationTools.getClosestCancelButton(a);d&&d.click();const s=await t.tableKeyboardNavigationTools.getClosestEditButton(a);s&&s.focus();return}}else if(n.navigatable&&n.navigatable.mode===p.NavigatableMode.incell){const d=(k=a.closest(".k-table-td"))==null?void 0:k.classList.contains("k-grid-edit-cell");if(e.keyCode===l.Keys.esc){a.focus(),a.blur();const s=v&&v.parentElement&&v.parentElement.closest(".k-grid-edit-row"),f=t.tableKeyboardNavigationTools.getClosestCellNavId(a),m=await t.tableKeyboardNavigationTools.waitForElementToBeVisible(`[data-keyboardnavid='${f}']:not(.k-grid-edit-cell)`,s);m&&m.focus()}else if(e.keyCode===l.Keys.enter){let s;if(b){const[f,m]=b;s=t.findNextIdByRowIndex(f,m,u,E,!1)}if(!d)(D=t.tableKeyboardNavigationTools.getParentCell(a))==null||D.click();else if(d&&s){const f=s&&s[0]&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(s[0]);f&&f.click()}}else if(e.keyCode===l.Keys.left){if(d)return}else if(e.keyCode===l.Keys.right){if(d)return}else if(e.keyCode===l.Keys.up){if(d)return}else if(e.keyCode===l.Keys.down){if(d)return}else if(e.keyCode===l.Keys.tab&&d){if(e.shiftKey){const s=b&&g&&t.tableKeyboardNavigationTools.getPrevEditableCell(b,g,u,E);if(s&&s.prevCell&&s.prevCell.click(),s&&s.elementToFocus!=="gridcell"){a.blur();const f=t.tableKeyboardNavigationTools.getClosestCellNavId(a);setTimeout(()=>{f&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(f).focus()})}e.preventDefault()}else{const s=b&&g&&t.tableKeyboardNavigationTools.getNextEditableCell(b,g,u,E);if(s&&s.nextCell&&s.elementToFocus==="gridcell"&&s.nextCell.click(),s&&s.elementToFocus!=="gridcell"){a.blur();const f=t.tableKeyboardNavigationTools.getClosestCellNavId(a);f&&t.tableKeyboardNavigationTools.getTableCellByKeyboardNavId(f).focus();return}e.preventDefault()}e.preventDefault()}}if(a.closest(".k-filtercell")&&y&&n.navigatable&&l.keepFocusInContainer(e,y,l.TABBABLE_ELEMENTS),C!==void 0&&K){if(e.keyCode===l.Keys.enter){const d=t.tableKeyboardNavigationTools.getNavigatableElement(a,{level:C+1});if(d){t.tableKeyboardNavigationTools.focusElement({elementForFocus:d,event:e,contextStateRef:i,prevElement:a});return}else{a.querySelector(".k-filtercell")&&n.navigatable&&l.enableNavigatableContainer(a),c=t.tableKeyboardNavigationTools.getFocusableElements(a)[0],t.tableKeyboardNavigationTools.focusElement({elementForFocus:c,event:e,contextStateRef:i,prevElement:a});return}}if(e.keyCode===l.Keys.home&&b)if(I)t.focusFirstDataElement({scope:K,navigationStateRef:o,contextStateRef:i},e);else{const d=t.getFirstRowDataCell(o.current.navigationMatrix,b[0]);c=t.tableKeyboardNavigationTools.getActiveNavDataElement(K,d),t.tableKeyboardNavigationTools.focusElement({elementForFocus:c,event:e,contextStateRef:i})}if(e.keyCode===l.Keys.end&&b)if(I){const d=t.getLastDataCell(o.current.navigationMatrix);c=t.tableKeyboardNavigationTools.getActiveNavDataElement(K,d),t.tableKeyboardNavigationTools.focusElement({elementForFocus:c,event:e,contextStateRef:i})}else{const d=t.getLastRowDataCell(o.current.navigationMatrix,b[0]);c=t.tableKeyboardNavigationTools.getActiveNavDataElement(K,d),t.tableKeyboardNavigationTools.focusElement({elementForFocus:c,event:e,contextStateRef:i})}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,s=e.keyCode===l.Keys.up||e.keyCode===l.Keys.down;if(b){const[f,m]=b,[w,A]=s?t.findNextIdByRowIndex(f,m,u,E,d):t.findNextIdByCellIndex(f,m,u,E,d);w&&(c=t.tableKeyboardNavigationTools.getActiveNavDataElement(K,w),t.tableKeyboardNavigationTools.focusElement({elementForFocus:c,event:e,contextStateRef:i,prevElement:a}),o.current.prevNavigationIndexes=A)}}if(I&&e.keyCode===l.Keys.left&&N){r&&r({focusElement:a,event:e,action:"reorderToLeft"}),e.preventDefault();return}if(I&&e.keyCode===l.Keys.right&&N){r&&r({focusElement:a,event:e,action:"reorderToRight"}),e.preventDefault();return}if(e.keyCode===l.Keys.pageUp){r&&r({focusElement:c,event:e,action:"moveToNextPage"}),e.preventDefault();return}if(e.keyCode===l.Keys.pageDown){r&&r({focusElement:c,event:e,action:"moveToPrevPage"}),e.preventDefault();return}r&&r({focusElement:c,event:e})}},R=e=>{const{navigationStateRef:n,scope:i}=e;if(!n.current||!i)return;const o=[],r=t.getHeaderElement(i),g=t.getBodyElement(i),c=t.getNoRecordsElement(i)||{children:[]};if(!r||!g)return;const v=Array.from(r.children),a=Array.from(g.children);[...v,...a,c].forEach((u,N)=>{Array.from(u.children).forEach(C=>{const K=t.getNavigatableId(C);if(!K)return;const E=C.rowSpan||1,I=C.colSpan||1;let b;for(let y=N,T=N+E;y<T;y++){if(o[y]||(o[y]=[]),b===void 0){const x=o[y].findIndex(k=>!k);b=x>-1?x:o[y].length}o[y][b]=K||""}for(let y=b+1,T=b+I;y<T;y++)o[N][y]=K||""})}),n.current.navigationMatrix=o.filter(u=>!!u),n.current.lastHeaderIndex=v.length-1},P={onConstructor:F,onComponentDidMount:h,onGetSnapshotBeforeUpdate:S,onComponentDidUpdate:B,onFocus:M,onKeyDown:L,generateMatrix:R,focusFirstDataElement:t.focusFirstDataElement};exports.tableKeyboardNavigation=P;