Ga naar hoofdinhoud

CnChipListManager

An admin card that keeps a list of words as chips. Each word is one OpenRegister object. An administrator adds a word, renames one by double-clicking it (or pressing F2), and deletes one after a confirm. Pipelinq uses it for the shared label list on Beheer, Marketing.

Wraps: CnSettingsSection, CnConfirmDialog

Usage​

<CnChipListManager
register="pipelinq"
schema="label"
:title="t('pipelinq', 'Labels')"
:description="t('pipelinq', 'The labels people can pick for articles, leads and clients.')"
rename-url="/apps/pipelinq/api/labels/{id}/rename"
:note="t('pipelinq', 'Double-click a label to rename it. A deleted label stays on the items that already use it.')" />

The server decides who may change the list. A refused write shows as a line in the card and the list stays as it was.

Props​

PropTypeDefaultNotes
registerStringrequiredOpenRegister register slug or id.
schemaStringrequiredOpenRegister schema slug or id; one object per word.
fieldString'name'The property that holds the word.
titleString''The card's title.
descriptionString''The line under the title.
noteString''A line under the form. Hidden when read only.
renameUrlString''POST endpoint for a rename, {id} filled, body { name }. Without it a rename updates the object.
addLabelString'New item'The label above the new-word field.
placeholderString'Enter a name'The new-word field's placeholder.
submitLabelString'Add'The add button's text.
deleteMessageStringsays items keep the wordThe confirm sentence, {name} filled.
readOnlyBooleanfalseOnly list the words.
apiBaseString'/apps/openregister/api'The OpenRegister API base.

Events​

EventPayloadWhen
changednoneAfter a word was added, renamed or deleted.

Behaviour​

  • The words show in alphabetical order, whatever the case.
  • A name the list already has, in any case, is refused before any request.
  • Enter saves a rename, Escape drops it, leaving the field saves it.