@pndr/collaborator-field
v0.5.0
Published
Used for selecting a collaborator.
Downloads
3
Readme
CollaboratorField
Used for selecting a collaborator.
Getting started
npm install @cmds/collaborator-field --save
Prop Types
| Property | Type | Required? | Description |
|:---|:---|:---:|:---|
| id | String | ✓ | Unique id for the instance of this field |
| contextId | Context | ✓ | The appearance will change depending on context in which the field is displayed. Valid options include: recordDetail
or recordGridRow
or recordGalleryCard
or recordListItem
|
| roleId | Role | ✓ | The behaviour changes based on the role. Valid options include editor
or readOnly
|
| collaborators | Array | ✓ | List of collaborators that can be selected |
| collaboratorId | String | | Selected collaborator |
| onChange | Function | | Callback invoked whenever a collaborator get's selected: ({id: string, collaboratorId: string}): void
|
import CollaboratorField from '@cmds/collaborator-field'
<CollaboratorField
id={'fld1'}
contextId={'recordGalleryCard'}
roleId={'readOnly'}
collaborators={[{
id: 'col1',
name: 'Luke Skywalker'
}, {
id: 'col2',
name: 'Leia Organa'
}]}
collaboratorId={'col1'}
onChange={({id, collaboratorId}) => {
// do something
}}
/>
More information
This component is designed and developed as part of Cosmos Design System.