1 line
5.7 KiB
JavaScript
1 line
5.7 KiB
JavaScript
(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["awesomebox-ASearchInput"],{7040:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.ASearchInput = function( options ) {\n\t\tvar opts = $.extend( {}, $.fn.ADropDown.defaults, options );\n\n\t\tvar column_model = null;\n\n\t\tvar search_timer = null;\n\n\t\tvar $this = this;\n\t\tvar default_tooltip = $.i18n._( 'click to search' );\n\n\t\tthis.setFilter = function( filters ) {\n\t\t\tvar field = column_model.name;\n\n\t\t\tif ( Global.isSet( filters[field] ) ) {\n\t\t\t\t$( this ).val( filters[field] );\n\t\t\t\t$( this ).addClass( 'search-input-focus-in' );\n\t\t\t}\n\t\t};\n\n\t\tthis.clearValue = function() {\n\t\t\t$( this ).val( default_tooltip );\n\t\t\t$( this ).removeClass( 'search-input-focus-in' );\n\t\t\t$( this ).addClass( 'search-input-focus-out' );\n\t\t};\n\n\t\tthis.each( function() {\n\n\t\t\tvar o = $.meta ? $.extend( {}, opts, $( this ).data() ) : opts;\n\n\t\t\tif ( o.column_model ) {\n\n\t\t\t\tcolumn_model = o.column_model;\n\t\t\t}\n\n\t\t\t$( this ).addClass( 'search-input-focus-out' );\n\n\t\t\t$( this ).val( default_tooltip );\n\n\t\t\t$( this ).focusin( function() {\n\n\t\t\t\tif ( $( this ).val() === default_tooltip ) {\n\t\t\t\t\t$( this ).val( '' );\n\t\t\t\t\t$( this ).addClass( 'search-input-focus-in' );\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\t$( this ).focusout( function() {\n\t\t\t\tif ( $( this ).val() === '' ) {\n\t\t\t\t\t$( this ).val( default_tooltip );\n\t\t\t\t\t$( this ).removeClass( 'search-input-focus-in' );\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\t$( this ).bind( 'input propertychange', function( e ) {\n\n\t\t\t\tif ( search_timer ) {\n\t\t\t\t\tclearTimeout( search_timer );\n\t\t\t\t}\n\n\t\t\t\tif ( e.keyCode === 91 || e.ctrlKey || e.metaKey || e.keyCode === 17 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsearch_timer = setTimeout( function() {\n\n\t\t\t\t\tvar val = ( $this.val() === default_tooltip ) ? '' : $this.val();\n\n\t\t\t\t\t$this.trigger( 'searchEnter', [val, column_model.name] );\n\n\t\t\t\t}, 500 );\n\n\t\t\t} );\n\n\t\t} );\n\n\t\treturn this;\n\n\t};\n\n\t$.fn.ASearchInput.defaults = {};\n\n} )( jQuery );//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzA0MC5qcyIsIm1hcHBpbmdzIjoiO0FBQUE7O0FBRUE7QUFDQSx5QkFBeUI7O0FBRXpCOztBQUVBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUEsZ0NBQWdDOztBQUVoQzs7QUFFQTtBQUNBOztBQUVBOztBQUVBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBLEtBQUs7O0FBRUw7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSxLQUFLOztBQUVMOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7O0FBRUE7O0FBRUEsS0FBSzs7QUFFTCxLQUFLOztBQUVMLElBQUk7O0FBRUo7O0FBRUE7O0FBRUE7O0FBRUEsRUFBRSxHQUFHLE1BQU0iLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9pbnRlcmZhY2UvaHRtbDUvZ2xvYmFsL3dpZGdldHMvYXdlc29tZWJveC9BU2VhcmNoSW5wdXQuanM/MDY2OCJd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