Refactor EntitySummaryButton to use function props instead of events

Replace @Emit decorator with function prop pattern for better parent control over edit behavior. EntitySummaryButton now accepts onEditRequested function prop that parent components can use to handle edit requests with custom validation logic. Updated GiftDetailsStep to use new function prop interface with proper parameter handling.
This commit is contained in:
Matthew Raymer
2025-07-18 07:34:04 +00:00
parent dacf1f8083
commit e0b2f35e5e
2 changed files with 30 additions and 21 deletions

View File

@@ -17,7 +17,7 @@ control over updates and validation * * @author Matthew Raymer */
:entity-type="giverEntityType"
:label="giverLabel"
:editable="canEditGiver"
@edit-requested="handleEditGiver"
:on-edit-requested="handleEditGiver"
/>
<!-- Recipient Button -->
@@ -26,7 +26,7 @@ control over updates and validation * * @author Matthew Raymer */
:entity-type="recipientEntityType"
:label="recipientLabel"
:editable="canEditRecipient"
@edit-requested="handleEditRecipient"
:on-edit-requested="handleEditRecipient"
/>
</div>
@@ -362,8 +362,12 @@ export default class GiftDetailsStep extends Vue {
/**
* Handle giver edit request
* Called by EntitySummaryButton function prop
*/
handleEditGiver(): void {
handleEditGiver(_data: {
entityType: string;
entity: EntityData | null;
}): void {
this.emitEditEntity({
entityType: "giver",
currentEntity: this.giver,
@@ -372,8 +376,12 @@ export default class GiftDetailsStep extends Vue {
/**
* Handle recipient edit request
* Called by EntitySummaryButton function prop
*/
handleEditRecipient(): void {
handleEditRecipient(_data: {
entityType: string;
entity: EntityData | null;
}): void {
this.emitEditEntity({
entityType: "recipient",
currentEntity: this.receiver,