Skip to content

Commit

Permalink
Update ToolsPanel docs to reflect latest state
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Sep 2, 2021
1 parent 23c101d commit 730c02c
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 6 deletions.
37 changes: 37 additions & 0 deletions packages/components/src/tools-panel/tools-panel-item/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ for how to use `ToolsPanelItem`.

## Props

### `hasValue`: `function`

This is called when building the `ToolsPanel` menu to determine the item's
initial checked state.

- Required: Yes

### `isShownByDefault`: `boolean`

This prop identifies the current item as being displayed by default. This means
Expand All @@ -37,3 +44,33 @@ determine if the panel item should be displayed.
A panel item's `label` should be unique among all items within a single panel.

- Required: Yes

### `onDeselect`: `function`

Called when this item is deselected in the `ToolsPanel` menu. This is normally
used to reset the panel item control's value.

- Required: No

### `onSelect`: `function`

A callback to take action when this item is selected in the `ToolsPanel` menu.

- Required: No

### `panelId`: `string`

This prop can be set to a ID representing a unique `ToolsPanel`. Before
attempting to register with a panel, each item will ensure that it belongs to
the current panel. This avoids issues when sharing SlotFills to inject items
into a panel.

- Required: No

### `resetAllFilter`: `function`

A `ToolsPanel` will collect each item's `resetAllFilter` and pass an array of
these function through to the panel's `resetAll` callback. They can then be
iterated over to perform additional tasks for items injected via SlotFills.

- Required: No
20 changes: 14 additions & 6 deletions packages/components/src/tools-panel/tools-panel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,29 @@ export function DimensionPanel( props ) {

## Props

### `header`: `string`

Text to be displayed within the panel's header.

- Required: Yes

### `label`: `string`

The label for the panel's dropdown menu.

- Required: Yes

### `resetAll`: `function`
### `panelId`: `function`

A function to call when the `Reset all` menu option is selected. This is passed
through to the panel's header component.
The `panelId` is passed through the `ToolsPanelContext` to panel items. This is
be used to ensure items injected via SlotFills are only registered for their
intended panels.

- Required: Yes
- Required: No

### `header`: `string`
### `resetAll`: `function`

Text to be displayed within the panel's header.
A function to call when the `Reset all` menu option is selected. This is passed
through to the panel's header component.

- Required: Yes

0 comments on commit 730c02c

Please sign in to comment.