Socket
Book a DemoInstallSign in
Socket

@ied/cell-table

Package Overview
Dependencies
Maintainers
2
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ied/cell-table

## Install

latest
npmnpm
Version
1.0.0-beta.10
Version published
Maintainers
2
Created
Source

CellTable

Install

yarn add @ied/cell-table

Use

import { CellTable, CellRow } from '@ied/cell-table'

const App = () => (
  <CellTable>
    <CellRow>
      <input />
      <input />
      <input />
      <input />
    </CellRow>
    <CellRow>
      <input />
      <input />
      <input />
      <input />
    </CellRow>
    <CellRow>
      <input />
      <input />
      <input />
      <input />
    </CellRow>
  </CellTable>
)

Use with exposed methode

import { CellTable, CellRow } from '@ied/cell-table'

class App extends React.Component {
  render () {
    <CellTable>
      {({ getNext }) => (
        <>
          <CellRow>
            <button onClick={() => getNext(this.input, 'ArrowRight')}>Go next<button>
            <input ref={elm => this.input = elm}/>
            <input />
            <input />
          </CellRow>
          <CellRow>
            <input />
            <input />
            <input />
            <input />
          </CellRow>
          <CellRow>
            <input />
            <input />
            <input />
            <input />
          </CellRow>
        </>
      )}
    </CellTable>
  }
}

To avoid some inputs during navigation

import { CellTable, CellRow } from '@ied/cell-table'

class App extends React.Component {
  render () {
    <CellTable>
      {({ getNext }) => (
        <>
          <CellRow>
            <input />
            <input className="ied-cell-table-avoid-el" tabIndex="-1" />
            <input />
          </CellRow>
          <CellRow>
            <input />
            <input />
            <input />
            <input />
          </CellRow>
          <CellRow>
            <input />
            <input />
            <input />
            <input />
          </CellRow>
        </>
      )}
    </CellTable>
  }
}

Types

type Props = {
  children: React$Node || ({getNext: (input:HTMLInputElement, action: Action) => void }) => React$Node,
  className?: string,
  style?: {},
}

enum Action = {
  "Enter"
  "ArrowRight"
  "Escape"
  "ArrowLeft"
  "ArrowDown"
  "ArrowUp"
}

FAQs

Package last updated on 18 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts