@progress/kendo-react-data-tools 9.0.0-develop.1 → 9.0.0-develop.10
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/README.md +27 -27
- package/columnmenu/ColumnMenu.js +1 -1
- package/columnmenu/ColumnMenu.mjs +83 -98
- package/columnmenu/ColumnMenuFilterForm.mjs +2 -22
- package/columnmenu/ColumnMenuFilterLogic.mjs +8 -2
- package/columnmenu/ColumnMenuFilters.mjs +5 -8
- package/columnmenu/ColumnMenuOperators.mjs +1 -3
- package/dist/cdn/js/kendo-react-datatools.js +1 -1
- package/drag/DragClue.mjs +8 -1
- package/filter/Expression.mjs +21 -4
- package/filter/Filter.mjs +6 -5
- package/filter/Group.mjs +43 -25
- package/filter/filters/BooleanFilter.mjs +4 -1
- package/filter/filters/EnumFilter.mjs +4 -1
- package/filter/filters/NumericFilter.mjs +4 -1
- package/filter/filters/TextFilter.mjs +3 -1
- package/filteringCells/BooleanFilter.js +1 -1
- package/filteringCells/BooleanFilter.mjs +9 -9
- package/header/HeaderRow.js +1 -1
- package/header/HeaderRow.mjs +20 -18
- package/header/utils/index.js +1 -1
- package/header/utils/index.mjs +55 -57
- package/index.d.mts +14 -69
- package/index.d.ts +14 -69
- package/navigation/TableKeyboardNavigation.js +1 -1
- package/navigation/TableKeyboardNavigation.mjs +25 -13
- package/navigation/TableKeyboardNavigationContext.mjs +3 -1
- package/navigation/utils.mjs +2 -8
- package/package-metadata.mjs +1 -1
- package/package.json +10 -10
- package/pager/Pager.js +1 -1
- package/pager/Pager.mjs +216 -238
- package/pager/PagerInput.js +1 -1
- package/pager/PagerInput.mjs +25 -29
- package/pager/PagerNumericButtons.js +1 -1
- package/pager/PagerNumericButtons.mjs +68 -95
- package/pager/PagerPageSizes.js +1 -1
- package/pager/PagerPageSizes.mjs +24 -29
- package/pager/utils.js +8 -0
- package/pager/utils.mjs +31 -0
- package/selection/TableSelection.mjs +17 -20
package/index.d.ts
CHANGED
|
@@ -33,7 +33,7 @@ export declare interface BasePageChangeEvent {
|
|
|
33
33
|
/**
|
|
34
34
|
* A React Synthetic Event.
|
|
35
35
|
*/
|
|
36
|
-
syntheticEvent?:
|
|
36
|
+
syntheticEvent?: React.SyntheticEvent<any>;
|
|
37
37
|
/**
|
|
38
38
|
* A native DOM event.
|
|
39
39
|
*/
|
|
@@ -1038,7 +1038,7 @@ export declare interface FilterComponentProps extends FilterCellProps {
|
|
|
1038
1038
|
*/
|
|
1039
1039
|
ariaLabel?: string;
|
|
1040
1040
|
/**
|
|
1041
|
-
* @hidden
|
|
1041
|
+
* @ hidden
|
|
1042
1042
|
*/
|
|
1043
1043
|
min?: number;
|
|
1044
1044
|
/**
|
|
@@ -1656,11 +1656,11 @@ export declare interface PageChangeEvent extends BasePageChangeEvent {
|
|
|
1656
1656
|
/**
|
|
1657
1657
|
* An event target.
|
|
1658
1658
|
*/
|
|
1659
|
-
target:
|
|
1659
|
+
target: PagerHandle;
|
|
1660
1660
|
/**
|
|
1661
1661
|
* A React Synthetic Event.
|
|
1662
1662
|
*/
|
|
1663
|
-
syntheticEvent:
|
|
1663
|
+
syntheticEvent: React.SyntheticEvent<any>;
|
|
1664
1664
|
/**
|
|
1665
1665
|
* A native DOM event.
|
|
1666
1666
|
*/
|
|
@@ -1671,63 +1671,17 @@ export declare interface PageChangeEvent extends BasePageChangeEvent {
|
|
|
1671
1671
|
targetEvent: PagerTargetEvent;
|
|
1672
1672
|
}
|
|
1673
1673
|
|
|
1674
|
-
export declare
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
*/
|
|
1678
|
-
static propTypes: {
|
|
1679
|
-
className: PropTypes.Requireable<string>;
|
|
1680
|
-
style: PropTypes.Requireable<object>;
|
|
1681
|
-
total: PropTypes.Validator<number>;
|
|
1682
|
-
skip: PropTypes.Validator<number>;
|
|
1683
|
-
take: PropTypes.Validator<number>;
|
|
1684
|
-
buttonCount: PropTypes.Requireable<number>;
|
|
1685
|
-
info: PropTypes.Requireable<boolean>;
|
|
1686
|
-
type: PropTypes.Requireable<string>;
|
|
1687
|
-
pageSizes: PropTypes.Requireable<(NonNullable<string | number | null | undefined> | null | undefined)[]>;
|
|
1688
|
-
previousNext: PropTypes.Requireable<boolean>;
|
|
1689
|
-
onPageChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1690
|
-
messagesMap: PropTypes.Requireable<(...args: any[]) => any>;
|
|
1691
|
-
size: PropTypes.Requireable<string | null>;
|
|
1692
|
-
dir: PropTypes.Requireable<string>;
|
|
1693
|
-
disabled: PropTypes.Requireable<boolean>;
|
|
1694
|
-
};
|
|
1695
|
-
/**
|
|
1696
|
-
* @hidden
|
|
1697
|
-
*/
|
|
1698
|
-
static defaultProps: {
|
|
1699
|
-
buttonCount: number;
|
|
1700
|
-
info: boolean;
|
|
1701
|
-
type: string;
|
|
1702
|
-
size: string;
|
|
1703
|
-
disabled: boolean;
|
|
1704
|
-
};
|
|
1705
|
-
private _element;
|
|
1706
|
-
private get isRtl();
|
|
1707
|
-
private get currentPage();
|
|
1708
|
-
/**
|
|
1709
|
-
* Returns the HTML element of the Pager component.
|
|
1710
|
-
*/
|
|
1711
|
-
get element(): HTMLDivElement | null;
|
|
1712
|
-
constructor(props: PagerProps);
|
|
1713
|
-
/**
|
|
1714
|
-
* @hidden
|
|
1715
|
-
*/
|
|
1716
|
-
componentDidMount(): void;
|
|
1674
|
+
export declare const Pager: React_2.ForwardRefExoticComponent<PagerProps & React_2.RefAttributes<PagerHandle>>;
|
|
1675
|
+
|
|
1676
|
+
export declare interface PagerHandle {
|
|
1717
1677
|
/**
|
|
1718
|
-
*
|
|
1678
|
+
* Represents the element of the Pager component.
|
|
1719
1679
|
*/
|
|
1720
|
-
|
|
1680
|
+
element: HTMLDivElement | null;
|
|
1721
1681
|
/**
|
|
1722
|
-
*
|
|
1682
|
+
* Represents the props of the Pager component.
|
|
1723
1683
|
*/
|
|
1724
|
-
|
|
1725
|
-
private onPageChange;
|
|
1726
|
-
private renderButton;
|
|
1727
|
-
private get totalPages();
|
|
1728
|
-
private changePage;
|
|
1729
|
-
private onWindowResize;
|
|
1730
|
-
private onKeyDown;
|
|
1684
|
+
props: Readonly<PagerProps>;
|
|
1731
1685
|
}
|
|
1732
1686
|
|
|
1733
1687
|
export declare interface PagerProps {
|
|
@@ -1750,7 +1704,7 @@ export declare interface PagerProps {
|
|
|
1750
1704
|
/**
|
|
1751
1705
|
* The styles that are applied to the Pager.
|
|
1752
1706
|
*/
|
|
1753
|
-
style?:
|
|
1707
|
+
style?: React.CSSProperties;
|
|
1754
1708
|
/**
|
|
1755
1709
|
* Sets the maximum numeric buttons count before the buttons are collapsed.
|
|
1756
1710
|
*/
|
|
@@ -1820,15 +1774,6 @@ export declare interface PagerProps {
|
|
|
1820
1774
|
disabled?: boolean;
|
|
1821
1775
|
}
|
|
1822
1776
|
|
|
1823
|
-
/**
|
|
1824
|
-
* @hidden
|
|
1825
|
-
*/
|
|
1826
|
-
declare interface PagerState {
|
|
1827
|
-
showPagerSizes?: boolean;
|
|
1828
|
-
showPagerInfo?: boolean;
|
|
1829
|
-
innerNavigateActive?: boolean;
|
|
1830
|
-
}
|
|
1831
|
-
|
|
1832
1777
|
/**
|
|
1833
1778
|
* A Pager target event.
|
|
1834
1779
|
*/
|
|
@@ -1946,7 +1891,7 @@ export declare const setSelectedState: (options: {
|
|
|
1946
1891
|
/**
|
|
1947
1892
|
* The settings for sorting the component data.
|
|
1948
1893
|
*/
|
|
1949
|
-
export declare type SortSettings = boolean | ColumnSortSettings & {
|
|
1894
|
+
export declare type SortSettings = boolean | (ColumnSortSettings & {
|
|
1950
1895
|
/**
|
|
1951
1896
|
* The sort mode of the component.
|
|
1952
1897
|
*
|
|
@@ -1955,7 +1900,7 @@ export declare type SortSettings = boolean | ColumnSortSettings & {
|
|
|
1955
1900
|
* - `multiple`
|
|
1956
1901
|
*/
|
|
1957
1902
|
mode?: 'single' | 'multiple';
|
|
1958
|
-
};
|
|
1903
|
+
});
|
|
1959
1904
|
|
|
1960
1905
|
/**
|
|
1961
1906
|
* @hidden
|
|
@@ -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=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}
|
|
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}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;
|
|
@@ -38,7 +38,16 @@ const M = (e) => {
|
|
|
38
38
|
f && f === l.current.activeId && (o.current.activeElementIsFocused = !0);
|
|
39
39
|
}
|
|
40
40
|
}, Z = (e) => {
|
|
41
|
-
const {
|
|
41
|
+
const {
|
|
42
|
+
scope: l,
|
|
43
|
+
contextStateRef: o,
|
|
44
|
+
navigationStateRef: n,
|
|
45
|
+
focusFirst: i,
|
|
46
|
+
newEditableRow: f,
|
|
47
|
+
singleEditRow: c,
|
|
48
|
+
lastActiveElement: v,
|
|
49
|
+
navigatable: a
|
|
50
|
+
} = e;
|
|
42
51
|
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
52
|
if (!t.getActiveNavDataElement(l, o.current.activeId)) {
|
|
44
53
|
const E = l.className.indexOf("k-treelist") === -1 ? T(n.current.navigationMatrix) : n.current.navigationMatrix[0][0], I = t.getActiveNavDataElement(l, E);
|
|
@@ -63,12 +72,7 @@ const M = (e) => {
|
|
|
63
72
|
}
|
|
64
73
|
}, te = async (e, l) => {
|
|
65
74
|
var N, p, R, A;
|
|
66
|
-
const {
|
|
67
|
-
contextStateRef: o,
|
|
68
|
-
navigationStateRef: n,
|
|
69
|
-
onNavigationAction: i,
|
|
70
|
-
columns: f
|
|
71
|
-
} = l;
|
|
75
|
+
const { contextStateRef: o, navigationStateRef: n, onNavigationAction: i, columns: f } = l;
|
|
72
76
|
if (e.isDefaultPrevented() || !o.current || !n.current)
|
|
73
77
|
return;
|
|
74
78
|
let c;
|
|
@@ -105,7 +109,10 @@ const M = (e) => {
|
|
|
105
109
|
const d = (R = a.closest(".k-table-td")) == null ? void 0 : R.classList.contains("k-grid-edit-cell");
|
|
106
110
|
if (e.keyCode === s.esc) {
|
|
107
111
|
a.focus(), a.blur();
|
|
108
|
-
const r = v && v.parentElement && v.parentElement.closest(".k-grid-edit-row"), g = t.getClosestCellNavId(a), b = await t.waitForElementToBeVisible(
|
|
112
|
+
const r = v && v.parentElement && v.parentElement.closest(".k-grid-edit-row"), g = t.getClosestCellNavId(a), b = await t.waitForElementToBeVisible(
|
|
113
|
+
`[data-keyboardnavid='${g}']:not(.k-grid-edit-cell)`,
|
|
114
|
+
r
|
|
115
|
+
);
|
|
109
116
|
b && b.focus();
|
|
110
117
|
} else if (e.keyCode === s.enter) {
|
|
111
118
|
let r;
|
|
@@ -166,10 +173,9 @@ const M = (e) => {
|
|
|
166
173
|
prevElement: a
|
|
167
174
|
});
|
|
168
175
|
return;
|
|
169
|
-
} else {
|
|
170
|
-
a.querySelector(".k-filtercell") && l.navigatable && S(a), c = t.getFocusableElements(a)[0], t.focusElement({ elementForFocus: c, event: e, contextStateRef: o, prevElement: a });
|
|
171
|
-
return;
|
|
172
176
|
}
|
|
177
|
+
a.querySelector(".k-filtercell") && l.navigatable && S(a), c = t.getFocusableElements(a)[0], t.focusElement({ elementForFocus: c, event: e, contextStateRef: o, prevElement: a });
|
|
178
|
+
return;
|
|
173
179
|
}
|
|
174
180
|
if (e.keyCode === s.home && u)
|
|
175
181
|
if (k)
|
|
@@ -182,7 +188,10 @@ const M = (e) => {
|
|
|
182
188
|
e
|
|
183
189
|
);
|
|
184
190
|
else {
|
|
185
|
-
const d = W(
|
|
191
|
+
const d = W(
|
|
192
|
+
n.current.navigationMatrix,
|
|
193
|
+
u[0]
|
|
194
|
+
);
|
|
186
195
|
c = t.getActiveNavDataElement(x, d), t.focusElement({ elementForFocus: c, event: e, contextStateRef: o });
|
|
187
196
|
}
|
|
188
197
|
if (e.keyCode === s.end && u)
|
|
@@ -190,7 +199,10 @@ const M = (e) => {
|
|
|
190
199
|
const d = $(n.current.navigationMatrix);
|
|
191
200
|
c = t.getActiveNavDataElement(x, d), t.focusElement({ elementForFocus: c, event: e, contextStateRef: o });
|
|
192
201
|
} else {
|
|
193
|
-
const d = _(
|
|
202
|
+
const d = _(
|
|
203
|
+
n.current.navigationMatrix,
|
|
204
|
+
u[0]
|
|
205
|
+
);
|
|
194
206
|
c = t.getActiveNavDataElement(x, d), t.focusElement({ elementForFocus: c, event: e, contextStateRef: o });
|
|
195
207
|
}
|
|
196
208
|
if (e.keyCode === s.up || e.keyCode === s.down || e.keyCode === s.left || e.keyCode === s.right) {
|
package/navigation/utils.mjs
CHANGED
|
@@ -51,11 +51,7 @@ const K = async (e) => {
|
|
|
51
51
|
const t = e.querySelector(".k-grid-edit-cell"), r = t && t.querySelector("input");
|
|
52
52
|
r ? r.focus() : t && t.firstChild.focus();
|
|
53
53
|
}, U = (e, t) => {
|
|
54
|
-
const {
|
|
55
|
-
scope: r,
|
|
56
|
-
navigationStateRef: n,
|
|
57
|
-
contextStateRef: o
|
|
58
|
-
} = e;
|
|
54
|
+
const { scope: r, navigationStateRef: n, contextStateRef: o } = e;
|
|
59
55
|
if (!n.current || !r)
|
|
60
56
|
return;
|
|
61
57
|
const l = Q(n.current.navigationMatrix), s = p(r, l);
|
|
@@ -69,9 +65,7 @@ const K = async (e) => {
|
|
|
69
65
|
const r = b.map((n) => n + `[${f}='${t.level}']`).join(",");
|
|
70
66
|
return Array.from(e.querySelectorAll(r));
|
|
71
67
|
}, H = (e = { level: 0 }) => {
|
|
72
|
-
const t = b.map(
|
|
73
|
-
(r) => r + `[${f}='${e.level}']`
|
|
74
|
-
).join(",");
|
|
68
|
+
const t = b.map((r) => r + `[${f}='${e.level}']`).join(",");
|
|
75
69
|
return (r) => r.matches(t);
|
|
76
70
|
}, x = (e) => {
|
|
77
71
|
const { elementForFocus: t, event: r, contextStateRef: n, prevElement: o } = e;
|
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: 1730217045,
|
|
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": "9.0.0-develop.
|
|
3
|
+
"version": "9.0.0-develop.10",
|
|
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",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
"sideEffects": false,
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"@progress/kendo-data-query": "^1.0.0",
|
|
26
|
-
"@progress/kendo-drawing": "^1.
|
|
26
|
+
"@progress/kendo-drawing": "^1.21.1",
|
|
27
27
|
"@progress/kendo-licensing": "^1.3.4",
|
|
28
|
-
"@progress/kendo-react-animation": "9.0.0-develop.
|
|
29
|
-
"@progress/kendo-react-buttons": "9.0.0-develop.
|
|
30
|
-
"@progress/kendo-react-common": "9.0.0-develop.
|
|
31
|
-
"@progress/kendo-react-dateinputs": "9.0.0-develop.
|
|
32
|
-
"@progress/kendo-react-dropdowns": "9.0.0-develop.
|
|
33
|
-
"@progress/kendo-react-inputs": "9.0.0-develop.
|
|
34
|
-
"@progress/kendo-react-intl": "9.0.0-develop.
|
|
35
|
-
"@progress/kendo-react-popup": "9.0.0-develop.
|
|
28
|
+
"@progress/kendo-react-animation": "9.0.0-develop.10",
|
|
29
|
+
"@progress/kendo-react-buttons": "9.0.0-develop.10",
|
|
30
|
+
"@progress/kendo-react-common": "9.0.0-develop.10",
|
|
31
|
+
"@progress/kendo-react-dateinputs": "9.0.0-develop.10",
|
|
32
|
+
"@progress/kendo-react-dropdowns": "9.0.0-develop.10",
|
|
33
|
+
"@progress/kendo-react-inputs": "9.0.0-develop.10",
|
|
34
|
+
"@progress/kendo-react-intl": "9.0.0-develop.10",
|
|
35
|
+
"@progress/kendo-react-popup": "9.0.0-develop.10",
|
|
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"
|
package/pager/Pager.js
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
8
|
+
"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const ke=require("react"),s=require("prop-types"),Ke=require("./PagerNumericButtons.js"),Le=require("./PagerInput.js"),ze=require("./PagerPageSizes.js"),De=require("@progress/kendo-react-buttons"),u=require("../messages/index.js"),Y=require("@progress/kendo-react-intl"),a=require("@progress/kendo-react-common"),qe=require("../package-metadata.js"),n=require("./utils.js");function Oe(o){const M=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const f in o)if(f!=="default"){const v=Object.getOwnPropertyDescriptor(o,f);Object.defineProperty(M,f,v.get?v:{enumerable:!0,get:()=>o[f]})}}return M.default=o,Object.freeze(M)}const i=Oe(ke),Z=600,we=768,B=i.forwardRef((o,M)=>{a.validatePackage(qe.packageMetadata);const{buttonCount:f=C.buttonCount,info:v=C.info,type:ee=C.type,size:m=C.size,disabled:y=C.disabled,total:h,skip:L,take:N,className:te,style:se,pageSizes:T,pageSizeValue:ae,previousNext:ne,responsive:R,messagesMap:l,dir:_,navigatable:b}=o,c=Y.useLocalization(),z=Y.useInternationalization(),P=i.useRef({element:null,props:o}),E=i.useRef(null);i.useImperativeHandle(P,()=>({get element(){return re()},props:o})),i.useImperativeHandle(M,()=>P.current);const re=()=>E.current,[A,D]=i.useState(!0),[oe,j]=i.useState(!0);i.useEffect(()=>(window.addEventListener("resize",q),q(),()=>{window.removeEventListener("resize",q)}),[]);const I=_==="rtl",g=Math.floor(L/N)+1,d=Math.ceil((h||0)/N),p=(t,e)=>{o.onPageChange&&t>0&&t<=d&&o.onPageChange({target:P.current,skip:(t-1)*o.take,take:o.take,syntheticEvent:e,nativeEvent:e.nativeEvent,targetEvent:e})},ie=t=>{const e=E.current,r=t.keyCode;!e||!b||((r===a.Keys.home||t.metaKey&&r===a.Keys.left)&&p(1,t),(r===a.Keys.end||t.metaKey&&r===a.Keys.right)&&p(d,t),document.activeElement===e?(r===a.Keys.enter&&(a.focusFirstFocusableChild(e),a.enableNavigatableContainer(e)),(r===a.Keys.left||r===a.Keys.up)&&p(g-1,t),(r===a.Keys.right||r===a.Keys.down)&&p(g+1,t)):(r===a.Keys.esc&&(e.focus(),a.disableNavigatableContainer(e)),a.keepFocusInContainer(t,e,a.TABBABLE_ELEMENTS)))},q=()=>{const t=E.current;if(!t||!R)return;const e=t.offsetWidth;e<Z?D(!1):e>=Z&&e<we?(j(!1),D(!0)):(j(!0),D(!0))},le=(t,e)=>{const r={target:P==null?void 0:P.current,syntheticEvent:e.syntheticEvent,nativeEvent:e.nativeEvent,targetEvent:e,...t};o.onPageChange&&o.onPageChange(r)},ge=n.getL10NMessage(u.pagerFirstPage,l),ce=n.getL10NMessage(u.pagerPreviousPage,l),ue=n.getL10NMessage(u.pagerNextPage,l),de=n.getL10NMessage(u.pagerLastPage,l),F=n.getL10NMessage(u.pagerInfo,l),$=n.getL10NMessage(u.pagerAriaKeyshortcuts,l),V=n.getL10NMessage(u.pagerPage,l),G=n.getL10NMessage(u.pagerOf,l),S=n.getL10NMessage(u.pagerTotalPages,l),fe=`${c.toLanguageString(V.messageKey,V.defaultMessage)} ${z.format(c.toLanguageString(S.messageKey,S.defaultMessage),[g])} ${c.toLanguageString(G.messageKey,G.defaultMessage)} ${z.format(c.toLanguageString(S.messageKey,S.defaultMessage),[d])}`,k=(t,e,r,O,w,x)=>i.createElement(De.Button,{fillMode:"flat",themeColor:"base",size:m,rounded:null,className:e,icon:O,svgIcon:w,title:r,role:"button","aria-disabled":x,tabIndex:b?-1:void 0,onClick:K=>{K.preventDefault(),p(t,K)}}),H=T&&i.createElement(ze.PagerPageSizes,{pageChange:le,pageSize:N,pageSizes:T,value:ae,messagesMap:l,size:m,navigatable:b}),W=v&&i.createElement("span",{className:"k-pager-info"},z.format(c.toLanguageString(F.messageKey,F.defaultMessage),[Math.min(L+1,h),Math.min(L+N,h),h])),me=ee==="numeric"?i.createElement(Ke.PagerNumericButtons,{type:R&&!A?"dropdown":"numbers",buttonCount:f||0,totalPages:d,currentPage:g,pageChange:p,messagesMap:l,size:m,navigatable:b}):i.createElement(Le.PagerInput,{buttonCount:f||0,totalPages:d,currentPage:g,pageChange:p,messagesMap:l,size:m,navigatable:b});let U,J,Q,X;if(ne){const t=n.translateMessage(c,ge),{rtlClass:e,rtlIcon:r,isDisabledClass:O,isDisabled:w}=n.getFirstButtonProps(I,g,y);U=k(1,O,t,e,r,w);const x=n.translateMessage(c,ce),{rtlClass:K,rtlIcon:pe,isDisabledClass:be,isDisabled:Pe}=n.getPrevButtonProps(I,g,y);J=k(g-1,be,x,K,pe,Pe);const Me=n.translateMessage(c,ue),{rtlClass:ye,rtlIcon:Ce,isDisabledClass:ve,isDisabled:he}=n.getNextButtonProps(I,g,d,y);Q=k(g+1,ve,Me,ye,Ce,he);const Ne=n.translateMessage(c,de),{rtlClass:Re,rtlIcon:Ee,isDisabledClass:Ie,isDisabled:Se}=n.getLastButtonProps(I,g,d,y);X=k(d,Ie,Ne,Re,Ee,Se)}return i.createElement("div",{ref:E,className:a.classNames("k-pager",{[`k-pager-${a.kendoThemeMaps.sizeMap[m]||m}`]:m,"k-disabled":y},te),style:se,role:"application","aria-roledescription":"pager",dir:_,"aria-keyshortcuts":c.toLanguageString($.messageKey,$.defaultMessage),"aria-label":fe,tabIndex:b?0:void 0,onKeyDown:ie},i.createElement("div",{className:a.classNames("k-pager-numbers-wrap")},U,J,me,Q,X),R?A&&H:H,R?oe&&W:W)}),C={buttonCount:10,info:!0,type:"numeric",size:"medium",disabled:!1};B.displayName="Pager";B.propTypes={className:s.string,style:s.object,total:s.number.isRequired,skip:s.number.isRequired,take:s.number.isRequired,buttonCount:s.number,info:s.bool,type:s.oneOf(["numeric","input"]),pageSizes:s.oneOfType([s.arrayOf(s.number.isRequired),s.arrayOf(s.oneOfType([s.number.isRequired,s.string.isRequired]).isRequired)]),previousNext:s.bool,onPageChange:s.func,messagesMap:s.func,size:s.oneOf([null,"small","medium","large"]),dir:s.string,disabled:s.bool};exports.Pager=B;
|