Ga naar hoofdinhoud

CnNotesCard

Inline notes widget for detail pages. Fetches notes from the OpenRegister API, shows the most recent entries (up to maxDisplay), and includes an add-note form. Author names are wrapped with CnUserActionMenu for quick communication. Own notes show a delete button on hover.

Wraps: CnDetailCard, CnUserActionMenu

Try it

Loading CnNotesCard playground…

Usage

<CnNotesCard
register-id="uuid-register"
schema-id="uuid-schema"
object-id="uuid-object"
@note-added="refreshSidebar"
@note-deleted="refreshSidebar"
@show-all="openSidebarNotesTab" />

Pass pre-translated labels when your app handles i18n:

<CnNotesCard
register-id="reg"
schema-id="schema"
object-id="obj"
:title-label="t('myapp', 'Notes')"
:add-note-label="t('myapp', 'Add note')"
:no-notes-label="t('myapp', 'No notes yet')"
:show-all-label="t('myapp', 'Show all')" />

Props

PropTypeRequiredDefaultDescription
registerIdStringOpenRegister register UUID
schemaIdStringOpenRegister schema UUID
objectIdStringObject UUID
apiBaseString'/apps/openregister/api'Base URL for OpenRegister API calls
maxDisplayNumber5Maximum number of notes to show before the "Show all" footer link appears
collapsibleBooleanfalseWhether the card supports collapse/expand
titleLabelString'Notes'Card title
addNoteLabelString'Add note'Submit button label
addNotePlaceholderString'Write a note...'Textarea placeholder
noNotesLabelString'No notes yet'Empty state text
showAllLabelString'Show all'Footer link label
deleteLabelString'Delete note'Accessible label for the delete button

Events

EventPayloadDescription
note-addedEmitted after a note has been successfully created
note-deletedEmitted after a note has been successfully deleted
show-allEmitted when the "Show all" footer link is clicked

Reference (auto-generated)

The tables below are generated from the SFC source via vue-docgen-cli. They reflect what's actually in CnNotesCard.vue and update automatically whenever the component changes.

Props

NameTypeRequiredDefaultDescription
registerIdstringOpenRegister register ID
schemaIdstringOpenRegister schema ID
objectIdstringObject UUID
apiBasestring'/apps/openregister/api'Base API URL for OpenRegister
maxDisplaynumber5Maximum number of notes to display
collapsiblebooleanfalseWhether the card is collapsible
titleLabelstring() =&gt; t('nextcloud-vue', 'Notes')
addNoteLabelstring() =&gt; t('nextcloud-vue', 'Add note')
addNotePlaceholderstring() =&gt; t('nextcloud-vue', 'Write a note...')
noNotesLabelstring() =&gt; t('nextcloud-vue', 'No notes yet')
showAllLabelstring() =&gt; t('nextcloud-vue', 'Show all')
deleteLabelstring() =&gt; t('nextcloud-vue', 'Delete note')

Events

NamePayloadDescription
show-all
note-added
note-deleted