"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["company-custom_field-CustomFieldViewController"],{7945:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"CustomFieldViewController\": () => (/* binding */ CustomFieldViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass CustomFieldViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#custom_field_view_container',\n\t\t\ttype_array: null,\n\t\t\tparent_table_array: null,\n\t\t\tstatus_array: null,\n\n\t\t\toriginal_custom_field_select_items: [],\n\t\t\tauthentication_api: null,\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\t//this._super('initialize', options );\n\t\tthis.edit_view_tpl = 'CustomFieldEditView.html';\n\t\tthis.permission_id = 'custom_field';\n\t\tthis.viewId = 'CustomField';\n\t\tthis.script_name = 'CustomFieldView';\n\t\tthis.table_name_key = 'custom_field_control';\n\t\tthis.context_menu_name = $.i18n._( 'Custom Field' );\n\t\tthis.navigation_label = $.i18n._( 'Custom Field' );\n\t\tthis.api = TTAPI.APICustomField;\n\t\tthis.authentication_api = TTAPI.APIAuthentication;\n\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: ['copy', 'mass_edit'],\n\t\t\tinclude: []\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tinitOptions( callBack ) {\n\t\tvar options = [\n\t\t\t// { option_name: 'type_id', field_name: 'type_id', api: this.api },\n\t\t\t{ option_name: 'type', api: this.api },\n\t\t\t{ option_name: 'status', api: this.api },\n\t\t\t{ option_name: 'parent_table', field_name: 'parent_table', api: this.api }\n\t\t];\n\n\t\tthis.initDropDownOptions( options );\n\t}\n\n\tsearchDone( result ) {\n\n\t\tsuper.searchDone();\n\t\tthis.refreshCustomFieldCache();\n\t}\n\n\trefreshCustomFieldCache() {\n\t\tthis.authentication_api.getCustomFieldData( {}, {\n\t\t\tonResult: function( response ) {\n\t\t\t\tlet result = response.getResult();\n\t\t\t\tLocalCacheData.setCustomFieldData( result );\n\t\t\t}\n\t\t});\n\t}\n\n\tbuildEditViewUI() {\n\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_custom_field': {\n\t\t\t\t'label': $.i18n._( 'Custom Field' ),\n\t\t\t\t'is_multi_column': true,\n\t\t\t\t'html_template': this.getCustomFieldTabHtml()\n\t\t\t},\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tthis.navigation.AComboBox( {\n\t\t\tapi_class: TTAPI.APICustomField,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_custom_field',\n\t\t\tnavigation_mode: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tthis.setNavigation();\n\n\t\t//Tab 0 start\n\n\t\tvar tab_custom_field = this.edit_view_tab.find( '#tab_custom_field' );\n\n\t\tvar tab_custom_field_column1 = tab_custom_field.find( '.first-column' );\n\t\tvar tab_custom_field_column2 = tab_custom_field.find( '.second-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_custom_field_column1 );\n\n\t\t//Status\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'status_id' } );\n\t\tform_item_input.setSourceData( $this.status_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Status' ), form_item_input, tab_custom_field_column1, '' );\n\n\t\t//Name\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'name' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Name' ), form_item_input, tab_custom_field_column1, '' );\n\n\t\t// Parent Table\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'parent_table' } );\n\t\tform_item_input.setSourceData( $this.parent_table_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Object Type' ), form_item_input, tab_custom_field_column1, '' );\n\n\t\t// Type\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'type_id' } );\n\t\tform_item_input.setSourceData( $this.type_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Field Type' ), form_item_input, tab_custom_field_column1, '', null, true );\n\n\t\t//Display Order\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'display_order' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Display Order' ), form_item_input, tab_custom_field_column1, '' );\n\n\t\t//Enable Search\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'enable_search' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Enable Search' ), form_item_input, tab_custom_field_column1, '', null, true );\n\n\t\t//Second Column\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.SEPARATED_BOX );\n\t\tform_item_input.SeparatedBox( { label: $.i18n._( 'Validation Rules' ) } );\n\t\tthis.addEditFieldToColumn( null, form_item_input, tab_custom_field_column2, '', null, true, false );\n\n\t\t//Default Value\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'default_value' } );\n\t\tform_item_input.attr( 'id', 'custom-field-default-value' );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Default Value' ), form_item_input, tab_custom_field_column2, '' );\n\n\t\t//Is required\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'is_required' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Required' ), form_item_input, tab_custom_field_column2, '' );\n\n\t\t//Min Length\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'validate_min_length' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Minimum Length' ), form_item_input, tab_custom_field_column2, '', null, true );\n\n\t\t//Max Length\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'validate_max_length' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Maximum Length' ), form_item_input, tab_custom_field_column2, '', null, true );\n\n\t\t//Precision (Decimal Places)\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'validate_decimal_places' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Decimal Places' ), form_item_input, tab_custom_field_column2, '', null, true );\n\n\t\t//Min Amount\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'validate_min_amount' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Minimum Amount' ), form_item_input, tab_custom_field_column2, '', null, true );\n\n\t\t//Max Amount\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'validate_max_amount' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Maximum Amount' ), form_item_input, tab_custom_field_column2, '', null, true );\n\n\t\t//Min Time Unit\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'validate_min_time_unit', mode: 'time_unit', need_parser_sec: true } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Minimum Amount' ), form_item_input, tab_custom_field_column2, '', null, true );\n\n\t\t//Max Time Unit\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'validate_max_time_unit', mode: 'time_unit', need_parser_sec: true } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Maximum Amount' ), form_item_input, tab_custom_field_column2, '', null, true );\n\n\t\t//Min Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\t\tform_item_input.TDatePicker( { field: 'validate_min_date' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Minimum Date' ), form_item_input, tab_custom_field_column2, '', null, true );\n\n\t\t//Max Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\t\tform_item_input.TDatePicker( { field: 'validate_max_date' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Maximum Date' ), form_item_input, tab_custom_field_column2, '', null, true );\n\n\t\t//Min time\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TIME_PICKER );\n\t\tform_item_input.TTimePicker( { field: 'validate_min_time', validation_field: 'time_stamp' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Minimum time' ), form_item_input, tab_custom_field_column2, '', null, true );\n\n\t\t//Max time\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TIME_PICKER );\n\t\tform_item_input.TTimePicker( { field: 'validate_max_time', validation_field: 'time_stamp' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Maximum time' ), form_item_input, tab_custom_field_column2, '', null, true );\n\n\t\t// Multi-select Minimum Amount\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'validate_multi_select_min_amount' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Multi-select Minimum Selected' ), form_item_input, tab_custom_field_column2, '', null, true );\n\n\t\t//Multi-select Maximum Amount\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'validate_multi_select_max_amount' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Multi-select Maximum Selected' ), form_item_input, tab_custom_field_column2, '', null, true );\n\n\t\t//Min Datetime\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\t\tform_item_input.TDatePicker( { field: 'validate_min_datetime', mode: 'date_time' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Minimum Date' ), form_item_input, tab_custom_field_column2, '', null, true );\n\n\t\t//Max Datetime\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\t\tform_item_input.TDatePicker( { field: 'validate_max_datetime', mode: 'date_time' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Maximum Date' ), form_item_input, tab_custom_field_column2, '', null, true );\n\n\t\t//\n\t\t//Inside editor for dropdowns\n\t\t//\n\t\tvar inside_editor_div = tab_custom_field.find( '.inside-editor-div' );\n\t\tvar args = {\n\t\t\tvalue: $.i18n._( 'Item Value' ),\n\t\t\tlabel: $.i18n._( 'Item Display Label' )\n\t\t};\n\n\t\tthis.editor = Global.loadWidgetByName( FormItemType.INSIDE_EDITOR );\n\n\t\tthis.editor.InsideEditor( {\n\t\t\taddRow: this.insideEditorAddRow,\n\t\t\tremoveRow: this.insideEditorRemoveRow,\n\t\t\tgetValue: this.insideEditorGetValue,\n\t\t\tsetValue: this.insideEditorSetValue,\n\t\t\trender: getRender(),\n\t\t\trender_args: args,\n\t\t\trender_inline_html: true,\n\t\t\trow_render: getRowRender(),\n\t\t\tparent_controller: this\n\t\t} );\n\n\t\tfunction getRender() {\n\t\t\treturn `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
<%= value %><%= label %>
`;\n\t\t}\n\n\t\tfunction getRowRender() {\n\t\t\treturn `\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t`;\n\t\t}\n\n\t\tinside_editor_div.append( this.editor );\n\t}\n\n\n\tinsideEditorSetValue( val ) {\n\t\tvar len = val.length;\n\n\t\tthis.removeAllRows();\n\t\tfor ( var i = 0; i < val.length; i++ ) {\n\t\t\tif ( Global.isSet( val[i] ) ) {\n\t\t\t\tvar row = val[i];\n\t\t\t\tif ( Global.isSet( this.parent_id ) ) {\n\t\t\t\t\trow['id'] = '';\n\t\t\t\t}\n\t\t\t\tthis.addRow( row );\n\t\t\t}\n\n\t\t}\n\t}\n\n\tinsideEditorAddRow( data, index ) {\n\t\tlet is_existing_row = false;\n\n\t\tif ( !data ) {\n\t\t\tdata = {};\n\t\t} else {\n\t\t\tis_existing_row = true;\n\t\t}\n\n\t\tvar row_id = data.id ? data.id : TTUUID.generateUUID();\n\n\t\tvar row = this.getRowRender(); //Get Row render\n\t\tvar render = this.getRender(); //get render, should be a table\n\t\tvar widgets = {}; //Save each row's widgets\n\n\t\t//Build row widgets\n\n\t\tvar form_item_input;\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'value' } );\n\t\tform_item_input.setValue( data.value ? data.value : '' );\n\t\tform_item_input.attr( 'item_id', row_id );\n\t\tform_item_input.bind( 'formItemChange', function( e, target, doNotValidate ) {\n\t\t\tthis.parent_controller.onFormItemChange( target, doNotValidate );\n\t\t\tthis.parent_controller.updateCustomFieldDropdowns();\n\t\t}.bind( this ) );\n\n\t\tif ( is_existing_row && this.parent_controller.is_add == false) {\n\t\t\tform_item_input.setEnabled( false );\n\t\t}\n\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 0 ).append( form_item_input );\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'label' } );\n\t\tform_item_input.setValue( data.label ? data.label : '' );\n\t\tform_item_input.bind( 'formItemChange', function( e, target, doNotValidate ) {\n\t\t\tthis.parent_controller.onFormItemChange( target, doNotValidate );\n\t\t\tthis.parent_controller.updateCustomFieldDropdowns();\n\t\t}.bind( this ) );\n\n\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\trow.children().eq( 1 ).append( form_item_input );\n\n\t\tif ( typeof index != 'undefined' ) {\n\t\t\trow.insertAfter( $( render ).find( 'tr' ).eq( index ) );\n\t\t\tthis.rows_widgets_array.splice( ( index ), 0, widgets );\n\n\t\t} else {\n\t\t\t$( render ).append( row );\n\t\t\tthis.rows_widgets_array.push( widgets );\n\t\t}\n\n\t\tif ( this.parent_controller.is_viewing ) {\n\t\t\trow.find( '.control-icon' ).hide();\n\t\t}\n\n\t\tthis.addIconsEvent( row ); //Bind event to add and minus icon\n\t\tthis.removeLastRowLine();\n\t}\n\n\tinsideEditorRemoveRow( row ) {\n\t\tvar index = row[0].rowIndex - 1;\n\t\trow.remove();\n\t\tthis.rows_widgets_array.splice( index, 1 );\n\t\tthis.removeLastRowLine();\n\n\t\tthis.parent_controller.updateCustomFieldDropdowns();\n\t\tthis.parent_controller.createMetaData( this.parent_controller.current_edit_record.type_id );\n\t}\n\n\tinsideEditorGetValue( current_edit_item_id ) {\n\t\tvar len = this.rows_widgets_array.length;\n\n\t\tvar result = [];\n\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tvar row = this.rows_widgets_array[i];\n\n\t\t\tvar data = {\n\t\t\t\tvalue: row.value.getValue(),\n\t\t\t\tlabel: row.label.getValue(),\n\t\t\t\tid: row.value.getValue()\n\t\t\t};\n\n\t\t\tresult.push( data );\n\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tsetEditViewDataDone() {\n\t\tsuper.setEditViewDataDone();\n\t\tthis.onTypeChange( true );\n\t\tthis.initInsideEditorData( true );\n\t}\n\n\tinitInsideEditorData( reset_rows ) {\n\t\tvar $this = this;\n\t\tvar args = {};\n\t\targs.filter_data = {};\n\n\t\tif ( reset_rows ) {\n\t\t\t//On initial open make sure to reset rows, else if user is using navigation arrows the select items from the old record will be shown\n\t\t\tthis.editor.removeAllRows();\n\t\t}\n\n\t\tif ( this.mass_edit || ( !this.current_edit_record.meta_data.validation.multi_select_items || !this.current_edit_record.meta_data.validation.multi_select_items.length > 0 ) || !this.current_edit_record ) {\n\t\t\t$this.editor.removeAllRows();\n\t\t\t$this.editor.addRow();\n\t\t\t$this.original_custom_field_select_items = [];\n\t\t} else {\n\t\t\t$this.original_custom_field_select_items = [];\n\t\t\tfor ( var i = 0; i < $this.current_edit_record.meta_data.validation.multi_select_items.length; i++ ) {\n\t\t\t\tvar item = $this.current_edit_record.meta_data.validation.multi_select_items[i];\n\t\t\t\tif ( item.id !== TTUUID.zero_id && item.id !== TTUUID.not_exist_id ) {\n\t\t\t\t\t$this.editor.addRow( item );\n\t\t\t\t\t$this.original_custom_field_select_items.push( item );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tsaveInsideEditorData( callBack ) {\n\t\tthis.createMetaData();\n\n\t\tif ( callBack ) {\n\t\t\tcallBack();\n\t\t}\n\t}\n\n\tonFormItemChange( target, doNotValidate ) {\n\n\t\tthis.setIsChanged( target );\n\t\tthis.setMassEditingFieldsWhenFormChange( target );\n\t\tvar key = target.getField();\n\t\tvar c_value = target.getValue();\n\t\tthis.current_edit_record[key] = c_value;\n\n\t\tswitch ( key ) {\n\t\t\tcase 'type_id':\n\t\t\t\tthis.onTypeChange( false );\n\t\t\t\tbreak;\n\t\t\tcase 'parent_table':\n\t\t\t\tthis.onParentTableChange();\n\t\t\t\tbreak;\n\t\t\tcase 'value':\n\t\t\t\tthis.onSelectValueChange( target[0], c_value );\n\t\t\t\tbreak;\n\t\t}\n\n\t\tthis.createMetaData( this.current_edit_record.type_id );\n\n\t\tif ( !doNotValidate ) {\n\t\t\tthis.validate();\n\t\t}\n\t}\n\n\tonTypeChange( set_default ) {\n\t\tthis.hideValidationFields();\n\n\t\tif ( this.current_edit_record.type_id == 1010 ) {\n\t\t\tthis.detachElement( 'enable_search' );\n\t\t} else {\n\t\t\tthis.attachElement( 'enable_search' );\n\t\t}\n\n\t\tif ( this.current_edit_record.type_id == 100 || this.current_edit_record.type_id == 110 ) {\n\t\t\tthis.attachElement( 'validate_min_length' );\n\t\t\tthis.attachElement( 'validate_max_length' );\n\t\t} else if ( this.current_edit_record.type_id == 400 || this.current_edit_record.type_id == 410 || this.current_edit_record.type_id == 420 ) {\n\t\t\tthis.attachElement( 'validate_min_amount' );\n\t\t\tthis.attachElement( 'validate_max_amount' );\n\t\t\tif ( this.current_edit_record.type_id == 410 ) {\n\t\t\t\tthis.attachElement( 'validate_decimal_places' );\n\t\t\t}\n\t\t} else if ( this.current_edit_record.type_id == 1000 || this.current_edit_record.type_id == 1010 ) {\n\t\t\tthis.attachElement( 'validate_min_date' );\n\t\t\tthis.attachElement( 'validate_max_date' );\n\t\t} else if ( this.current_edit_record.type_id == 1100 ) {\n\t\t\tthis.attachElement( 'validate_min_time' );\n\t\t\tthis.attachElement( 'validate_max_time' );\n\t\t} else if ( this.current_edit_record.type_id == 1200 ) {\n\t\t\tthis.attachElement( 'validate_min_datetime' );\n\t\t\tthis.attachElement( 'validate_max_datetime' );\n\t\t} else if ( this.current_edit_record.type_id == 1300 ) {\n\t\t\tthis.attachElement( 'validate_min_time_unit' );\n\t\t\tthis.attachElement( 'validate_max_time_unit' );\n\t\t} else if ( this.current_edit_record.type_id == 2100 ) {\n\t\t\t$( '#tab_custom_field_content_div #dropdown-editor').show();\n\t\t} else if ( this.current_edit_record.type_id == 2110 ) {\n\t\t\t$( '#tab_custom_field_content_div #dropdown-editor').show()\n\t\t\tthis.attachElement( 'validate_multi_select_min_amount' );\n\t\t\tthis.attachElement( 'validate_multi_select_max_amount' );\n\t\t}\n\n\t\tthis.changeDefaultValueFormItemType( this.current_edit_record.type_id, set_default );\n\t\tthis.editFieldResize();\n\t}\n\n\tonParentTableChange() {\n\t\tthis.setPunchFieldTypes();\n\t}\n\n\tonSelectValueChange(element, value) {\n\t\telement.id = value;\n\t}\n\n\tchangeDefaultValueFormItemType( new_type_id, set_default ) {\n\t\tlet target_column = this.edit_view_tab.find( '#tab_custom_field .second-column' );\n\n\t\tlet form_array = this.getCustomFieldFormInputByType( new_type_id, 'default_value', this.current_edit_record.meta_data );\n\t\tlet form_item_input = form_array[0];\n\t\tlet widget_container = form_array[1];\n\n\t\tform_item_input.attr( 'id', 'custom-field-default-value-new' );\n\t\tthis.edit_view_ui_dic['default_value'] = form_item_input;\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Default Value' ), form_item_input, target_column, '', widget_container );\n\t\tform_item_input.css( 'opacity', 1 );\n\n\t\tlet old_input = document.querySelector( '#custom-field-default-value' );\n\t\tlet new_input = document.querySelector( '#custom-field-default-value-new' );\n\n\t\t//Swap the old default value input with the new one, then delete the old one.\n\t\tlet temp_node = document.createElement( \"div\" );\n\t\told_input.parentNode.insertBefore( temp_node, old_input );\n\t\tnew_input.parentNode.insertBefore( old_input, new_input );\n\t\ttemp_node.parentNode.insertBefore( new_input, temp_node );\n\t\ttemp_node.parentNode.removeChild( temp_node );\n\t\told_input.parentNode.parentNode.remove();\n\n\t\t//Set ID of the new default value input to the old one.\n\t\tnew_input.id = 'custom-field-default-value';\n\n\t\tif ( set_default ) {\n\t\t\tform_item_input.setValue( this.current_edit_record.default_value );\n\t\t} else {\n\t\t\tthis.current_edit_record.default_value = '';\n\t\t}\n\t}\n\n\thideValidationFields() {\n\t\tthis.detachElement( 'validate_min_length' );\n\t\tthis.detachElement( 'validate_max_length' );\n\t\tthis.detachElement( 'validate_min_amount' );\n\t\tthis.detachElement( 'validate_max_amount' );\n\t\tthis.detachElement( 'validate_decimal_places' );\n\t\tthis.detachElement( 'validate_min_date' );\n\t\tthis.detachElement( 'validate_max_date' );\n\t\tthis.detachElement( 'validate_min_time_unit' );\n\t\tthis.detachElement( 'validate_max_time_unit' );\n\t\tthis.detachElement( 'validate_min_time' );\n\t\tthis.detachElement( 'validate_max_time' );\n\t\tthis.detachElement( 'validate_min_datetime' );\n\t\tthis.detachElement( 'validate_max_datetime' );\n\t\tthis.detachElement( 'validate_multi_select_min_amount' );\n\t\tthis.detachElement( 'validate_multi_select_max_amount' );\n\n\t\t$( '#tab_custom_field_content_div #dropdown-editor').hide()\n\t}\n\n\tcreateMetaData( type_id ) {\n\n\t\ttype_id = parseInt( type_id ); //Switch is strict on type, so we need to parseInt()\n\n\t\tswitch ( type_id ) {\n\t\t\tcase 100: //Text\n\t\t\tcase 110: //Textarea\n\t\t\t\tthis.current_edit_record.meta_data.validation = {\n\t\t\t\t\t'validate_min_length': this.current_edit_record.validate_min_length,\n\t\t\t\t\t'validate_max_length': this.current_edit_record.validate_max_length,\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase 400: //Integer\n\t\t\tcase 420: //Currency\n\t\t\t\tthis.current_edit_record.meta_data.validation = {\n\t\t\t\t\t'validate_min_amount': this.current_edit_record.validate_min_amount,\n\t\t\t\t\t'validate_max_amount': this.current_edit_record.validate_max_amount,\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase 410: //Decimal\n\t\t\t\tthis.current_edit_record.meta_data.validation = {\n\t\t\t\t\t'validate_min_amount': this.current_edit_record.validate_min_amount,\n\t\t\t\t\t'validate_max_amount': this.current_edit_record.validate_max_amount,\n\t\t\t\t\t'validate_decimal_places': this.current_edit_record.validate_decimal_places,\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase 1000: //Date\n\t\t\tcase 1010: //Date range\n\t\t\t\tthis.current_edit_record.meta_data.validation = {\n\t\t\t\t\t'validate_min_date': this.current_edit_record.validate_min_date,\n\t\t\t\t\t'validate_max_date': this.current_edit_record.validate_max_date,\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase 1100: //Time\n\t\t\t\tthis.current_edit_record.meta_data.validation = {\n\t\t\t\t\t'validate_min_time': this.current_edit_record.validate_min_time,\n\t\t\t\t\t'validate_max_time': this.current_edit_record.validate_max_time,\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase 1200: //Datetike\n\t\t\t\tthis.current_edit_record.meta_data.validation = {\n\t\t\t\t\t'validate_min_datetime': this.current_edit_record.validate_min_datetime,\n\t\t\t\t\t'validate_max_datetime': this.current_edit_record.validate_max_datetime,\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase 1300: //Time Unit\n\t\t\t\tthis.current_edit_record.meta_data.validation = {\n\t\t\t\t\t'validate_min_time_unit': this.current_edit_record.validate_min_time_unit,\n\t\t\t\t\t'validate_max_time_unit': this.current_edit_record.validate_max_time_unit,\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase 2100: //Single-select\n\t\t\t\tthis.current_edit_record.meta_data.validation = {\n\t\t\t\t\t'multi_select_items': this.editor.getValue(),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tcase 2110: //Multi-select\n\t\t\t\tthis.current_edit_record.meta_data.validation = {\n\t\t\t\t\t'validate_multi_select_min_amount': this.current_edit_record.validate_multi_select_min_amount,\n\t\t\t\t\t'validate_multi_select_max_amount': this.current_edit_record.validate_multi_select_max_amount,\n\t\t\t\t\t'multi_select_items': this.editor.getValue().filter( ( item ) => item.value !== '' || item.label !== '' ),\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis.current_edit_record.meta_data.validation = {}; //Clear all validation fields\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tupdateCustomFieldDropdowns() {\n\t\tif ( this.current_edit_record.type_id == 2100 || this.current_edit_record.type_id == 2110 ) {\n\t\t\tlet source_data = this.editor.getValue();\n\t\t\tlet default_data = this.current_edit_record.default_value;\n\t\t\tthis.edit_view_ui_dic['default_value'].setSourceData( source_data );\n\t\t\tif ( Array.isArray( source_data ) && source_data.some( item => item.id == default_data ) ) {\n\t\t\t\tthis.edit_view_ui_dic['default_value'].setValue( this.current_edit_record.default_value );\n\t\t\t} else {\n\t\t\t\t//If more than one item is selected, unselect the removed item only. Otherwise set dropdown to null for no item selected.\n\t\t\t\tif ( Array.isArray( default_data ) && default_data.length > 1 ) {\n\t\t\t\t\tthis.edit_view_ui_dic['default_value'].setValue( default_data.filter( default_item => source_data.some( source_item => source_item.id == default_item ) ) );\n\t\t\t\t} else {\n\t\t\t\t\tthis.edit_view_ui_dic['default_value'].setValue( null );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tsetCurrentEditRecordData() {\n\t\tthis.parseMetaDataToCurrentEditRecord();\n\t\tsuper.setCurrentEditRecordData();\n\n\t\tif ( this.is_add == false ) {\n\t\t\tthis.edit_view_ui_dic['type_id'].setEnabled( false );\n\t\t\tthis.edit_view_ui_dic['parent_table'].setEnabled( false );\n\t\t}\n\n\t\tthis.setPunchFieldTypes();\n\t}\n\n\tsetPunchFieldTypes() {\n\n\t\tvar punch_allowed_types_api_params = { 'parent_table': this.current_edit_record.parent_table };\n\t\tvar punch_allowed_types = this.api.getOptions( 'type_id', punch_allowed_types_api_params, { async: false } ).getResult();\n\n\t\tthis.edit_view_ui_dic.type_id.setSourceData( punch_allowed_types );\n\n\t\tif ( punch_allowed_types[this.current_edit_record.type_id] ) {\n\t\t\t//Changing source data visually changes the selected item, so we need to set it back to the current value.\n\t\t\tthis.edit_view_ui_dic.type_id.setValue( this.current_edit_record.type_id );\n\t\t} else {\n\t\t\t//Selected type is not allowed for this parent table. Set to first allowed type.\n\t\t\tthis.edit_view_ui_dic.type_id.setValue( Object.keys( punch_allowed_types )[0] );\n\t\t\tthis.current_edit_record.type_id = Object.keys( punch_allowed_types )[0];\n\t\t}\n\t}\n\n\tparseMetaDataToCurrentEditRecord() {\n\t\tfor ( var rule in this.current_edit_record.meta_data.validation ) {\n\t\t\tthis.current_edit_record[rule] = this.current_edit_record.meta_data.validation[rule];\n\t\t}\n\t}\n\n\tbuildSearchFields() {\n\n\t\tsuper.buildSearchFields();\n\t\tthis.search_fields = [\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Name' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'name',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tform_item_type: FormItemType.TEXT_INPUT\n\t\t\t} ),\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Status' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'status_id',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Field Type' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'type_id',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Object Type' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'parent_table',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\t\t];\n\t}\n\n\tsetDefaultMenuAddIcon( context_btn, grid_selected_length, pId ) {\n\t\t//Community edition cannot add custom fields.\n\t\tif ( Global.getProductEdition() == 10 ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t} else {\n\t\t\tsuper.setDefaultMenuAddIcon( context_btn, grid_selected_length, pId );\n\t\t}\n\t}\n\n\tgetCustomFieldTabHtml() {\n\t\treturn `
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
`;\n\t}\n\n\tcopyAsNewResetIds( data ) {\n\t\tif ( this.edit_view_ui_dic['type_id'] && this.edit_view_ui_dic['parent_table'] ) {\n\t\t\t//If copying as new while on a record instead of list view, these may already be disabled.\n\t\t\t//Copy as new does not build a new edit view and instead resets the current_edit_record.id.\n\t\t\tthis.edit_view_ui_dic['type_id'].setEnabled( true );\n\t\t\tthis.edit_view_ui_dic['parent_table'].setEnabled( true );\n\t\t}\n\t\treturn super.copyAsNewResetIds( data );\n\t}\n\n\tonSaveDone( result ) {\n\t\t//Clearing cache to prevent issues with report display columns showing outdated cached results.\n\t\tGlobal.clearCache( 'getOptions_columns' );\n\t\tGlobal.clearCache( 'getOptions_debit_credit_variables' ); //PayStubEntryAccount variable selector\n\t\tGlobal.clearCache( 'getOptions_formula_columns' ); //Custom columns variable selector\n\t\tsuper.onSaveDone( result );\n\t}\n\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzk0NS5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBTztBQUNQLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0EsSUFBSTs7QUFFSjtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsMkJBQTJCLENBQUM7QUFDNUIsMEJBQTBCLENBQUM7QUFDM0I7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQSxRQUFRLDhEQUE4RDtBQUN0RSxLQUFLLG9DQUFvQztBQUN6QyxLQUFLLHNDQUFzQztBQUMzQyxLQUFLO0FBQ0w7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