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

@paprika/action-bar

Package Overview
Dependencies
Maintainers
4
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@paprika/action-bar

ActionBar

  • 8.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

@paprika/action-bar

Description

ActionBar

Installation

yarn add @paprika/action-bar

or with npm:

npm install @paprika/action-bar

Props

ActionBar

PropTyperequireddefaultDescription
childrennodetrue-

ActionBar.ColumnsArrangement

PropTyperequireddefaultDescription
childrennodetrue-
orderedColumnIdsarrayOftrue-
onChangeOrderfunctrue-
onChangeVisibilityfunctrue-
onHideAllfunctrue-
onShowAllfunctrue-
renderTriggerButtonfuncfalsenull

ActionBar.Sort

PropTyperequireddefaultDescription
appliedNumbernumberfalse0
childrennodefalsenull
columnsarrayOftrue-
isAddSortDisabledboolfalsefalse
onAddSortfunctrue-
onApplyfunctrue-
onCancelfuncfalse() => {}
onClosefuncfalse() => {}
onOpenfuncfalse() => {}

Action Bar

Action Bar component contains 2 individual widgets.

<Sort /> and <ColumnsArrangement />

Installation

> npm install --save @paprika/action-bar or > yarn add @paprika/action-bar

Usage

Sort
<Sort appliedNumber={appliedNumber} columns={columns} onAddSort={onAddSort} onApply={onApply}>
  <Sort.Field id={fieldId} onDelete={handleDelete} onChange={handleChange} isFirst />
  <Sort.Field id={fieldId} onDelete={handleDelete} onChange={handleChange} isFirst={false} />
</Sort>

More detail about props

You can also use the hook useSort

const { appliedNumber, sortedFields, sortedData, onAddSort, onDeleteSort, onChangeSort, onApply } = useSort({
  columns,
});

const handleDelete = fieldId => () => {
  onDeleteSort(fieldId);
};

const handleChange = fieldId => params => {
  onChangeSort({ ...params, id: fieldId });
};

return (
  <Sort appliedNumber={appliedNumber} columns={columns} onAddSort={onAddSort} onApply={onApply}>
    {sortedFields.map((field, index) => (
      <Sort.Field
        key={field.id}
        {...field}
        onDelete={handleDelete(field.id)}
        onChange={handleChange(field.id)}
        isFirst={index === 0}
      />
    ))}
  </Sort>

  // display sortedData
);
ColumnsArrangement
<ColumnsArrangement
  columns={orderedColumns}
  onChangeOrder={handleChangeOrder}
  onHideAll={handleHideAll}
  onShowAll={handleShowAll}
  onChangeVisibility={handleChangeVisibility}
/>

More detail about props

You can also use the hook useColumnsArrangement

const {
  orderedColumnIds,
  onChangeVisibility,
  onShowAll,
  onHideAll,
  onChangeOrder,
  isColumnHidden,
} = useColumnsArrangement({ defaultOrderedColumnIds });

return (
  <ColumnsArrangement
    orderedColumnIds={orderedColumnIds}
    onChangeOrder={onChangeOrder}
    onHideAll={onHideAll}
    onShowAll={onShowAll}
    onChangeVisibility={onChangeVisibility}
  >
    <ColumnsArrangement.ColumnDefinition
      id="columnId"
      label="Column label"
      isDisabled={false}
      isHidden={isColumnHidden("columnId")}
    />
  </ColumnsArrangement>
);

FAQs

Package last updated on 06 Jan 2024

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