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
registerIdString✓—OpenRegister register UUID
schemaIdString✓—OpenRegister schema UUID
objectIdString✓—Object 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-added—Emitted after a note has been successfully created
note-deleted—Emitted after a note has been successfully deleted
show-all—Emitted 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
registerIdstring✓—OpenRegister register ID
schemaIdstring✓—OpenRegister schema ID
objectIdstring✓—Object 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')Card header title.
addNoteLabelstring() =&gt; t('nextcloud-vue', 'Add note')Label for the submit button that creates a new note.
addNotePlaceholderstring() =&gt; t('nextcloud-vue', 'Write a note...')Placeholder shown inside the new-note textarea before any input.
noNotesLabelstring() =&gt; t('nextcloud-vue', 'No notes yet')Empty-state text shown when the object has zero notes.
showAllLabelstring() =&gt; t('nextcloud-vue', 'Show all')Label for the "Show all" button rendered when the note list is truncated.
deleteLabelstring() =&gt; t('nextcloud-vue', 'Delete note')Aria label for the per-note delete icon button.

Events​

NamePayloadDescription
show-all—
note-added—
note-deleted—