Skip to content

Commit

Permalink
creationMenu supports bool, string and object and removes the default…
Browse files Browse the repository at this point in the history
… value sortingOrder | Fixes #543
  • Loading branch information
matuzalemsteles committed Feb 16, 2018
1 parent 00ef67c commit 82fa178
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions packages/clay-management-toolbar/src/ClayManagementToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,24 @@ ClayManagementToolbar.STATE = {

/**
* Configuration of the plus button.
* Set `true` to just show the button.
* Set `string` to use the button URL.
* Set `object` to use the dropdown menu with items.
* @instance
* @memberof ClayManagementToolbar
* @type {?object|undefined}
* @type {?object|string|bool|undefined}
* @default undefined
*/
creationMenu: Config.shapeOf({
button: Config.object(),
caption: Config.string(),
helpText: Config.string(),
items: actionItemsValidator,
}),
creationMenu: Config.oneOfType([
Config.bool().value(false),
Config.string(),
Config.shapeOf({
button: Config.object(),
caption: Config.string(),
helpText: Config.string(),
items: actionItemsValidator,
}),
]),

/**
* CSS classes to be applied to the element.
Expand Down Expand Up @@ -283,9 +290,9 @@ ClayManagementToolbar.STATE = {
* @instance
* @memberof ClayManagementToolbar
* @type {?string|undefined}
* @default asc
* @default undefined
*/
sortingOrder: Config.oneOf(['asc', 'desc']).value('asc'),
sortingOrder: Config.oneOf(['asc', 'desc']),

/**
* The path to the SVG spritemap file containing the icons.
Expand Down

0 comments on commit 82fa178

Please sign in to comment.