@progress/kendo-react-data-tools 8.2.0-develop.32 → 8.2.0-develop.34
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/filter/Expression.js +1 -1
- package/filter/Expression.mjs +12 -10
- package/filter/Filter.js +1 -1
- package/filter/Filter.mjs +103 -35
- package/filter/Group.js +1 -1
- package/filter/Group.mjs +17 -17
- package/filter/filters/DateFilter.js +1 -1
- package/filter/filters/DateFilter.mjs +4 -3
- package/filter/filters/EnumFilter.js +1 -1
- package/filter/filters/EnumFilter.mjs +2 -1
- package/filter/filters/NumericFilter.js +1 -1
- package/filter/filters/NumericFilter.mjs +2 -1
- package/filter/filters/TextFilter.js +1 -1
- package/filter/filters/TextFilter.mjs +2 -1
- package/index.d.mts +15 -0
- package/index.d.ts +15 -0
- package/index.js +1 -1
- package/index.mjs +31 -30
- package/navigation/TableKeyboardNavigation.js +1 -1
- package/navigation/TableKeyboardNavigation.mjs +25 -25
- package/package-metadata.mjs +1 -1
- package/package.json +9 -9
|
@@ -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"),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=t.getFirstDataCell(o.current.navigationMatrix),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;
|
|
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;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
8
|
"use client";
|
|
9
|
-
import { guid as P, getActiveElement as H, enableNavigatableContainer as S, Keys as s, disableNavigatableContainer as
|
|
9
|
+
import { guid as P, getActiveElement as H, enableNavigatableContainer as S, Keys as s, disableNavigatableContainer as O, keepFocusInContainer as U, TABBABLE_ELEMENTS as V } from "@progress/kendo-react-common";
|
|
10
10
|
import { focusFirstDataElement as w, getFirstDataCell as T, tableKeyboardNavigationTools as t, focusFirstEditor as q, getCurrentIdIndexes as G, getFirstRowDataCell as W, getLastRowDataCell as _, getLastDataCell as $, getHeaderElement as j, getBodyElement as z, getNoRecordsElement as J, getNavigatableId as Q, findNextIdByRowIndex as F, findNextIdByCellIndex as X } from "./utils.mjs";
|
|
11
11
|
import { NavigatableMode as D } from "./NavigatableSettings.mjs";
|
|
12
12
|
const M = (e) => {
|
|
@@ -41,7 +41,7 @@ const M = (e) => {
|
|
|
41
41
|
const { scope: l, contextStateRef: o, navigationStateRef: n, focusFirst: i, newEditableRow: f, singleEditRow: c, lastActiveElement: v, navigatable: a } = e;
|
|
42
42
|
if (i && (M(e), L(e), w(e)), (!a || a && a.mode === D.inline) && (f && !c || f && c && !v) ? q(f) : a && a.mode === D.inline && f && c && v && v.focus(), h(e), o.current && n.current && l) {
|
|
43
43
|
if (!t.getActiveNavDataElement(l, o.current.activeId)) {
|
|
44
|
-
const E = T(n.current.navigationMatrix), I = t.getActiveNavDataElement(l, E);
|
|
44
|
+
const E = l.className.indexOf("k-treelist") === -1 ? T(n.current.navigationMatrix) : n.current.navigationMatrix[0][0], I = t.getActiveNavDataElement(l, E);
|
|
45
45
|
E && I && (o.current.activeId = E, I.setAttribute("tabIndex", "0"), n.current.activeElementIsFocused && I.focus());
|
|
46
46
|
}
|
|
47
47
|
n.current.activeElementIsFocused = !1;
|
|
@@ -62,7 +62,7 @@ const M = (e) => {
|
|
|
62
62
|
S(f);
|
|
63
63
|
}
|
|
64
64
|
}, te = async (e, l) => {
|
|
65
|
-
var
|
|
65
|
+
var N, p, R, A;
|
|
66
66
|
const {
|
|
67
67
|
contextStateRef: o,
|
|
68
68
|
navigationStateRef: n,
|
|
@@ -73,10 +73,10 @@ const M = (e) => {
|
|
|
73
73
|
return;
|
|
74
74
|
let c;
|
|
75
75
|
if (e.keyCode === s.esc && !l.navigatable.mode) {
|
|
76
|
-
c = t.getClosestNavigatableElement(e.target), t.focusElement({ elementForFocus: c, event: e, contextStateRef: o }), e.target.closest(".k-filtercell") && c && l.navigatable &&
|
|
76
|
+
c = t.getClosestNavigatableElement(e.target), t.focusElement({ elementForFocus: c, event: e, contextStateRef: o }), e.target.closest(".k-filtercell") && c && l.navigatable && O(c);
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
|
-
const v = e.target, a = v.className.indexOf("k-checkbox") === -1 ? v : t.getClosestNavigatableElement(v), m = t.getNavigatableId(a) || ((
|
|
79
|
+
const v = e.target, a = v.className.indexOf("k-checkbox") === -1 ? v : t.getClosestNavigatableElement(v), m = t.getNavigatableId(a) || ((N = t.getParentCell(a)) == null ? void 0 : N.getAttribute("data-keyboardnavid")), E = m == null ? void 0 : m.endsWith("column"), I = t.getNavigatableLevel(a), x = t.getClosestScope(a), y = n.current.navigationMatrix, k = e.metaKey || e.ctrlKey, u = G(n, y, m), C = a.closest(".k-table-th");
|
|
80
80
|
if (l.navigatable && l.navigatable.mode === D.inline) {
|
|
81
81
|
if (e.keyCode === s.enter) {
|
|
82
82
|
const d = a.classList.contains("k-grid-remove-command"), r = a.classList.contains("k-grid-cancel-command"), g = t.getRowAriaRowIndex(a);
|
|
@@ -87,7 +87,7 @@ const M = (e) => {
|
|
|
87
87
|
});
|
|
88
88
|
return;
|
|
89
89
|
} else if (r && a.parentElement) {
|
|
90
|
-
const b = (
|
|
90
|
+
const b = (p = t.getClosestNavigatableElement(a)) == null ? void 0 : p.getAttribute("data-keyboardnavid");
|
|
91
91
|
setTimeout(() => {
|
|
92
92
|
b && t.getTableCellByKeyboardNavId(b).focus();
|
|
93
93
|
});
|
|
@@ -111,7 +111,7 @@ const M = (e) => {
|
|
|
111
111
|
let r;
|
|
112
112
|
if (u) {
|
|
113
113
|
const [g, b] = u;
|
|
114
|
-
r = F(g, b, m,
|
|
114
|
+
r = F(g, b, m, y, !1);
|
|
115
115
|
}
|
|
116
116
|
if (!d)
|
|
117
117
|
(A = t.getParentCell(a)) == null || A.click();
|
|
@@ -133,7 +133,7 @@ const M = (e) => {
|
|
|
133
133
|
return;
|
|
134
134
|
} else if (e.keyCode === s.tab && d) {
|
|
135
135
|
if (e.shiftKey) {
|
|
136
|
-
const r = u && f && t.getPrevEditableCell(u, f, m,
|
|
136
|
+
const r = u && f && t.getPrevEditableCell(u, f, m, y);
|
|
137
137
|
if (r && r.prevCell && r.prevCell.click(), r && r.elementToFocus !== "gridcell") {
|
|
138
138
|
a.blur();
|
|
139
139
|
const g = t.getClosestCellNavId(a);
|
|
@@ -143,7 +143,7 @@ const M = (e) => {
|
|
|
143
143
|
}
|
|
144
144
|
e.preventDefault();
|
|
145
145
|
} else {
|
|
146
|
-
const r = u && f && t.getNextEditableCell(u, f, m,
|
|
146
|
+
const r = u && f && t.getNextEditableCell(u, f, m, y);
|
|
147
147
|
if (r && r.nextCell && r.elementToFocus === "gridcell" && r.nextCell.click(), r && r.elementToFocus !== "gridcell") {
|
|
148
148
|
a.blur();
|
|
149
149
|
const g = t.getClosestCellNavId(a);
|
|
@@ -155,7 +155,7 @@ const M = (e) => {
|
|
|
155
155
|
e.preventDefault();
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
if (a.closest(".k-filtercell") && C && l.navigatable &&
|
|
158
|
+
if (a.closest(".k-filtercell") && C && l.navigatable && U(e, C, V), I !== void 0 && x) {
|
|
159
159
|
if (e.keyCode === s.enter) {
|
|
160
160
|
const d = t.getNavigatableElement(a, { level: I + 1 });
|
|
161
161
|
if (d) {
|
|
@@ -175,7 +175,7 @@ const M = (e) => {
|
|
|
175
175
|
if (k)
|
|
176
176
|
w(
|
|
177
177
|
{
|
|
178
|
-
scope:
|
|
178
|
+
scope: x,
|
|
179
179
|
navigationStateRef: n,
|
|
180
180
|
contextStateRef: o
|
|
181
181
|
},
|
|
@@ -183,21 +183,21 @@ const M = (e) => {
|
|
|
183
183
|
);
|
|
184
184
|
else {
|
|
185
185
|
const d = W(n.current.navigationMatrix, u[0]);
|
|
186
|
-
c = t.getActiveNavDataElement(
|
|
186
|
+
c = t.getActiveNavDataElement(x, d), t.focusElement({ elementForFocus: c, event: e, contextStateRef: o });
|
|
187
187
|
}
|
|
188
188
|
if (e.keyCode === s.end && u)
|
|
189
189
|
if (k) {
|
|
190
190
|
const d = $(n.current.navigationMatrix);
|
|
191
|
-
c = t.getActiveNavDataElement(
|
|
191
|
+
c = t.getActiveNavDataElement(x, d), t.focusElement({ elementForFocus: c, event: e, contextStateRef: o });
|
|
192
192
|
} else {
|
|
193
193
|
const d = _(n.current.navigationMatrix, u[0]);
|
|
194
|
-
c = t.getActiveNavDataElement(
|
|
194
|
+
c = t.getActiveNavDataElement(x, d), t.focusElement({ elementForFocus: c, event: e, contextStateRef: o });
|
|
195
195
|
}
|
|
196
196
|
if (e.keyCode === s.up || e.keyCode === s.down || e.keyCode === s.left || e.keyCode === s.right) {
|
|
197
197
|
const d = e.keyCode === s.up || e.keyCode === s.left, r = e.keyCode === s.up || e.keyCode === s.down;
|
|
198
198
|
if (u) {
|
|
199
|
-
const [g, b] = u, [B, K] = r ? F(g, b, m,
|
|
200
|
-
B && (c = t.getActiveNavDataElement(
|
|
199
|
+
const [g, b] = u, [B, K] = r ? F(g, b, m, y, d) : X(g, b, m, y, d);
|
|
200
|
+
B && (c = t.getActiveNavDataElement(x, B), t.focusElement({ elementForFocus: c, event: e, contextStateRef: o, prevElement: a }), n.current.prevNavigationIndexes = K);
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
if (k && e.keyCode === s.left && E) {
|
|
@@ -228,20 +228,20 @@ const M = (e) => {
|
|
|
228
228
|
const v = Array.from(i.children), a = Array.from(f.children);
|
|
229
229
|
[...v, ...a, c].forEach((m, E) => {
|
|
230
230
|
Array.from(m.children).forEach((I) => {
|
|
231
|
-
const
|
|
232
|
-
if (!
|
|
231
|
+
const x = Q(I);
|
|
232
|
+
if (!x)
|
|
233
233
|
return;
|
|
234
|
-
const
|
|
234
|
+
const y = I.rowSpan || 1, k = I.colSpan || 1;
|
|
235
235
|
let u;
|
|
236
|
-
for (let C = E,
|
|
236
|
+
for (let C = E, N = E + y; C < N; C++) {
|
|
237
237
|
if (n[C] || (n[C] = []), u === void 0) {
|
|
238
|
-
const
|
|
239
|
-
u =
|
|
238
|
+
const p = n[C].findIndex((R) => !R);
|
|
239
|
+
u = p > -1 ? p : n[C].length;
|
|
240
240
|
}
|
|
241
|
-
n[C][u] =
|
|
241
|
+
n[C][u] = x || "";
|
|
242
242
|
}
|
|
243
|
-
for (let C = u + 1,
|
|
244
|
-
n[E][C] =
|
|
243
|
+
for (let C = u + 1, N = u + k; C < N; C++)
|
|
244
|
+
n[E][C] = x || "";
|
|
245
245
|
});
|
|
246
246
|
}), l.current.navigationMatrix = n.filter((m) => !!m), l.current.lastHeaderIndex = v.length - 1;
|
|
247
247
|
}, le = {
|
package/package-metadata.mjs
CHANGED
|
@@ -10,7 +10,7 @@ const e = {
|
|
|
10
10
|
name: "@progress/kendo-react-data-tools",
|
|
11
11
|
productName: "KendoReact",
|
|
12
12
|
productCodes: ["KENDOUIREACT", "KENDOUICOMPLETE"],
|
|
13
|
-
publishDate:
|
|
13
|
+
publishDate: 1722585267,
|
|
14
14
|
version: "",
|
|
15
15
|
licensingDocsUrl: "https://www.telerik.com/kendo-react-ui/components/my-license/"
|
|
16
16
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progress/kendo-react-data-tools",
|
|
3
|
-
"version": "8.2.0-develop.
|
|
3
|
+
"version": "8.2.0-develop.34",
|
|
4
4
|
"description": "Includes React Pager & React Filter component, an intuitive interface to create complex filter descriptions. KendoReact Data Tools package",
|
|
5
5
|
"author": "Progress",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
"@progress/kendo-data-query": "^1.0.0",
|
|
26
26
|
"@progress/kendo-drawing": "^1.20.1",
|
|
27
27
|
"@progress/kendo-licensing": "^1.3.4",
|
|
28
|
-
"@progress/kendo-react-animation": "8.2.0-develop.
|
|
29
|
-
"@progress/kendo-react-buttons": "8.2.0-develop.
|
|
30
|
-
"@progress/kendo-react-common": "8.2.0-develop.
|
|
31
|
-
"@progress/kendo-react-dateinputs": "8.2.0-develop.
|
|
32
|
-
"@progress/kendo-react-dropdowns": "8.2.0-develop.
|
|
33
|
-
"@progress/kendo-react-inputs": "8.2.0-develop.
|
|
34
|
-
"@progress/kendo-react-intl": "8.2.0-develop.
|
|
35
|
-
"@progress/kendo-react-popup": "8.2.0-develop.
|
|
28
|
+
"@progress/kendo-react-animation": "8.2.0-develop.34",
|
|
29
|
+
"@progress/kendo-react-buttons": "8.2.0-develop.34",
|
|
30
|
+
"@progress/kendo-react-common": "8.2.0-develop.34",
|
|
31
|
+
"@progress/kendo-react-dateinputs": "8.2.0-develop.34",
|
|
32
|
+
"@progress/kendo-react-dropdowns": "8.2.0-develop.34",
|
|
33
|
+
"@progress/kendo-react-inputs": "8.2.0-develop.34",
|
|
34
|
+
"@progress/kendo-react-intl": "8.2.0-develop.34",
|
|
35
|
+
"@progress/kendo-react-popup": "8.2.0-develop.34",
|
|
36
36
|
"@progress/kendo-svg-icons": "^3.0.0",
|
|
37
37
|
"react": "^16.8.2 || ^17.0.0 || ^18.0.0",
|
|
38
38
|
"react-dom": "^16.8.2 || ^17.0.0 || ^18.0.0"
|