feat(record-form): hand slot RecordFields their wiring as bind (PUI-125) #137
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/PUI-125-recordform-hands-slot-fields-their-wiring"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
RecordFields placed in RecordForm's slots now get their wiring from RecordForm, so pages stop repeating it and
useRecordFormclears issues for fields in those slots too.Every CMS and CRM form puts its fields in
#fields/#aside, and each RecordFields repeatedv-model,:issues,:busyand@field-change(14 places). Those field changes never reached RecordForm, souseRecordForm'sbind.onFieldChangenever ran for them.Review guide
RecordForm.vue:#fieldsand#asidereceive abindslot prop, used as<template #fields="{ bind }"><RecordFields v-bind="bind" :fields="group" /></template>. A field change goes out through RecordForm'sfield-change, once per edit. Its slots are declared withdefineSlots, and forwarding ofbefore-field/field:*is split into a static template plus a typed loop, sincedefineSlotsrequires it.record-form/types.ts: new exportedRecordFieldsBinding<T>.bind; only PageForm's block fields override busy/readonly.bindis renamedformBind, becausevue/no-template-shadowrejects twobinds.clearIssueto one@field-changeon RecordForm, with the same clearing.tests/record-form.test.ts: slot edits, busy/readonly precedence,useRecordFormclearing, default-slot forwarding.tests/dom.tsis the shared DOM harness, moved out of repeater.test.ts.docs/cms/forms-and-validation.md, CHANGELOG, and the RecordForm and PageAside stories.Proof
bun run typecheck, lint and format pass.examples/vuetype-check: only the knownSettingsForm.vueerror that #136 fixes.Choices made: composable
bindrenamedformBindon pages (not the slot prop);field-changeforwarded with all arguments, ready for PUI-126; thedefaultslot gets nobind;bindleaves out baseline/errors/submit (RecordFields doesn't take them).Closes PUI-125
Ready to merge, after #136. CI green; base current with main (
6802ee5, merged in atbfffcef). Conflicts resolved: ContactForm now keeps PanelGroup (#135) and spreads the slotbind; README; CHANGELOG (the entry moved to a fresh## Unreleased, since 0.44.0 had been released). Review panel: changes and quality seats, nothing material; nits fixed ind152796and4397e4b(default-slot forwarding test, RecordForm tests in their own file, PageAside story, docs). Remaining nits:field:*slot scope is hand-copied in RecordForm'sdefineSlots(RecordFields declares no slots);bindis rebuilt on every recompute. Not checked in a browser.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.