Skip to main content

Interface: DatasetEditHook<TProps>

Defined in: api/dataset-plugin.ts:109

The extension hook, as a plugin claims it. Installing composes: the wrapper receives the current occupant, so a second plugin adds to the first's cascade instead of evicting it. Merge the two results with mergeEntryEdits, never with a spread (#197).

setLockRule is the sibling seam a plugin uses to open one locked Field on one Entry, or on a whole subtree (#473). Installing composes the same way: the wrapper receives the current occupant, and calls next(query, field) for "no opinion" — a rule always answers, never falls through in silence. Every write door — entries.update(), the grid, and an EditExtender cascade — reads the composed rule (I14).

setPlaceRule is the third seam (ADR 0038): it answers whether an Entry may land under a given parent, asked once for a cross-parent move and once for a gesture preview, so a bar drag, a grid row drag and entries.update()/add() all meet the same resolution.

setRemoveRule is the fourth seam (#611): it answers whether entries.remove() may take an Entry, asked once for the id the caller named and once for every member of its subtree — the narrowest answer wins, so removing an unlocked parent that holds one locked descendant refuses too.

setBarMoveRule is the fifth seam: it answers whether the bar of an Entry moves when a user drags it. A summary bar shows derived dates, so no lock rule on a cell can stop it. Core installs its own lock, remove and bar move rules before every plugin, so a plugin wraps each one. A plugin can narrow or widen the core lock.

rulesChanged is the sixth seam (ADR 0038): a lock rule, a place rule, a remove rule or a bar move rule can close over state outside the Entry it reads — a clock, a toggle — so its answer can move with no write the Dataset sees. Call it after that outside state moves. Every bound Gantt re-resolves what it currently offers, the same re-resolution a Field write already triggers, so an affordance a rule just closed clears on the next frame. No gate: unlike the five seams above, a plugin calls this any time after its own data() returns, because a rule's outside state can move at any time, not only during setup. Writes nothing itself (I14 unaffected — no changeset, no undo step).

Type Parameters​

TProps​

TProps = Record<string, unknown>

Methods​

rulesChanged()​

rulesChanged(): void

Defined in: api/dataset-plugin.ts:116

Returns​

void


setBarMoveRule()​

setBarMoveRule(wrap): void

Defined in: api/dataset-plugin.ts:115

Parameters​

wrap​

BarMoveRuleWrapper

Returns​

void


setExtender()​

setExtender(wrap): void

Defined in: api/dataset-plugin.ts:110

Parameters​

wrap​

ExtenderWrapper<TProps>

Returns​

void


setLockRule()​

setLockRule(wrap): void

Defined in: api/dataset-plugin.ts:112

Parameters​

wrap​

FieldLockRuleWrapper

Returns​

void


setPlaceRule()​

setPlaceRule(wrap): void

Defined in: api/dataset-plugin.ts:113

Parameters​

wrap​

PlaceRuleWrapper

Returns​

void


setRemovalExtender()​

setRemovalExtender(wrap): void

Defined in: api/dataset-plugin.ts:111

Parameters​

wrap​

RemovalExtenderWrapper<TProps>

Returns​

void


setRemoveRule()​

setRemoveRule(wrap): void

Defined in: api/dataset-plugin.ts:114

Parameters​

wrap​

RemoveRuleWrapper

Returns​

void