@ -11,7 +11,7 @@
< button
class = "flex items-center bg-gradient-to-b from-green-400 to-green-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-1 mr-1 rounded-md"
@ click = "$emit('show-onboard-meeting') "
@ click = "handleShowOnboardMeeting "
>
< font -awesome icon = "chair" class = "fa-fw text-2xl" / >
< / button >
@ -23,7 +23,7 @@
< font -awesome
icon = "envelope-open-text"
class = "fa-fw text-2xl"
@ click = "$emit('registration-required') "
@ click = "handleRegistrationRequired "
/ >
< / span >
< span
@ -32,7 +32,7 @@
< font -awesome
icon = "chair"
class = "fa-fw text-2xl"
@ click = "$emit('navigate-onboard-meeting') "
@ click = "handleNavigateOnboardMeeting "
/ >
< / span >
< / span >
@ -40,7 +40,7 @@
<!-- QR Code Button -- >
< button
class = "flex items-center bg-gradient-to-b from-green-400 to-green-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-1.5 py-1 mr-1 rounded-md"
@ click = "$emit('qr-scan') "
@ click = "handleQRScan "
>
< font -awesome icon = "qrcode" class = "fa-fw text-2xl" / >
< / button >
@ -56,7 +56,7 @@
<!-- Add Button -- >
< button
class = "px-4 rounded-r bg-green-200 border border-green-400"
@ click = "$emit('submit', inputValue) "
@ click = "handleSubmit "
>
< font -awesome icon = "plus" class = "fa-fw" / >
< / button >
@ -71,25 +71,55 @@ import { Component, Vue, Prop } from "vue-facing-decorator";
*
* Provides a form for adding new contacts with various input formats .
* Includes action buttons for invites , meetings , and QR scanning .
* Uses function props for event handling to provide better parent control .
*
* @ author Matthew Raymer
* /
@ Component ( {
name : "ContactInputForm" ,
emits : [
"submit" ,
"show-onboard-meeting" ,
"registration-required" ,
"navigate-onboard-meeting" ,
"qr-scan" ,
"update:modelValue" ,
] ,
} )
export default class ContactInputForm extends Vue {
@ Prop ( { required : true } ) isRegistered ! : boolean ;
@ Prop ( { type : String , default : "" } ) modelValue ! : string ;
/ * *
* Function prop for handling contact submission
* Called when the add button is clicked with the current input value
* /
@ Prop ( { type : Function , default : ( ) => { } } )
onSubmit ! : ( value : string ) => void | Promise < void > ;
/ * *
* Function prop for handling onboard meeting display
* Called when the onboard meeting button is clicked for registered users
* /
@ Prop ( { type : Function , default : ( ) => { } } )
onShowOnboardMeeting ! : ( ) => void | Promise < void > ;
/ * *
* Function prop for handling registration required notification
* Called when invite button is clicked for unregistered users
* /
@ Prop ( { type : Function , default : ( ) => { } } )
onRegistrationRequired ! : ( ) => void | Promise < void > ;
/ * *
* Function prop for handling onboard meeting navigation
* Called when onboard meeting button is clicked for unregistered users
* /
@ Prop ( { type : Function , default : ( ) => { } } )
onNavigateOnboardMeeting ! : ( ) => void | Promise < void > ;
/ * *
* Function prop for handling model value updates
* Called when the input value changes for v - model binding
* /
@ Prop ( { type : Function , default : ( ) => { } } )
onUpdateModelValue ! : ( value : string ) => void ;
/ * *
* Computed property for v - model binding
* /
@ -98,7 +128,48 @@ export default class ContactInputForm extends Vue {
}
set inputValue ( value : string ) {
this . $emit ( "update:modelValue" , value ) ;
this . onUpdateModelValue ( value ) ;
}
/ * *
* Handle submit button click
* Calls the onSubmit function prop with current input value
* /
private handleSubmit ( ) : void {
this . onSubmit ( this . inputValue ) ;
}
/ * *
* Handle show onboard meeting button click
* Calls the onShowOnboardMeeting function prop
* /
private handleShowOnboardMeeting ( ) : void {
this . onShowOnboardMeeting ( ) ;
}
/ * *
* Handle registration required notification
* Calls the onRegistrationRequired function prop
* /
private handleRegistrationRequired ( ) : void {
this . onRegistrationRequired ( ) ;
}
/ * *
* Handle navigate onboard meeting button click
* Calls the onNavigateOnboardMeeting function prop
* /
private handleNavigateOnboardMeeting ( ) : void {
this . onNavigateOnboardMeeting ( ) ;
}
/ * *
* Handle QR scan button click
* Emits qr - scan event for parent handling
* /
private handleQRScan ( ) : void {
console . log ( "[ContactInputForm] QR scan button clicked" ) ;
this . $emit ( "qr-scan" ) ;
}
}
< / script >