@progress/kendo-react-grid 14.4.1-develop.1 → 14.4.1-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.
@@ -12,12 +12,14 @@ import * as React from 'react';
12
12
  */
13
13
  export declare const useSelectionCellClientTdProps: (props: GridCellProps) => {
14
14
  onContextMenu: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
15
+ onKeyDown: (event: React.KeyboardEvent<HTMLTableCellElement>) => void;
15
16
  style: any;
16
17
  tabIndex?: undefined;
17
18
  "data-keyboardnavlevel"?: undefined;
18
19
  "data-keyboardnavid"?: undefined;
19
20
  } | {
20
21
  onContextMenu: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
22
+ onKeyDown: (event: React.KeyboardEvent<HTMLTableCellElement>) => void;
21
23
  style: any;
22
24
  tabIndex: number;
23
25
  "data-keyboardnavlevel": number;
@@ -6,4 +6,4 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@progress/kendo-react-data-tools"),t=require("../hooks.js"),s=e=>{const n=l.useTableKeyboardNavigation(e.id),o=t.useContextMenuHandler(e.dataItem,e.field),i=t.usePositionStyle(e);return{...n,onContextMenu:o,style:i}};exports.useSelectionCellClientTdProps=s;
9
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),s=require("../../utils/GridContext.js"),m=require("@progress/kendo-react-data-tools"),c=require("@progress/kendo-react-common"),i=require("../hooks.js");function y(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const l=y(d),C=e=>{const t=l.useContext(s.GridContext),n=m.useTableKeyboardNavigation(e.id),o=i.useContextMenuHandler(e.dataItem,e.field),u=i.usePositionStyle(e),r=l.useCallback(a=>{(a.keyCode===c.Keys.enter||a.keyCode===c.Keys.space)&&(t==null||t.selectionChange({event:a,dataItem:e.dataItem,dataIndex:e.rowDataIndex,columnIndex:e.columnIndex}))},[t,e.dataItem,e.rowDataIndex,e.columnIndex]);return{...n,onContextMenu:o,onKeyDown:r,style:u}};exports.useSelectionCellClientTdProps=C;
@@ -6,16 +6,30 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  "use client";
9
- import { useTableKeyboardNavigation as i } from "@progress/kendo-react-data-tools";
10
- import { useContextMenuHandler as a, usePositionStyle as l } from "../hooks.mjs";
11
- const u = (t) => {
12
- const e = i(t.id), n = a(t.dataItem, t.field), o = l(t);
9
+ import * as o from "react";
10
+ import { GridContext as c } from "../../utils/GridContext.mjs";
11
+ import { useTableKeyboardNavigation as u } from "@progress/kendo-react-data-tools";
12
+ import { Keys as a } from "@progress/kendo-react-common";
13
+ import { useContextMenuHandler as r, usePositionStyle as s } from "../hooks.mjs";
14
+ const y = (e) => {
15
+ const t = o.useContext(c), d = u(e.id), i = r(e.dataItem, e.field), m = s(e), l = o.useCallback(
16
+ (n) => {
17
+ (n.keyCode === a.enter || n.keyCode === a.space) && (t == null || t.selectionChange({
18
+ event: n,
19
+ dataItem: e.dataItem,
20
+ dataIndex: e.rowDataIndex,
21
+ columnIndex: e.columnIndex
22
+ }));
23
+ },
24
+ [t, e.dataItem, e.rowDataIndex, e.columnIndex]
25
+ );
13
26
  return {
14
- ...e,
15
- onContextMenu: n,
16
- style: o
27
+ ...d,
28
+ onContextMenu: i,
29
+ onKeyDown: l,
30
+ style: m
17
31
  };
18
32
  };
19
33
  export {
20
- u as useSelectionCellClientTdProps
34
+ y as useSelectionCellClientTdProps
21
35
  };