2.2.4 • Published 4 months ago

@cubetiq/enhance-antd-table v2.2.4

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

CUBETIQ Enhance-Antd-Table

Stil Ant Design Table but more...

NPM JavaScript Style Guide

✨ Features

  • Columns Visibility.

Install

Antd v4

yarn add @cubetiq/enhance-antd-table@^1.0.10

Antd v5

yarn add @cubetiq/enhance-antd-table@^2.0.0

Usage

Full tutorial

import React, { Component } from 'react'

import EnhanceAntdTable from '@cubetiq/enhance-antd-table'

const Example = () => {
  return (
    <EnhanceAntdTable
      createButtonProps={{
        onClick: () => setModal(true)
      }}
      printButton={true}
      actionDelete={{
        onClick: () => console.log('render from action delete')
      }}
      actionDetails={{
        onClick: () => console.log('render from action details')
      }}
      renderOwnActionMenu={
        <Menu>
          <Menu.Item key={uuid()} icon={<DeleteOutlined />}>
            Delete
          </Menu.Item>
        </Menu>
      }
      bordered={true}
      newColumns={columns}
      newSources={data}
    />
  )
}

Props

  • Everything from AntdProps and plus+
import { props } from 'antd/es/table'
  • newColumnsInterface: Your table column but should include the interface from interface.
import { newColumnsInterface } from '@cubetiq/enhance-antd-table'

const columns: Array<newColumnsInterface> = [
  {
    title: 'name',
    dataIndex: 'name',
    key: 'name'
  }
]
  • newSources: Your sources data.
const data = [
  {
    key: '1',
    name: 'John Brown',
    age: 32,
    address: 'New York No. 1 Lake Park',
    tags: ['nice', 'developer']
  }
]
  • createButtonProps: Create button props.
<EnhanceAntdTable
  createButtonProps={{
    onClick: () => setModal(true)
  }}
/>
  • printButton: Do you need print in table or not?
	 printButton={true}
  • searchBy: Define the search by each column (Not available).
	  searchBy={"name"}
  • actionDetails: more props for action details.
	actionDetails={{
	  onClick: () => console.log('render from action delete')
	}}
  • actionDelete: more props for action delete.
	actionDetails={{
	  onClick: () => console.log('render from action delete')
	}}
  • renderOwnActionMenu: Render own action menu but will be overriden the default action menu.

  • Should use Menu and Menu. Item from ant-design.

	renderOwnActionMenu={
	 <Menu>
	    <Menu.Item key={uuid()} icon={<DeleteOutlined/>}>
	      Delete
	    </Menu.Item>
	 </Menu>
	}

License

MIT © 2023

2.2.4

4 months ago

2.2.1

7 months ago

2.2.0

7 months ago

2.2.3

6 months ago

2.2.2

7 months ago

2.1.9

12 months ago

2.1.8

1 year ago

2.1.4

1 year ago

2.1.6

1 year ago

2.1.5

1 year ago

2.1.7

1 year ago

2.1.3-d

1 year ago

2.0.0-a

1 year ago

2.1.3-b

1 year ago

2.1.3-a

1 year ago

2.1.2

1 year ago

2.1.3-c

1 year ago

2.1.1

1 year ago

2.1.3

1 year ago

2.0.0

1 year ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.7

2 years ago