"use strict";(self.webpackChunkwebpackcloud=self.webpackChunkwebpackcloud||[]).push([[385],{88727:(e,t,r)=>{r.r(t),r.d(t,{BuildModalGrid:()=>f});r(69826),r(41539),r(47941),r(82526),r(57327),r(38880),r(54747),r(49337);var n=r(45744),o=r(21726),a=r.n(o),i=r(66157),l=r(1703);function c(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function u(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){d(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function d(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.selection,n=t.targetButton,o=t.gridLookupHandler,a=t.masterFilter,l=t.findUrl,c={selection:u({allowSelectAll:!0,selectAllMode:"page",mode:"single"},r)},s=u(u({},JSON.parse(e.consulta)),c),d=createdxDatasource({_AClassName:e.Class,_AFuncaoFiltroCX:i.Bx,options:{targetButton:n,gridLookupHandler:o,masterFilter:a,findUrl:l}}),f={findUrl:l,Class:e.Class,gridName:s.nomegrid,DataSource:d};evaluateGridConfig(s);var g=prepareGridConfig(p.config(f),s);createGrid("dataGridModal",g),$("#myModal").find(".modal-title").text("Consulta "+e.Caption)}var p=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,r,o;return t=e,o=[{key:"config",value:function(e){var t=e.DataSource,r=e.Class,o=e.gridName,i=e.findUrl,c={enabled:!0,type:"custom",customLoad:function(){return n.U.loadGridState({Class:r,gridName:o,findUrl:i})},customSave:function(e){n.U.saveGridState({state:e,Class:r,findUrl:i,gridName:o})}};return{onRowDblClick:function(){(0,l.tT)(),$("#myModal").modal("hide")},onRowRemoving:l.sH,dataSource:t,showRowLines:!1,stateStoring:c,onToolbarPreparing:function(e){var t=e.toolbarOptions.items;t.push({widget:"dxButton",locateInMenu:"auto",showText:"inMenu",options:{icon:"refresh",text:"Atualizar",hint:"Atualizar",onClick:function(){a().getInstance("#dataGridModal").refresh()}},location:"after"}),t.push({location:"after",widget:"dxDropDownButton",options:{dropDownOptions:{width:140},displayExpr:"text",icon:"las la-th",hint:"Opções do grid",items:[{text:"Restaurar colunas",action:"restaurar"},{text:"Selecionar colunas",action:"selecionar"}],onItemClick:function(e){"restaurar"==e.itemData.action?a().getInstance("#dataGridModal").state({}):a().getInstance("#dataGridModal").showColumnChooser()}}})}}}}],(r=null)&&c(t.prototype,r),o&&c(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}()}}]);