# XWUIEntityMaster

The super "umbrella" that composes the four single-domain CRUD masters - `XWUIListEntityMaster` (list of form definitions), `XWUIFormEditorMaster` (one form-definition editor), `XWUIListRecordMaster` (records for the active entity), and `XWUIRecordMaster` (one record's runtime form) - behind a 2-level tab strip. The L1 strip (`XWUITabs`) selects which sub-master is mounted (`entity-list` / `entity` / `record-list` / `record`); the L2 strip (`XWUITabsSub`) drives the active sub-master's `CRUDState` (`create` | `read` | `update` | `delete` | `json`). The umbrella owns all cross-cutting state - the entities list, the active entity and its form definition, the records scoped to that entity, the selected record, validation errors, and submit lifecycle - and hands each sub-master a slice via data props while collecting writes through their callbacks. An L2 change calls the active sub-master's `setState()` in place; an L1 change tears down and remounts. Gate panels with `enabledStates[group][crudState]`, hook persistence via `onRecordSubmit`/`onRecordDelete`/`onEntitiesChange`/`onFormDefinitionChange`, and validate standalone with the static `XWUIEntityMaster.validateRecordFromDef`.

## Basic Usage

A single "Contact" entity with one seeded record, opened straight onto the Record group in `read` state - the umbrella mounts `XWUIRecordMaster` and validates submissions against the entity's form definition.

```example
file: examples/BasicUsage.ts
html: examples/BasicUsage.html
title: Basic Usage
description: Mounts the 2-level tab UI with one form definition plus a record, landing on activeGroup "record" / activeAction "read".
```

## Multi-Entity Browser

Boots the umbrella on the Entity List group with two form definitions, so the entity browser is the landing view; onActiveEntityChange fires when a row is opened.

```example
file: examples/MultiEntityBrowser.ts
html: examples/MultiEntityBrowser.html
title: Multi-Entity Browser
description: Boots the umbrella on the Entity List group with two form definitions, so the entity browser is the landing view; onActiveEntityChange fires when a row is opened.
```

## Read-Only Governance

readOnly locks every sub-master, and enabledStates hides the destructive actions (no Delete on records, no Create/Delete on entities) - a review-only deployment.

```example
file: examples/ReadOnlyGovernance.ts
html: examples/ReadOnlyGovernance.html
title: Read-Only Governance
description: readOnly locks every sub-master, and enabledStates hides the destructive actions (no Delete on records, no Create/Delete on entities) - a review-only deployment.
```

```api
```
