(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["formula_builder-FormulaBuilder"],{9326:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.FormulaBuilder = function( options ) {\n\t\tvar opts = $.extend( {}, $.fn.FormulaBuilder.defaults, options );\n\t\tvar $this = this;\n\t\tvar field;\n\n\t\tvar text_label = $.i18n._( 'Formula Builder' );\n\n\t\tvar field_type = 'textarea';\n\n\t\tvar error_string = '';\n\t\tvar error_tip_box;\n\n\t\tvar mass_edit_mode = false;\n\t\tvar check_box = null;\n\n\t\tvar enabled = true;\n\n\t\tvar text_input = null;\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\ttext_input.children().attr( 'disabled', 'true' );\n\t\t\t\ttext_input.addClass( 't-text-area-readonly' );\n\t\t\t} else {\n\t\t\t\ttext_input.children().removeAttr( 'disabled' );\n\t\t\t\ttext_input.removeClass( 't-text-area-readonly' );\n\t\t\t}\n\n\t\t};\n\n\t\tthis.setCheckBox = function( val ) {\n\t\t\tif ( check_box ) {\n\t\t\t\tcheck_box.children().eq( 0 )[0].checked = val;\n\t\t\t}\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\n\t\t\tif ( mass_edit_mode ) {\n\t\t\t\tcheck_box = $( '
' +\n\t\t\t\t\t'
' );\n\t\t\t\tcheck_box.insertBefore( text_input );\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.setValue = function( val ) {\n\n\t\t\tif ( !val ) {\n\t\t\t\tval = '';\n\t\t\t}\n\n\t\t\ttext_input.val( val );\n\n\t\t};\n\n\t\tthis.setErrorStyle = function( errStr, show, isWarning ) {\n\t\t\tif ( isWarning ) {\n\t\t\t\ttext_input.addClass( 'warning-tip' );\n\t\t\t} else {\n\t\t\t\ttext_input.addClass( 'error-tip' );\n\t\t\t}\n\t\t\terror_string = errStr;\n\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\n\t\t\tif ( !Global.isSet( sec ) ) {\n\t\t\t\tsec = 2;\n\t\t\t}\n\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 ( text_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\n\t\t\tif ( Global.isSet( error_tip_box ) ) {\n\t\t\t\terror_tip_box.remove();\n\t\t\t}\n\n\t\t};\n\n\t\tthis.clearErrorStyle = function() {\n\t\t\ttext_input.removeClass( 'error-tip' );\n\t\t\ttext_input.removeClass( 'warning-tip' );\n\t\t\tthis.hideErrorTip();\n\t\t\terror_string = '';\n\t\t};\n\n\t\tthis.setField = function( val ) {\n\t\t\tfield = val;\n\t\t};\n\n\t\tthis.getField = function() {\n\t\t\treturn field;\n\t\t};\n\n\t\tthis.getValue = function() {\n\t\t\treturn text_input.val();\n\t\t};\n\n\t\tthis.setValue = function( val ) {\n\n\t\t\tif ( !val ) {\n\t\t\t\tval = '';\n\t\t\t}\n\n\t\t\ttext_input.val( val );\n\t\t};\n\n\t\tthis.each( function() {\n\n\t\t\tvar o = $.meta ? $.extend( {}, opts, $( this ).data() ) : opts;\n\t\t\tvar calc_width = true;\n\n\t\t\tif ( o.field_type && o.field_type === 'text_input' ) {\n\t\t\t\t$( this ).html( $.fn.FormulaBuilder.html_template_text_input );\n\t\t\t\tcalc_width = false;\n\t\t\t}\n\n\t\t\tfield = o.field;\n\t\t\ttext_input = $( this ).find( '.formula-input' );\n\n\t\t\tvar formula_btn = $( this ).find( 'button' );\n\n\t\t\tif ( !calc_width ) {\n\t\t\t\tformula_btn.css( 'float', 'right' );\n\t\t\t}\n\n\t\t\tformula_btn.text( o.text_label ? o.text_label : text_label );\n\n\t\t\tformula_btn.unbind( 'click' ).bind( 'click', function() {\n\n\t\t\t\tif ( o.onFormulaBtnClick ) {\n\t\t\t\t\to.onFormulaBtnClick();\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\tif ( o.width && ( o.width > 0 || o.width.indexOf( '%' ) > 0 ) ) {\n\t\t\t\tif ( o.width.indexOf( '%' ) > 0 && calc_width) {\n\t\t\t\t\t$this.width( o.width );\n\t\t\t\t\ttext_input.css( 'width', 'calc( 100% - 115px )' );\n\t\t\t\t} else {\n\t\t\t\t\ttext_input.width( o.width );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttext_input.width( 300 );\n\t\t\t}\n\t\t\tif ( o.height > 0 ) {\n\t\t\t\ttext_input.height( o.height );\n\t\t\t}\n\n\t\t\tif ( o.rows > 0 ) {\n\t\t\t\ttext_input.attr( 'rows', o.rows );\n\t\t\t} else {\n\t\t\t\ttext_input.attr( 'rows', 5 );\n\t\t\t}\n\n\t\t\tif ( o.style ) {\n\t\t\t\t$this.css( o.style );\n\t\t\t}\n\n\t\t\ttext_input.change( function() {\n\t\t\t\tif ( check_box ) {\n\t\t\t\t\t$this.setCheckBox( true );\n\t\t\t\t}\n\n\t\t\t\t$this.trigger( 'formItemChange', [$this] );\n\t\t\t} );\n\n\t\t\ttext_input.mouseover( function() {\n\n\t\t\t\tif ( enabled ) {\n\t\t\t\t\tif ( error_string && error_string.length > 0 ) {\n\t\t\t\t\t\t$this.showErrorTip( 20 );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} );\n\n\t\t\ttext_input.mouseout( function() {\n\t\t\t\tif ( !$( $this ).is( ':focus' ) ) {\n\t\t\t\t\t$this.hideErrorTip();\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\ttext_input.focusin( function() {\n\t\t\t\tif ( !enabled ) {\n\t\t\t\t\tif ( !check_box ) {\n\t\t\t\t\t\tif ( LocalCacheData.current_open_sub_controller &&\n\t\t\t\t\t\t\tLocalCacheData.current_open_sub_controller.edit_view &&\n\t\t\t\t\t\t\tLocalCacheData.current_open_sub_controller.is_viewing ) {\n\t\t\t\t\t\t\terror_string = LocalCacheData.current_open_sub_controller.getViewModeErrorMessage();\n\t\t\t\t\t\t\t$this.showErrorTip( 10 );\n\t\t\t\t\t\t} else if ( LocalCacheData.current_open_primary_controller &&\n\t\t\t\t\t\t\tLocalCacheData.current_open_primary_controller.edit_view &&\n\t\t\t\t\t\t\tLocalCacheData.current_open_primary_controller.is_viewing ) {\n\t\t\t\t\t\t\terror_string = LocalCacheData.current_open_primary_controller.getViewModeErrorMessage();\n\t\t\t\t\t\t\t$this.showErrorTip( 10 );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( error_string && error_string.length > 0 ) {\n\t\t\t\t\t\t$this.showErrorTip( 20 );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\ttext_input.focusout( function() {\n\t\t\t\t$this.hideErrorTip();\n\t\t\t} );\n\n\t\t\t//Prevent missing formula input box from appearing during first load.\n\t\t\tTTPromise.wait( null, null, function() {\n\t\t\t\ttext_input.parents( '.formula-builder' ).css( 'opacity', 1 );\n\t\t\t} );\n\n\t\t} );\n\n\t\treturn this;\n\n\t};\n\n\t$.fn.FormulaBuilder.defaults = {};\n\t$.fn.FormulaBuilder.html_template = `\n\t\n\t\t\n\t\t\n\t
\n\t`;\n\t$.fn.FormulaBuilder.html_template_text_input = `\n\t\n\t\t\n\t\t\n\t
\n\t`;\n\n} )( jQuery );//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTMyNi5qcyIsIm1hcHBpbmdzIjoiO0FBQUE7O0FBRUE7QUFDQSx5QkFBeUI7QUFDekI7QUFDQTs7QUFFQTs7QUFFQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7O0FBRUE7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsTUFBTTs7QUFFTixLQUFLO0FBQ0w7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRU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