0.4.0 • Published 5 years ago

@pndr/multiple-collaborator-field v0.4.0

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

MultipleCollaboratorField MultipleCollaboratorField

npm package

Used for selecting multiple collaborators.

Getting started

npm install @cmds/multiple-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
collaboratorIdsArrayList of selected collaborators
onCollaboratorLinkFunctionCallback invoked whenever a collaborator get's added to the selection: ({id: string, collaboratorId: string}): void
onCollaboratorUnlinkFunctionCallback invoked whenever a collaborator get's removed from the selection: ({id: string, collaboratorId: string}): void
import MultipleCollaboratorField from '@cmds/multiple-collaborator-field'

<MultipleCollaboratorField
    id={'fld1'}
    contextId={'recordGalleryCard'}
    roleId={'readOnly'}
    collaborators={[{
        id: 'col1',
        name: 'Luke Skywalker'
    }, {
        id: 'col2',
        name: 'Leia Organa'
    }]}
    collaboratorIds={['col1']}
    onCollaboratorLink={({id, collaboratorId}) => {
        // do something
    }}
    onCollaboratorUnlink={({id, collaboratorId}) => {
        // do something
    }}
/>

More information

This component is designed and developed as part of Cosmos Design System.