# XWUIListEntityMaster

The entities-list CRUD master, where an "entity" is a form DEFINITION (`DefaultFormDefinition`). It extends `XWUIListMaster` (so the table, columns, and action column come from the shared parent) and only maps entities → rows via `summarize()` - surfacing `ID`, `Name`, `Version`, `Sections`, and `Fields` columns - then wires the generic view/edit/delete/add hooks to entity-specific callbacks (`onViewEntity`, `onEditEntity`, `onDeleteEntity`, `onAddEntity`, `onClearEntities`). Per the five canonical CRUD states: `read` shows the table view-only (eye), `update` adds View/Edit/Delete per row plus an Add button, `create` is an add-entity panel, `delete` is a bulk-delete-all confirmation, and `json` is a textarea editor for the entities array. State is driven externally via `setState()` - typically by the umbrella `XWUIEntityMaster`, which mounts this as its Entity List sub-master.

## Usage

```ts
import { XWUIListEntityMaster } from './XWUIListEntityMaster';

const master = new XWUIListEntityMaster(
  document.getElementById('app')!,
  {
    entities: [
      { config: { uid: 'f-contact', version: '1.0.0', name: 'Contact' }, schema: {}, data: { sections: [] } },
      { config: { uid: 'f-invoice', version: '2.1.0', name: 'Invoice' }, schema: {}, data: { sections: [] } },
    ],
    state: 'update',
  },
  {
    onViewEntity: (def) => console.log('view', def.config.uid),
    onEditEntity: (def) => console.log('edit', def.config.uid),
    onDeleteEntity: (id) => console.log('delete', id),
    onAddEntity: () => console.log('add'),
  }
);

master.setState('json');
```

## Basic Usage

A read-only catalog of form-definition entities.

```example
file: examples/BasicUsage.ts
html: examples/BasicUsage.html
title: Basic Usage
description: A read-only catalog of form-definition entities.
```

## Manage entities

Entity list with per-row actions wired to view / edit / delete / add callbacks.

```example
file: examples/Manage.ts
html: examples/Manage.html
title: Manage entities
description: Entity list with per-row actions wired to view / edit / delete / add callbacks.
```

## JSON state

The entity collection shown as raw JSON, then switched live via setState().

```example
file: examples/JsonState.ts
html: examples/JsonState.html
title: JSON state
description: The entity collection shown as raw JSON, then switched live via setState().
```

```api
```
