2.0.0 • Published 1 year ago

ant-table-extensions v2.0.0

Weekly downloads
196
License
MIT
Repository
github
Last release
1 year ago

Extensions to Table component of React Ant Design

Ant Table Extensions

Installation

NOTE: This library works in a project already using React Ant Design. This library WILL NOT import ant styles for you and your project is expected to have them imported already. Visit ant official docs page for installation.

npm install ant-table-extensions

  (or)

yarn add ant-table-extensions
// Don't forget to import ant styles
- import { Table } from "antd";
+ import { Table } from "ant-table-extensions";

function App() {
  return <Table dataSource={dataSource} columns={columns} {..any other ant table props} />
}

Props

ant-table-extension adds extra props along with Ant's in-built table props.

PropDescriptionTypedefault
exportableAdds export to csv buttonbooleanfalse
searchableAdds search feature to tablebooleanfalse
exportablePropsCustomize the exportobjectnull
searchablePropsCustomize the searchobjectnull

Plus, All of the ant table props.

Prop types and their descriptions.

exportableProps

exportable: true is optional if exportableProps are given

PropDescriptionTypedefault
fileNameFile name in exporting csv file without extensionstringtable
fieldsCustomize csv file like column header names, columns to include/exclude. More on this below.objectnull
disabledDisable export button.booleanfalse
btnPropsAny of Ant button component props.objectnull
showColumnPickerShow a modal to pick which columns to export.booleanfalse
childrenReact Child node. But here can be used to change button text.ReactChild"Export to CSV"

Check types.ts for complete list.

searchableProps

searchable: true is optional if searchableProps are given

PropDescriptionTypedefault
debounceDebounce searchbooleantrue
inputPropsAnt Input box propsobject{}
fuzzySearchUse fuzzy search instead of exact matchbooleanfalse
fusePropsFuse.js options which is used for search by defaultobject{ keys: 'dataIndex' of columns : [], threshold: fuzzySearch ? 0.6 : 0.1 }
searchFunctionCustom search function. Takes (dataSource: any[], searchTerm: string) => filteredDataSourcefunctionnull

Check types.ts for complete list.

License

MIT - saisandeepvaddi

1.1.8-alpha1

1 year ago

2.0.0-alpha1

1 year ago

2.0.0-alpha2.0

1 year ago

2.0.0

1 year ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.5-beta.0

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.1.0-alpha

4 years ago