Ga naar hoofdinhoud

CnTabsWidgetForm

The config sub-form for a tabs widget. Used by CnAddWidgetModal and the cog editor.

Why it exists

A bare widget picker would have been enough to choose which siblings become tabs. The form goes further because the tab strip is the only place a child's name appears: "Files and attachments" reads fine on a card and is too long once six tabs share the width. So each tab carries a label of its own, and leaving it empty falls back to the widget's own title.

Props

PropTypeDefaultDescription
contentObject{}The stored config: { tabs, ariaLabel }.
availableWidgetsArray[]Every widget definition on the surface, so the picker can offer the siblings this widget may hold.
widgetIdString''This widget's own id, so the picker cannot offer the tabs widget itself.

Events

EventPayloadDescription
update:contentobjectThe edited config blob.

Notes

  • The picker excludes this widget and every other container. A widget that contains itself never finishes rendering, and nesting a tab strip inside a tab strip gives the reader two rows of tabs with no way to tell which row owns the panel.
  • An empty label is deleted, not stored. Storing '' would render a blank tab; deleting the key falls the tab back to the child widget's own title.
  • Reordering the picker reorders the tabs. Labels already typed survive, because entries are matched by widgetId rather than by position.

See also

Props

NameTypeRequiredDefaultDescription
content{ tabs?: Array<{widgetId: string, label?: string, icon?: string}>, ariaLabel?: string }\{\}The widget's stored config: { tabs, ariaLabel }.
availableWidgetsobject[][]Every widget definition on the surface, so the picker can offer the siblings this widget may hold.
widgetIdstring''This widget's own id, so the picker cannot offer the tabs widget itself and produce a widget that contains itself.

Events

NamePayloadDescription
update:content
update:content Emitted with the edited config blob.