text: "use strict";define(["modules/default/defaultcontroller","src/util/util","lodash","src/util/api","src/data/structures"],function(a,b,c,d,e){function f(){}return $.extend(!0,f.prototype,a),f.prototype.moduleInformation={name:"Slick Grid",description:"Table editor based on SlickGrid",author:"Daniel Kostro",date:"14.10.2014",license:"MIT",cssClass:"slickgrid"},f.prototype.configurationStructure=function(){var a=b.getStructuresComboOptions(),c=this.module.model.getjPath("row",!1);return{groups:{group:{options:{type:"list",multiple:!1},fields:{slickCheck:{type:"checkbox",title:"Slick options",options:{editable:"Selectable / Editable",enableAddRow:"Enable add row",autoEdit:"Enable Auto Edit",forceFitColumns:"Force fit Columns",autoFocus:"Auto Focus",rowNumbering:"Show row number when scrolling",oneUncollapsed:"Maximum One group uncollapsed (per level)",filterColumns:"Provides search input for each column",backToTop:"Don't remember scroll position on new variable",forgetLastActive:"Don't scroll back to last active row on new variable",highlightScroll:"Scroll to highlighted line",collapseGroup:"Collapse groups on start"},default:["enableCellNavigation","rowNumbering","forceFitColumns","highlightScroll"]},autoColumns:{type:"checkbox",title:"Auto Columns",options:{remove:"Column for one-click removal of a line",select:"Column for easy selection of lines",reorder:"Column for reordering lines by drag and drop"},default:[]},toolbar:{type:"checkbox",title:"Toolbar options",options:{add:"New row",update:"Update row",remove:"Remove row",showHide:"Show/hide column"},default:[]},colorjpath:{type:"combo",title:"Color jPath",options:c,extractValue:b.jpathToArray,insertValue:b.jpathToString},"slick.defaultColumnWidth":{type:"float",title:"Default Column Width"},"slick.rowHeight":{type:"text",title:"Row Height"},"slick.selectionModel":{type:"combo",title:"Selection",options:[{key:"row",title:"Row Selection Model"},{key:"cell",title:"Cell Selection Model"}],default:"row"},filterType:{type:"combo",title:"Filter script source",options:[{key:"pref",title:"Define in preferences"},{key:"invar",title:"From input variable"}],displaySource:{pref:"p",invar:"i"},default:"pref"},filterRow:{type:"jscode",title:"Filter",default:"// Documentation: https://github.com/NPellet/visualizer/blob/db85d9cc12c6204e4a3afb69bba6d695f6f8bad5/src/modules/types/edition/slick_grid/view.js#L918-L940",displayTarget:["p"]}}},cols:{options:{type:"table",multiple:!0,title:"Columns"},fields:{name:{type:"text",title:"Column ID (mandatory)"},jpath:{type:"combo",title:"jPath",options:c,extractValue:b.jpathToArray,insertValue:b.jpathToString},editor:{type:"combo",title:"Editor",default:"none",options:[{key:"none",title:"None"},{key:"auto",title:"Based on type"},{key:"string",title:"String"},{key:"number",title:"Number"},{key:"boolean",title:"Boolean"},{key:"color",title:"Color"},{key:"date",title:"Date"},{key:"longtext",title:"Long Text"}]},forceType:{type:"combo",title:"Force type",default:"",options:a},formatter:{type:"combo",title:"Formatter",options:[{key:"typerenderer",title:"Type Renderer"}],default:"typerenderer"},visibility:{type:"combo",title:"Visibility",options:[{key:"both",title:"Main and Popup"},{key:"main",title:"Main"},{key:"popup",title:"Popup"}],default:"both"},rendererOptions:{type:"text",title:"Renderer Options",default:""},width:{type:"text",title:"Width"},minWidth:{type:"text",title:"Min Width"},maxWidth:{type:"text",title:"Max Width"},hideColumn:{type:"checkbox",title:"Hide column at init",options:{yes:"Yes"},default:[]}}},actionCols:{options:{type:"table",multiple:!0,title:"Action columns"},fields:{name:{type:"text",title:"Column ID (mandatory)"},tooltip:{type:"text",title:"Tooltip"},icon:{type:"text",title:"Icon"},backgroundColor:{type:"spectrum",title:"Background Color",default:[255,255,255,1]},color:{type:"spectrum",title:"Color",default:[0,0,0,1]},action:{type:"text",title:"Action to send"},position:{type:"combo",title:"Position",options:[{key:"begin",title:"Begin"},{key:"end",title:"End"}],default:"end"},width:{type:"text",title:"Width"},minWidth:{type:"text",title:"Min Width"},maxWidth:{type:"text",title:"Max Width"}}},groupings:{options:{type:"table",multiple:!0,title:"Groupings"},fields:{getter:{type:"combo",title:"jPath",options:c,extractValue:b.jpathToArray,insertValue:b.jpathToString},groupName:{type:"text",title:"Group Name"}}},actionOutButtons:{options:{type:"table",multiple:!0,title:"Action out buttons"},fields:{actionName:{type:"text",title:"Action name"},buttonTitle:{type:"text",title:"Button title"}}}}}},f.prototype.configAliases={colorjPath:["groups","group",0,"colorjpath",0],slickCheck:["groups","group",0,"slickCheck",0],"slick.rowHeight":["groups","group",0,"slick.rowHeight",0],"slick.selectionModel":["groups","group",0,"slick.selectionModel",0],"slick.defaultColumnWidth":["groups","group",0,"slick.defaultColumnWidth",0],filterType:["groups","group",0,"filterType",0],filterRow:["groups","group",0,"filterRow",0],cols:["groups","cols",0],actionCols:["groups","actionCols",0],groupings:["groups","groupings",0],actionOutButtons:["groups","actionOutButtons",0],toolbar:["groups","group",0,"toolbar",0],autoColumns:["groups","group",0,"autoColumns",0]},f.prototype.references={row:{label:"Row"},list:{label:"Table",type:"array"},script:{label:"Filter script",type:"string"},rows:{label:"Row selection",type:"array"}},f.prototype.variablesIn=["list","script"],f.prototype.actionsIn=$.extend({},a.actionsIn,{hoverRow:"Mimic row hover",selectRow:"Mimic row click",selectRows:"Set selected rows",addRow:"Add a new row",showColumn:"Show a column",hideColumn:"Hide a column",rerender:"Rerender the grid"}),f.prototype.events={onSelect:{label:"Row clicked",refVariable:["row"],refAction:["row"]},onHover:{label:"Row hovered",refVariable:["row"],refAction:["row"]},onRowChange:{label:"Row changed",refVariable:["row"],refAction:["row"]},onRowNew:{label:"Row added",refVariable:["row"],refAction:["row"]},onRowsDelete:{label:"Rows deleted",refVariable:["rows"],refAction:["rows"]},onRowActive:{label:"Row actived",refVariable:["row"],refAction:["row"]},onRowsSelect:{label:"Rows selected",refVariable:["rows"],refAction:["rows"]}},f.prototype.onRowsSelected=function(a){a=a.filter(function(a){return!!a}),this.createDataFromEvent("onRowsSelect","rows",a),this.sendActionFromEvent("onRowsSelect","rows",a)},f.prototype.onHover=function(a,b){var c=b[this.module.view.idPropertyName];this.lastHoveredItemId!==c&&(this.lastHoveredItemId=c,this.setVarFromEvent("onHover","row","list",[a]),this.sendActionFromEvent("onHover","row",b))},f.prototype.onClick=c.throttle(function(a,b){this.lastClickedItem=b,this.setVarFromEvent("onSelect","row","list",[a]),this.sendActionFromEvent("onSelect","row",b)},250,{trailing:!1}),f.prototype.onActive=function(a,b){this.setVarFromEvent("onRowActive","row","list",[a]),this.sendActionFromEvent("onRowActive","row",b)},f.prototype.onRowChange=function(a,b){this.setVarFromEvent("onRowChange","row","list",[a]),this.sendActionFromEvent("onRowChange","row",b)},f.prototype.onRowNew=function(a,b){this.setVarFromEvent("onRowNew","row","list",[a]),this.sendActionFromEvent("onRowNew","row",b)},f.prototype.onRowsDelete=function(a){this.createDataFromEvent("onRowsDelete","rows",a),this.sendActionFromEvent("onRowsDelete","rows",a)},f.prototype.export=function(){return this.module.view.exportToTabDelimited()},f.prototype.sendActionButton=function(a,b){d.doAction(a,b)},f});