How to use the terra-table/lib/SelectableUtils.wrappedOnKeyDownForRow function in terra-table

To help you get started, we’ve selected a few terra-table examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cerner / terra-framework / packages / terra-infinite-table / src / InfiniteTable.jsx View on Github external
wrapChild(child, index) {
    const wrappedCallBack = (node) => {
      this.updateHeight(node, index);
      if (child.props.refCallback) {
        child.props.refCallback(node);
      }
    };

    let newProps = {};
    if (this.props.isSelectable) {
      const wrappedOnClick = SelectableUtils.wrappedOnClickForRow(child, index, this.props.onChange);
      const wrappedOnKeyDown = SelectableUtils.wrappedOnKeyDownForRow(child, index, this.props.onChange);
      newProps = SelectableUtils.newPropsForRow(child, index, wrappedOnClick, wrappedOnKeyDown, this.props.selectedIndexes, this.props.disableUnselectedItems);
    }

    newProps.refCallback = wrappedCallBack;
    newProps['data-infinite-table-index'] = index;
    newProps.style = child.props.style ? Object.assign({}, child.props.style, { overflow: 'hidden' }) : { overflow: 'hidden' };
    return React.cloneElement(child, newProps);
  }