Files
heroui-vue/apps/docs/demos/header-collection-grouping.vue
T
maoyingjie 145a208687 docs: close documentation facts, structure and related-component mapping
HD-04 scope, against heroui ce90ea3 cn sources:

- stale/fictional content: input.md no longer claims TextField is
  unmigrated; color-field.md no longer claims ColorPicker is private;
  header.md drops the fictional Header.Root subcomponent and the stale
  'menus not migrated' wording (MenuSection label registration is now
  documented from HeaderRoot source); radio-group.md drops three copied
  CheckboxGroup wordings (variant override is Radio's, scalar emits,
  native single-value submit); input-otp.md drops the fictional
  data-complete state and lists the real missing upstream props
- toggle-button disabled row now matches the real CSS hooks
  (:disabled / [aria-disabled], with data-disabled as a marker only)
- part API / CSS classes / interactive states restored per pinned
  sources: button (full class lists + real variable-based global CSS),
  accordion (per-part tables + variant/state lists), card (per-part
  tables + variant list), switch (SwitchGroup snippet + Switch/
  SwitchGroup class lists + states), color-field Group (class list +
  states), input-otp (variant notes, global CSS, class/state lists);
  input-group gains the two upstream usage chapters
- RelatedComponents restored from the pinned componentRelationships
  (first-3, filtered against componentsMap): 64 pages rewritten,
  list-box/slider sections added, 7 empty-mapping pages' fabricated
  entries removed; RelatedShowcases left unmigrated with its real data
  inventory recorded (2 cases, showcase-site cards)
- defaults unified on implementation evidence: granularity (inferred
  day/minute) and visibleYears (full min-max span, no "or 20" fallback);
  HD-03 hand-offs resolved (trigger focus-visible noted for HD-06,
  width guards kept)
- new demos: header-collection-grouping (MenuSection/ListBoxSection
  label wiring), empty-state-collection (collection empty slot);
  empty-state page deduplicated with a boundary compatibility note
- ComponentPreview minHeight/isBgSolid restored per the 30 upstream
  marks; tabs-overflow max-w-full kept after measuring internal scroll
- tests: +3 header registration/demo cases, +1 empty-state collection
  case; full suite 110 files / 1630 tests, typecheck and build:docs
  pass
2026-10-28 22:32:10 +08:00

96 lines
2.4 KiB
Vue

<script setup lang="ts">
import {
Button,
DropdownItem,
DropdownMenu,
DropdownPopover,
DropdownRoot,
DropdownSection,
DropdownTrigger,
Header,
ListBox,
ListBoxItem,
ListBoxSection,
} from "@heroui-vue/components";
const viewItems = [
{ id: "grid", label: "网格" },
{ id: "list", label: "列表" },
{ id: "detail", label: "详情" },
];
const sortItems = [
{ id: "name", label: "按名称" },
{ id: "date", label: "按日期" },
];
const todayItems = [
{ id: "standup", label: "站会纪要" },
{ id: "review", label: "代码评审" },
];
const weekItems = [
{ id: "plan", label: "周计划" },
{ id: "retro", label: "周回顾" },
];
</script>
<template>
<div class="flex flex-wrap items-start justify-center gap-8">
<DropdownRoot>
<DropdownTrigger>
<Button variant="secondary">视图设置</Button>
</DropdownTrigger>
<DropdownPopover>
<DropdownMenu aria-label="视图设置" class="min-w-[160px]">
<DropdownSection>
<Header>视图</Header>
<DropdownItem
v-for="item in viewItems"
:id="item.id"
:key="item.id"
:text-value="item.label"
>
{{ item.label }}
</DropdownItem>
</DropdownSection>
<DropdownSection>
<Header>排序</Header>
<DropdownItem
v-for="item in sortItems"
:id="item.id"
:key="item.id"
:text-value="item.label"
>
{{ item.label }}
</DropdownItem>
</DropdownSection>
</DropdownMenu>
</DropdownPopover>
</DropdownRoot>
<ListBox
aria-label="会议记录"
class="w-[180px] rounded-3xl p-2 shadow-surface"
selection-mode="none"
>
<ListBoxSection>
<Header>今天</Header>
<ListBoxItem
v-for="item in todayItems"
:id="item.id"
:key="item.id"
:text-value="item.label"
>
{{ item.label }}
</ListBoxItem>
</ListBoxSection>
<ListBoxSection>
<Header>本周</Header>
<ListBoxItem
v-for="item in weekItems"
:id="item.id"
:key="item.id"
:text-value="item.label"
>
{{ item.label }}
</ListBoxItem>
</ListBoxSection>
</ListBox>
</div>
</template>