3.0.23 • Published 5 years ago

the-table v3.0.23

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

the-table

Build Status npm Version JS Standard

Table for the-components

Installation

$ npm install the-table --save

Usage

'use strict'

import React from 'react'
import { TheTable, TheTableStyle } from 'the-table'
import { TheInputStyle } from 'the-input'

const { Head, Body, Row, Cell, HeaderCell, CheckboxCell } = TheTable

class ExampleComponent extends React.PureComponent {
  constructor (props) {
    super(props)
    this.state = {
      row0: false,
      row1: false
    }
  }

  render () {
    const s = this
    const { state } = s
    return (
      <div>
        <TheTableStyle/>
        <TheInputStyle/>
        <TheTable>
          <Head>
            <Row>
              <HeaderCell
              />
              <HeaderCell>Name</HeaderCell>
              <HeaderCell>Number</HeaderCell>
              <HeaderCell></HeaderCell>
            </Row>
          </Head>
          <Body>
          <Row selected={state.row0}>
            <CheckboxCell value={state.row0}
                          name='row0'
                          onUpdate={(v) => s.setState(v)}
            >foo</CheckboxCell>
            <Cell>foo</Cell>
            <Cell>1234</Cell>
            <Cell/>
          </Row>

          <Row selected={state.row1}>
            <CheckboxCell value={state.row1}
                          name='row1'
                          onUpdate={(v) => s.setState(v)}
            >foo</CheckboxCell>
            <Cell>foo</Cell>
            <Cell>1234</Cell>
            <Cell/>
          </Row>
          </Body>
        </TheTable>

        <hr/>

        <TheTable empty
                  alt="This is an empty table!"
        />
      </div>

    )
  }
}

export default ExampleComponent

Components

TheTable

Table for the-components

Props

NameTypeDescriptionDefault
altnodeAlt for empty'Data Not found'
emptyboolShow as emptyfalse
widthboolShow as wide
role'grid'
widefalse

TheTableStyle

Style for TheTable

Props

NameTypeDescriptionDefault
optionsobjectStyle options{}

License

This software is released under the MIT License.

Links

3.0.23

5 years ago

3.0.22

5 years ago

3.0.21

5 years ago

3.0.20

5 years ago

3.0.19

5 years ago

3.0.18

5 years ago

3.0.16

5 years ago

3.0.15

6 years ago

3.0.14

6 years ago

3.0.13

6 years ago

3.0.12

6 years ago

3.0.11

6 years ago

3.0.10

6 years ago

3.0.9

6 years ago

3.0.8

6 years ago

3.0.7

6 years ago

3.0.6

6 years ago

3.0.5

6 years ago

3.0.4

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 years ago

2.0.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago