@ -5,7 +5,8 @@ with edit capability * - Gift description input with placeholder support * -
Amount input with increment / decrement controls * - Unit code selection ( HUR ,
Amount input with increment / decrement controls * - Unit code selection ( HUR ,
USD , BTC , etc . ) * - Photo & more options navigation * - Conflict detection and
USD , BTC , etc . ) * - Photo & more options navigation * - Conflict detection and
warning display * - Form validation and submission * - Cancel functionality * -
warning display * - Form validation and submission * - Cancel functionality * -
Template streamlined with computed CSS properties * * @ author Matthew Raymer * /
Template streamlined with computed CSS properties * - Function props for parent
control over updates and validation * * @ author Matthew Raymer * /
< template >
< template >
< div id = "sectionGiftedGift" >
< div id = "sectionGiftedGift" >
<!-- Entity Summary Buttons -- >
<!-- Entity Summary Buttons -- >
@ -130,6 +131,7 @@ interface EntityData {
* - Form validation and submission
* - Form validation and submission
* - Cancel functionality
* - Cancel functionality
* - Template streamlined with computed CSS properties
* - Template streamlined with computed CSS properties
* - Function props for parent control over updates and validation
* /
* /
@ Component ( {
@ Component ( {
components : {
components : {
@ -190,6 +192,27 @@ export default class GiftDetailsStep extends Vue {
@ Prop ( { default : "" } )
@ Prop ( { default : "" } )
toProjectId ! : string ;
toProjectId ! : string ;
/ * *
* Function prop for handling description updates
* Called when the description input changes , allowing parent to control validation
* /
@ Prop ( { type : Function , default : ( ) => { } } )
onUpdateDescription ! : ( description : string ) => void | Promise < void > ;
/ * *
* Function prop for handling amount updates
* Called when the amount changes , allowing parent to control validation
* /
@ Prop ( { type : Function , default : ( ) => { } } )
onUpdateAmount ! : ( amount : number ) => void | Promise < void > ;
/ * *
* Function prop for handling unit code updates
* Called when the unit code selection changes , allowing parent to control validation
* /
@ Prop ( { type : Function , default : ( ) => { } } )
onUpdateUnitCode ! : ( unitCode : string ) => void | Promise < void > ;
/** Local reactive copies of props for v-model */
/** Local reactive copies of props for v-model */
private localDescription : string = "" ;
private localDescription : string = "" ;
private localAmount : number = 0 ;
private localAmount : number = 0 ;
@ -310,13 +333,15 @@ export default class GiftDetailsStep extends Vue {
/ * *
/ * *
* Handle description input changes
* Handle description input changes
* Calls the onUpdateDescription function prop for parent control
* /
* /
handleDescriptionChange ( ) : void {
handleDescriptionChange ( ) : void {
this . emit UpdateDescription( this . localDescription ) ;
this . on UpdateDescription( this . localDescription ) ;
}
}
/ * *
/ * *
* Handle amount input changes
* Handle amount input changes
* Calls the onUpdateAmount function prop for parent control
* /
* /
handleAmountChange ( newAmount : number ) : void {
handleAmountChange ( newAmount : number ) : void {
logger . debug ( "[GiftDetailsStep] handleAmountChange() called" , {
logger . debug ( "[GiftDetailsStep] handleAmountChange() called" , {
@ -324,14 +349,15 @@ export default class GiftDetailsStep extends Vue {
newAmount ,
newAmount ,
} ) ;
} ) ;
this . localAmount = newAmount ;
this . localAmount = newAmount ;
this . emit UpdateAmount( newAmount ) ;
this . on UpdateAmount( newAmount ) ;
}
}
/ * *
/ * *
* Handle unit code selection changes
* Handle unit code selection changes
* Calls the onUpdateUnitCode function prop for parent control
* /
* /
handleUnitCodeChange ( ) : void {
handleUnitCodeChange ( ) : void {
this . emit UpdateUnitCode( this . localUnitCode ) ;
this . on UpdateUnitCode( this . localUnitCode ) ;
}
}
/ * *
/ * *
@ -381,25 +407,7 @@ export default class GiftDetailsStep extends Vue {
this . emitCancel ( ) ;
this . emitCancel ( ) ;
}
}
/ / E m i t m e t h o d s u s i n g @ E m i t d e c o r a t o r
/ / E m i t m e t h o d s u s i n g @ E m i t d e c o r a t o r ( k e e p i n g t h e s e f o r n o n - u p d a t e e v e n t s )
@ Emit ( "update:description" )
emitUpdateDescription ( description : string ) : string {
return description ;
}
@ Emit ( "update:amount" )
emitUpdateAmount ( amount : number ) : number {
logger . debug ( "[GiftDetailsStep] emitUpdateAmount() - emitting amount" , {
amount ,
} ) ;
return amount ;
}
@ Emit ( "update:unitCode" )
emitUpdateUnitCode ( unitCode : string ) : string {
return unitCode ;
}
@ Emit ( "edit-entity" )
@ Emit ( "edit-entity" )
emitEditEntity ( data : {
emitEditEntity ( data : {