0.5.0 • Published 5 years ago

@pndr/collaborator-field v0.5.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

CollaboratorField CollaboratorField

npm package

Used for selecting a collaborator.

Getting started

npm install @cmds/collaborator-field --save

Prop Types

PropertyTypeRequired?Description
idStringUnique id for the instance of this field
contextIdContextThe appearance will change depending on context in which the field is displayed. Valid options include: recordDetail or recordGridRow or recordGalleryCard or recordListItem
roleIdRoleThe behaviour changes based on the role. Valid options include editor or readOnly
collaboratorsArrayList of collaborators that can be selected
collaboratorIdStringSelected collaborator
onChangeFunctionCallback 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.