Skip to content

DisplayPanel Component ​

File Information ​

  • Path: components/dam/DisplayPanel.vue
  • Purpose: Dropdown panel that consolidates view-mode switching, thumbnail size control, and sort-by selection into a single "Display" button

Overview ​

A v-menu dropdown triggered by a "Display" button (gear icon + label). Used on search, folder detail, collage detail, and shared-assets pages to give users control over how content is displayed and sorted — all in one place rather than separate controls.

The panel has three conditional sections:

  1. View — icon toggle buttons for grid / list / mosaic (shown only when viewModes has entries)
  2. Thumbnail size — a 5-stop slider (Extra Small → Extra Large) shown only when mode === 'grid' and showThumbnailSize is true
  3. Sort by — a list of sort columns; clicking the active column flips ASC ↔ DESC, clicking a new column sets it to ASC

A fourth Properties section (column visibility checkboxes for list view) is implemented but commented out pending phase 5.

Props ​

PropTypeRequiredDefaultDescription
modeStringYes—Current view mode: 'grid', 'list', or 'mosaic'
viewModesArrayNo['grid', 'list']Which view mode buttons to show; pass [] to hide the View section
sortValueStringYes—Currently active sort field value
sortDirectionStringYes—'ASC' or 'DESC'
sortColumnsArrayYes—Array of { value, text } or { value, label } objects defining sort options
visibleColumnsArrayNo[]Active column keys (Properties section — currently hidden)
columnOptionsArrayNo[]Available column definitions (Properties section — currently hidden)
thumbnailSizeStringNo'medium'Current thumbnail size: 'xsmall', 'small', 'medium', 'large', 'xlarge'
showThumbnailSizeBooleanNotrueWhether to show the thumbnail size slider

Events ​

EventPayloadWhen
change-view'grid' | 'list' | 'mosaic'User clicks a view mode icon button
sort{ field: string, direction: 'ASC' | 'DESC' }User clicks a sort column
change-thumbnail-size'xsmall' | 'small' | 'medium' | 'large' | 'xlarge'User moves the size slider
update:visibleColumnsstring[]Column visibility toggled (Properties — hidden, future)

Sort Logic ​

Clicking an already-active sort field flips the direction. Clicking a new field always starts ASC.

javascript
// Inside handleSort(field):
if (field === this.sortValue) {
  direction = this.sortDirection === 'DESC' ? 'ASC' : 'DESC'
} else {
  direction = 'ASC'
}
this.$emit('sort', { field, direction })

The parent is responsible for persisting the selection (typically via sort-preference-cache mixin).

Thumbnail Size Slider ​

Maps a 0–4 integer slider to named sizes:

Slider indexSize label
0Extra Small
1Small
2Medium (default)
3Large
4Extra Large

Usage ​

vue
<DisplayPanel
  :mode="viewMode"
  :view-modes="['grid', 'list', 'mosaic']"
  :sort-value="sortValue"
  :sort-direction="sortDirection"
  :sort-columns="sortColumns"
  :thumbnail-size="thumbnailSize"
  @change-view="viewMode = $event"
  @sort="onSort"
  @change-thumbnail-size="onThumbnailSizeChange"
/>

Pages That Use It ​

  • pages/_workspace_id/dam/search.vue — search results (grid/list/mosaic + sort)
  • pages/_workspace_id/dam/folders/_id/index.vue — folder detail
  • pages/_workspace_id/dam/collage/_id/index.vue — collage detail
  • pages/shared-assets/_type.vue and pages/_brand_name/shared-assets/_type.vue — shared assets