TimeTrex/interface/html5/dist/timepicker-TTimePicker.bundle.js

1 line
24 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["timepicker-TTimePicker"],{9680:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.TTimePicker = function( options ) {\n\t\tvar opts = $.extend( {}, $.fn.TTimePicker.defaults, options );\n\t\t//Global.addCss( 'global/widgets/timepicker/TTimePicker.css' );\n\t\tvar $this = this;\n\t\tvar field;\n\t\tvar validation_field;\n\t\tvar time_picker_input;\n\t\tvar icon;\n\t\tvar error_string = '';\n\t\tvar error_tip_box;\n\t\tvar mass_edit_mode = false;\n\t\tvar check_box = null;\n\t\tvar enabled = true;\n\t\tvar is_open = false;\n\t\tvar focus_out_timer;\n\t\tvar can_open = false; //default when the calender can be open, we only open it when click on the icon\n\t\tvar is_static_width = false;\n\t\tvar stepMinute = 15;\n\n\t\tthis.getEnabled = function() {\n\t\t\treturn enabled;\n\t\t};\n\n\t\tthis.setEnabled = function( val ) {\n\t\t\tenabled = val;\n\t\t\tif ( val === false || val === '' ) {\n\t\t\t\ttime_picker_input.addClass( 't-time-picker-readonly' );\n\t\t\t\ticon.css( 'display', 'none' );\n\t\t\t\ttime_picker_input.attr( 'readonly', 'readonly' );\n\t\t\t} else {\n\t\t\t\ttime_picker_input.removeClass( 't-time-picker-readonly' );\n\t\t\t\ticon.css( 'display', 'inline' );\n\t\t\t\ttime_picker_input.removeAttr( 'readonly' );\n\t\t\t}\n\t\t};\n\n\t\tthis.setCheckBox = function( val ) {\n\t\t\tcheck_box.children().eq( 0 )[0].checked = val;\n\t\t};\n\n\t\tthis.isChecked = function() {\n\t\t\tif ( check_box ) {\n\t\t\t\tif ( check_box.children().eq( 0 )[0].checked === true ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\t\t};\n\n\t\tthis.setMassEditMode = function( val ) {\n\t\t\tmass_edit_mode = val;\n\t\t\tif ( mass_edit_mode ) {\n\t\t\t\tcheck_box = $( ' <div class=\"mass-edit-checkbox-wrapper\"><input type=\"checkbox\" class=\"mass-edit-checkbox\"></input>' +\n\t\t\t\t\t'<label for=\"checkbox-input-1\" class=\"input-helper input-helper--checkbox\"></label></div>' );\n\t\t\t\tcheck_box.insertBefore( $( this ) );\n\n\t\t\t\tcheck_box.change( function() {\n\t\t\t\t\t$this.trigger( 'formItemChange', [$this] );\n\t\t\t\t} );\n\n\t\t\t} else {\n\t\t\t\tif ( check_box ) {\n\t\t\t\t\tcheck_box.remove();\n\t\t\t\t\tcheck_box = null;\n\t\t\t\t}\n\t\t\t}\n\n\t\t};\n\n\t\tthis.setErrorStyle = function( errStr, show, isWarning ) {\n\t\t\tif ( isWarning ) {\n\t\t\t\ttime_picker_input.addClass( 'warning-tip' );\n\t\t\t} else {\n\t\t\t\ttime_picker_input.addClass( 'error-tip' );\n\t\t\t}\n\t\t\terror_string = errStr;\n\t\t\tif ( show ) {\n\t\t\t\tthis.showErrorTip();\n\t\t\t}\n\t\t};\n\n\t\tthis.showErrorTip = function( sec ) {\n\t\t\tif ( !Global.isSet( sec ) ) {\n\t\t\t\tsec = 2;\n\t\t\t}\n\t\t\tif ( !error_tip_box ) {\n\t\t\t\terror_tip_box = Global.loadWidgetByName( WidgetNamesDic.ERROR_TOOLTIP );\n\t\t\t\terror_tip_box = error_tip_box.ErrorTipBox();\n\t\t\t}\n\t\t\tif ( time_picker_input.hasClass( 'warning-tip' ) ) {\n\t\t\t\terror_tip_box.show( this, error_string, sec, true );\n\t\t\t} else {\n\t\t\t\terror_tip_box.show( this, error_string, sec );\n\t\t\t}\n\t\t};\n\n\t\tthis.hideErrorTip = function() {\n\t\t\tif ( Global.isSet( error_tip_box ) ) {\n\t\t\t\terror_tip_box.remove();\n\t\t\t}\n\t\t};\n\n\t\t// Error: TypeError: time_picker_input is undefined in /interface/html5/global/widgets/datepicker/TTimePicker.js?v=8.0.3-20150313-161037 line 122\n\t\tthis.clearErrorStyle = function() {\n\t\t\tif ( !time_picker_input ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\ttime_picker_input.removeClass( 'error-tip' );\n\t\t\ttime_picker_input.removeClass( 'warning-tip' );\n\t\t\tthis.hideErrorTip();\n\t\t\terror_string = '';\n\t\t};\n\n\t\tthis.getField = function() {\n\t\t\treturn field;\n\t\t};\n\n\t\tthis.getValidationField = function() {\n\t\t\treturn validation_field;\n\t\t};\n\n\t\tthis.getDefaultFormatValue = function() {\n\t\t\tvar val = time_picker_input.val();\n\n\t\t\tval = Global.strToDate( val ).format( 'YYYY-MM-DD' );\n\n\t\t\tr