<!-- GENERATED by scripts/build-llms.mjs from llms/agent-tools.md — do not edit this file. -->

# `lr-eval-dataset`

- **Import** `import '@aceshooting/lyra-ui/components/lr-eval-dataset.js';` (stable tag alias; registers the tag)
- **Class** `LyraEvalDataset`, also available unregistered from `@aceshooting/lyra-ui/components/agent-tools/eval-dataset/eval-dataset.class.js`
- **Family** `components/agent-tools/` — see `llms/index.md` for its siblings
- **Status** `stable` since `4.1.0` — see the maturity and deprecation policy in `llms/shared.md`
- **Release history** [CHANGELOG.md](../../CHANGELOG.md); family-wide breaking-change summaries: [llms-full.txt](../../llms-full.txt)
- **Deprecations** none
- **Optional peers** none
- **Themeable via** 11 parts, 5 custom properties — see this component's own `@csspart`/`@cssprop` list below
- **Library-wide behavior** (events, form association, `locale`/`strings`, tokens, TS types): `llms/shared.md`

---

## `lr-eval-dataset`

Filterable and taggable evaluation-example list with add, remove, import, and export affordances.

**Properties:**

- `examples: readonly EvalExample[] = []` (attribute: false) — `EvalExample { id: string; input: string;
expectedOutput?: string; tags?: readonly string[]; metadata?: Record<string, unknown> }` (exported here).
  It is a dedicated dataset-row shape; no shared agent type models a labeled evaluation row.
  `input`/`expectedOutput` are plain
  strings (not structured payloads), rendered as plain text by every column's `cell()`. Fully
  controlled: add/remove/import/export are all _requests_; the host mutates and passes the array
  back. Empty/blank ids and later duplicate ids are omitted before selection, filtering, mutation requests, and the
  nested grid are derived. Distinct tag chips are ordered with the component's effective-locale
  collation
- `searchable: boolean = false` (reflected) — built-in free-text search over `input`,
  `expectedOutput`, and `tags` (case-insensitive substring)
- `autocomplete: string = ''`, `spellcheck: boolean = true`, `autocapitalize: string = ''`,
  `autoCorrect: string = ''` (attribute `autocorrect`), `inputMode: string = ''` (attribute
  `inputmode`), and `enterKeyHint: string = ''` (attribute `enterkeyhint`) — native
  editing-assistance and virtual-keyboard hints forwarded only to the internal search input while
  `searchable`; empty string leaves the corresponding browser default in effect
- `accept: string = ''` — forwarded to the internal `lr-file-input`'s `accept` (e.g. `'.json,.csv'`);
  empty accepts any type
- `exportFormats: readonly LyraExportFormatOption[] = ['csv', 'json']` (attribute: false) — forwarded to the
  internal `lr-export-button`
- `disabled: boolean = false` (reflected) — disables every add/remove/import/export affordance, e.g.
  while a host-side mutation is still in flight
- `label: string = ''` — purpose-specific accessible name for the nested grid; defaults to the
  localized `evalDatasetLabel`. A host `aria-label` remains on the custom-element host as its
  overall name and is not cloned onto the independently interactive grid

**Events:** `lr-example-select` (`detail: { exampleId: string | null }`),
`lr-example-add-request` (`detail: null` — no payload; `emit()`
normalizes an omitted detail to `null`, never `undefined`), `lr-example-remove-request` (`detail: { exampleId:
string }`), `lr-import-request` (`detail: { files: File[] }`), `lr-export-request` (`detail: {
format: string }`), and the deliberate nested-table pass-through `lr-sort` (`detail: { phase:
'commit'; sortKey: string; sortDir: 'asc' | 'desc' }`). `focus`/`blur` —
re-dispatched (no detail) when the internal search field (only rendered while `searchable`) gains or
loses focus, since native focus neither bubbles nor crosses the shadow boundary.
All three built-in columns are sortable; activating one of their headers produces that commit for
the host to apply to its controlled `examples` array.

**CSS parts:** `base`, `toolbar`, `search`, `search-input`, `search-clear` (replaces the native
search-cancel glyph the component resets; rendered only while the field has text), `tag-filter`,
`grid`, `add-button`, `remove-button`, `import`, `export`.

**Themeable custom properties:** `--lr-eval-dataset-search-min-height` (default `auto`),
`--lr-eval-dataset-search-font-size` (default `inherit`),
`--lr-eval-dataset-search-padding-inline` (default `var(--lr-space-s)`),
`--lr-eval-dataset-search-padding-block` (default `var(--lr-space-xs)`) and
`--lr-eval-dataset-search-radius` (default `var(--lr-radius)`) size the built-in search field; point
the height at a `--lr-form-control-height-*` tier to match it to a themed search field. The trailing
inline gutter is reserved for the overlaid `search-clear` button and is not a knob.

**Known gotchas:**

- Shrinking `examples` out from under live UI state is handled: a `selectedId` that no longer matches
  any row resets to `null`, and an active tag filter that no longer matches any row's `tags` is
  dropped rather than silently matching zero rows forever.
- A search or tag filter that hides the selected row also clears that selection and emits
  `lr-example-select` with `{ exampleId: null }`, so the Remove control never acts on an invisible
  row.
