Commit Graph
8 Commits
Author SHA1 Message Date
pk 82adb306b6 Define isChanged() before first snapshot + emit form-changed on control changes
isChanged() compared against a fabricated '{}' baseline before the first
snapshot() call, so the first query on any non-empty form reported true.
Consumers that embed the boolean in their own baseline (settings dirty
guards) froze that false positive in. Now reports false until a baseline
exists; hasSnapshot getter exposes the state.

New: form listens (capture phase, so non-bubbling events are caught) to
the tp-* control change events and re-emits them as 'form-changed'
(detail.changed = isChanged()), scoped to its own registered controls.
Consumers can drop polling.
2026-10-22 23:51:12 +02:00
pk 354b0ab720 Bump version 2026-02-20 09:20:50 +01:00
pk f34c764391 Support for "$" syntax to indicate where the serialization logic should collect values into arrays.
Use a dollar sign to indicate where tp-form should collect values as an
array. For example `myfield.$list.value` collects { myfield: { list: [ {
value: '...' } ] } }
2025-06-12 12:53:09 +02:00
pk 727f3ecf11 Use the clone helper instead of a interal function 2025-02-06 22:26:19 +01:00
pk a821354288 Reset native elements if reset() is called. 2023-09-03 22:26:19 +02:00
pk 7ca87b7bdd Include the 'checked' property in snapshots and state resets. 2022-05-05 09:53:08 +02:00
pk 8f0d9524ba Initial version 2022-03-12 22:40:18 +01:00
tp-elements 8a316b3d36 Initial commit 2022-03-12 22:39:10 +01:00