Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@commercetools-uikit/data-table-manager

Package Overview
Dependencies
Maintainers
3
Versions
938
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@commercetools-uikit/data-table-manager

> THIS COMPONENT IS IN BETA! > Please be aware that it may be subject to upcoming breaking changes as it's still in active development.

  • 0.0.0-canary-2020714161036
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.6K
decreased by-30.57%
Maintainers
3
Weekly downloads
 
Created
Source

DataTableManager

THIS COMPONENT IS IN BETA! Please be aware that it may be subject to upcoming breaking changes as it's still in active development.


Description

This component enhances the <DataTable> component and additionally provides a UI and state management to handle configuration of the table such as column manager.

  • The disableDisplaySettings enables / disables the display settings panel, allowing the user to select wrapping text and density display options.
  • The disableColumnManager enables / disables the column manager panel, allowing the user to select which columns are visible.

Both panels delegate the handling of the settings change on the parent through function properties, allowing the settings to be persisted or just used as state props.

Usage

import DataTableManager from '@commercetools-uikit/data-table-manager';
import DataTable from '@commercetools-uikit/data-table';

const rows = [
  { id: 'parasite', title: 'Parasite', country: 'South Korea' },
  { id: 'portrait', title: 'Portrait of a Lady on Fire', country: 'France' },
  { id: 'wat', title: 'Woman at War', country: 'Iceland' },
];

const columns = [
  { key: 'title', label: 'Title' },
  { key: 'country', label: 'Country' },
];

return (
  <DataTableManager columns={columns}>
    <DataTable rows={rows} />
  </DataTableManager>
);

Properties

Check the DataTable properties here

PropsTypeRequiredDefaultDescription
topBarnode--Node element to place on the left corner of the table settings dropdown option row.
displaySettingsobject--Object containing the properties for the display settings management.
columnManagerobject--Object containing the properties for the column manager.
onSettingsChangefunc--Function triggered when any of the properties within displaySettings or columnManager is modified. Should implement the following interface: (action: string, nextValue: object): void

Display Settings

An object containing the properties to handle text-wrapping and density-display options over the table

PropsTypeRequiredDefaultDescription
disableDisplaySettingsbool-trueEnable this flag to enable display settings panel option.
isCondensedboolean-falseSet this to true to reduce the paddings of all cells, allowing the Table to display more data in less space. Required if disableDisplaySettings is set to true.
isWrappingTextboolean-falseSet this to true to set truncation on all cells. Required if disableDisplaySettings is set to true.
primaryButtonPrimaryButton--UIKit Primary Button element to set at the bottom right to be used as primary action in case the display settings is working as a form.
secondaryButtonSecondaryButton--UIKit Secondary Button element to set at the bottom right to be used as secondary action in case the display settings is working as a form.

Column Manager

An object containing the properties to handle the visibility of the columns and the order in which are shown over the table

PropsTypeRequiredDefaultDescription
disableColumnManagerbool-trueEnable this flag to enable column manager panel option.
visibleColumnKeysarray of string--Visible columns keys. Required if disableColumnManager is true.
hideableColumnsarray of object--Columns to be managed by the column manager. Required if disableColumnManager is true.
areHiddenColumnsSearchablebool--Enable this flag to set a search input for the hidden columns panel.
searchHiddenColumnsfunc--Function called when the search input for the hidden columns change.
searchHiddenColumnsPlaceholderstring--Placeholder for the search input for the hidden columns.
primaryButtonPrimaryButton--UIKit Primary Button element to set at the bottom right to be used as primary action in case the display settings is working as a form.
secondaryButtonSecondaryButton--UIKit Secondary Button element to set at the bottom right to be used as secondary action in case the display settings is working as a form.

FAQs

Package last updated on 14 Aug 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc