TimeTrex/interface/html5/dist/payroll-process_transactions_wizard-ProcessTransactionsWizardStepHome.bundle.js

1 line
48 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["payroll-process_transactions_wizard-ProcessTransactionsWizardStepHome","wizard-WizardStep"],{8880:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"WizardStep\": () => (/* binding */ WizardStep)\n/* harmony export */ });\n/* harmony import */ var _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6739);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\nclass WizardStep extends _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__.TTBackboneView {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tprevious_step_name: null,\n\t\t\tnext_step_name: null,\n\t\t\tbuttons: null,\n\t\t\twizard_obj: null, //rename to wizard_obj\n\n\t\t\tclicked_buttons: {},\n\t\t\treload: false,\n\n\t\t\tapi: null,\n\n\t\t\t//override in children\n\t\t\tname: 'undefined',\n\t\t\ttitle: $.i18n._( 'Undefined Step' ),\n\t\t\tinstructions: $.i18n._( 'Undefined step data' )\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( wizard_obj ) {\n\t\tsuper.initialize( wizard_obj );\n\n\t\tthis.buttons = {};\n\t\tthis.clicked_buttons = {}; //Clear clicked buttons on each step so checking that all buttons are clicked doesn't carry state from one step to the next. (ie: They click a required button on Step 2, but not Step 3, the count for required buttons would still match as 1)\n\t\tthis.reload = false;\n\t\tthis.setWizardObject( wizard_obj );\n\t\tvar $this = this;\n\t\tthis.init();\n\t}\n\n\t//Children must always call render()\n\tinit() {\n\t\tthis.render();\n\t}\n\n\tinitCardsBlock() {\n\t\t$( this.wizard_obj.el ).find( '#cards' ).html( '' );\n\t}\n\n\tsetTitle( title ) {\n\t\t$( this.wizard_obj.el ).find( '.title-1' ).html( title );\n\t}\n\n\tsetInstructions( instructions, callback ) {\n\n\t\tif ( $( this.el ).find( '.instructions' ).length == 0 ) {\n\t\t\t$( this.el ).find( '.progress-bar' ).append( '<p class=\"instructions\"></p>' );\n\t\t}\n\n\t\t$( this.el ).find( '.progress-bar .instructions' ).html( instructions );\n\n\t\tif ( typeof callback == 'function' ) {\n\t\t\tcallback();\n\t\t}\n\t}\n\n\tsetWizardObject( val ) {\n\t\tthis.wizard_obj = val;\n\t\tthis.el = this.wizard_obj.el;\n\t}\n\n\tgetWizardObject() {\n\t\treturn this.wizard_obj;\n\t}\n\n\tsetNextStepName( val ) {\n\t\tthis.next_step_name = val;\n\t}\n\n\tgetNextStepName() {\n\t\treturn false;\n\t}\n\n\tsetPreviousStepName( val ) {\n\t\tthis.previous_step_name = val;\n\t}\n\n\tgetPreviousStepName() {\n\t\treturn false;\n\t}\n\n\trender() {\n\t\tthis.initCardsBlock();\n\t\treturn this._render();\n\t}\n\n\t_render() {\n\t\treturn;\n\t\t//always overrirde\n\t}\n\n\tappend( content ) {\n\t\t$( this.wizard_obj.el ).find( '.content' ).append( content );\n\t}\n\n\tappendButton( button ) {\n\t\t$( this.wizard_obj.el ).find( '#cards' ).append( button );\n\t}\n\n\tsetGrid( gridId, grid_div, allMultipleSelection ) {\n\n\t\tif ( !allMultipleSelection ) {\n\t\t\tallMultipleSelection = false;\n\t\t}\n\n\t\t$( '#' + gridId ).remove(); //Remove the grid to prevent JS Exception: Uncaught TypeError: Failed to execute 'replaceChild' on 'Node': parameter 2 is not of type 'Node'.\n\n\t\tthis.append( grid_div );\n\n\t\tvar grid = $( '#' + gridId );\n\n\t\tvar grid_columns = this.getGridColumns( gridId );\n\n\t\tvar $this = this;\n\n\t\tgrid = new TTGrid( gridId, {\n\t\t\tonSelectRow: function( e ) {\n\t\t\t\t$this.onGridSelectRow( e );\n\t\t\t},\n\t\t\tonSelectAll: function( e ) {\n\t\t\t\tfor ( var n in e ) {\n\t\t\t\t\t$this.onGridSelectRow( e[n] );\n\t\t\t\t}\n\t\t\t},\n\t\t\tondblClickRow: function() {\n\t\t\t\t$this.onGridDblClickRow();\n\t\t\t},\n\t\t\tmultiselect: false,\n\t\t\twinMultiSelect: false\n\t\t}, grid_columns );\n\n\t\tthis.setGridSize( grid );\n\t\tthis.setGridGroupColumns( gridId );\n\n\t\treturn grid; //allowing chaining off this method