@@ -4120,6 +4120,16 @@ const Pf = {
41204120 type : Number ,
41214121 required : ! 1 ,
41224122 default : 0
4123+ } ,
4124+ acceptHeader : {
4125+ type : String ,
4126+ required : ! 1 ,
4127+ default : "application/json"
4128+ } ,
4129+ headers : {
4130+ type : Object ,
4131+ required : ! 1 ,
4132+ default : ( ) => ( { } )
41234133 }
41244134 } ,
41254135 emits : [ "success" , "error" , "reset" , "restored" ] ,
@@ -4274,18 +4284,18 @@ const Pf = {
42744284 async request ( e ) {
42754285 if ( typeof e > "u" && ( e = ! 1 ) , this . $uploading )
42764286 return ;
4277- await this . $nextTick ( ) , this . background ? this . processingInBackground = ! 0 : this . processing = ! 0 , this . wasSuccessful = ! 1 , this . recentlySuccessful = ! 1 , clearTimeout ( this . recentlySuccessfulTimeoutId ) , clearTimeout ( this . recentlyUnsuccessfulTimeoutId ) ;
4278- const t = this . values instanceof FormData ? this . values : dn ( this . values ) , r = { Accept : "application/json" } ;
4279- ( this . stay || e ) && ( r [ "X-Splade-Prevent-Refresh" ] = ! 0 ) , this . preserveScroll && ( r [ "X-Splade-Preserve-Scroll" ] = ! 0 ) ;
4287+ await this . $nextTick ( ) , this . background ? this . processingInBackground = ! 0 : this . processing = ! 0 , this . wasSuccessful = ! 1 , this . recentlySuccessful = ! 1 , clearTimeout ( this . recentlySuccessfulTimeoutId ) , this . wasUnsuccessful = ! 1 , this . recentlyUnsuccessful = ! 1 , clearTimeout ( this . recentlyUnsuccessfulTimeoutId ) ;
4288+ const t = this . values instanceof FormData ? this . values : dn ( this . values ) , r = { } ;
4289+ this . acceptHeader && ( r . Accept = this . acceptHeader ) , ( this . stay || e ) && ( r [ "X-Splade-Prevent-Refresh" ] = ! 0 ) , this . preserveScroll && ( r [ "X-Splade-Preserve-Scroll" ] = ! 0 ) ;
42804290 let n = this . method . toUpperCase ( ) ;
42814291 n !== "GET" && n !== "POST" && ( t . append ( "_method" , n ) , n = "POST" ) ;
42824292 const i = ( s ) => {
4283- this . $emit ( "success" , s ) , this . restoreOnSuccess && this . restore ( ) , this . resetOnSuccess && this . reset ( ) , this . processing = ! 1 , this . processingInBackground = ! 1 , this . wasUnsuccessful = ! 1 , this . recentlyUnsuccessful = ! 1 , this . wasSuccessful = ! 0 , this . recentlySuccessful = ! 0 , this . recentlySuccessfulTimeoutId = setTimeout ( ( ) => this . recentlySuccessful = ! 1 , 2e3 ) ;
4293+ this . $emit ( "success" , s ) , this . restoreOnSuccess && this . restore ( ) , this . resetOnSuccess && this . reset ( ) , this . processing = ! 1 , this . processingInBackground = ! 1 , this . wasSuccessful = ! 0 , this . recentlySuccessful = ! 0 , this . recentlySuccessfulTimeoutId = setTimeout ( ( ) => this . recentlySuccessful = ! 1 , 2e3 ) ;
42844294 } ;
42854295 if ( this . action === "#" )
42864296 return i ( Object . fromEntries ( t ) ) ;
4287- v . request ( this . action , n , t , r ) . then ( i ) . catch ( async ( s ) => {
4288- if ( this . processing = ! 1 , this . processingInBackground = ! 1 , this . wasSuccessful = ! 1 , this . recentlySuccessful = ! 1 , this . wasUnsuccessful = ! 0 , this . recentlyUnsuccessful = ! 0 , this . recentlyUnsuccessfulTimeoutId = setTimeout ( ( ) => this . recentlyUnsuccessful = ! 1 , 2e3 ) , this . $emit ( "error" , s ) , ! this . scrollOnError )
4297+ v . request ( this . action , n , t , { ... r , ... this . headers } ) . then ( i ) . catch ( async ( s ) => {
4298+ if ( this . processing = ! 1 , this . processingInBackground = ! 1 , this . wasUnsuccessful = ! 0 , this . recentlyUnsuccessful = ! 0 , this . recentlyUnsuccessfulTimeoutId = setTimeout ( ( ) => this . recentlyUnsuccessful = ! 1 , 2e3 ) , this . $emit ( "error" , s ) , ! this . scrollOnError )
42894299 return ;
42904300 await this . $nextTick ( ) ;
42914301 const a = cn ( Object . keys ( this . errors ) , ( o ) => this . formElement . querySelector ( `[data-validation-key="${ o } "]` ) ) ;
@@ -4471,7 +4481,7 @@ const Bf = /* @__PURE__ */ Le(Lf, [["render", Df]]), Rf = ["href", "onClick"], j
44714481 headers : {
44724482 type : Object ,
44734483 required : ! 1 ,
4474- default : ( ) => ( { Accept : "application/json" } )
4484+ default : ( ) => ( { } )
44754485 } ,
44764486 replace : {
44774487 type : Boolean ,
0 commit comments