@@ -46,31 +46,25 @@ function dialog_default(Alpine) {
4646 }
4747 }
4848 function escapeDialog ( event ) {
49- if ( event . key !== "Escape" )
50- return ;
49+ if ( event . key !== "Escape" ) return ;
5150 event . preventDefault ( ) ;
52- if ( closeby !== "any" && closeby !== "closerequest" )
53- return ;
51+ if ( closeby !== "any" && closeby !== "closerequest" ) return ;
5452 evaluate ( ) ;
5553 }
5654 function backdropDialog ( event ) {
57- if ( event . target !== el || closeby !== "any" )
58- return ;
55+ if ( event . target !== el || closeby !== "any" ) return ;
5956 const rect = el . getBoundingClientRect ( ) ;
6057 const isInDialog = rect . top <= event . clientY && event . clientY <= rect . top + rect . height && rect . left <= event . clientX && event . clientX <= rect . left + rect . width ;
61- if ( isInDialog )
62- return ;
58+ if ( isInDialog ) return ;
6359 evaluate ( ) ;
6460 }
6561 el . _x_doShow = ( ) => {
66- if ( el . hasAttribute ( "open" ) )
67- return ;
62+ if ( el . hasAttribute ( "open" ) ) return ;
6863 el . showModal ( ) ;
6964 scrollLock ( lockPageScroll ) ;
7065 } ;
7166 el . _x_doHide = ( ) => {
72- if ( ! el . hasAttribute ( "open" ) )
73- return ;
67+ if ( ! el . hasAttribute ( "open" ) ) return ;
7468 el . close ( ) ;
7569 scrollLock ( false ) ;
7670 } ;
@@ -83,25 +77,21 @@ function dialog_default(Alpine) {
8377 }
8478}
8579function modifierValue ( modifiers , key , fallback ) {
86- if ( modifiers . indexOf ( key ) === - 1 )
87- return fallback ;
80+ if ( modifiers . indexOf ( key ) === - 1 ) return fallback ;
8881 const rawValue = modifiers [ modifiers . indexOf ( key ) + 1 ] ;
89- if ( ! rawValue )
90- return fallback ;
82+ if ( ! rawValue ) return fallback ;
9183 if ( key === "closeby" ) {
9284 const allowedValues = [ "auto" , "none" , "closerequest" , "any" ] ;
9385 const options = allowedValues . join ( ", " ) ;
9486 if ( ! allowedValues . includes ( rawValue ) ) {
9587 console . warn (
9688 `"${ rawValue } " is not one of the allowed values for closeby: ${ options } `
9789 ) ;
90+ return fallback ;
9891 }
99- return fallback ;
10092 }
10193 return rawValue ;
10294}
10395
10496// src/module.js
10597var module_default = dialog_default ;
106- // Annotate the CommonJS export names for ESM import in node:
107- 0 && ( module . exports = { } ) ;
0 commit comments