{"version":3,"sources":["webpack:///./src/dashboard-components/heroux-exposure-grid.js"],"names":["$","kendo","jQuery","getGridColumns","typeNumCol","columns","field","title","hidden","headerAttributes","style","attributes","format","width","forEach","element","column","typeNum","push","renderGrid","$container","options","renderLocation","Promise","resolve","actionName","dataSourceUrl","get","response","data","typeNumCols","grid","empty","kendoGrid","editable","scrollable","dataSource","schema","model","id","fields","DivisionId","type","Division","PeriodStart","PeriodEnd","dataBound","e","items","sender","length","closest","remove","prepend","filterable","sortable","pageable","render","location"],"mappings":"uIAAMA,EAAIC,MAAMC,OAEhB,SAASC,EAAeC,GACtB,IAAMC,EAAU,CACd,CACEC,MAAO,aACPC,MAAO,aACPC,QAAQ,EACRC,iBAAkB,CAChBC,MAAO,uBAETC,WAAY,CACVD,MAAO,sBAGX,CACEJ,MAAO,WACPC,MAAO,WACPC,QAAQ,EACRC,iBAAkB,CAChBC,MAAO,uBAETC,WAAY,CACVD,MAAO,sBAGX,CACEJ,MAAO,cACPC,MAAO,cACPC,QAAQ,EACRC,iBAAkB,CAChBC,MAAO,uBAETC,WAAY,CACVD,MAAO,sBAETE,OAAQ,gBAEV,CACEN,MAAO,YACPC,MAAO,YACPE,iBAAkB,CAChBC,MAAO,uBAETC,WAAY,CACVD,MAAO,sBAETF,QAAQ,EACRI,OAAQ,gBAEV,CACEN,MAAO,SACPC,MAAO,SACPM,MAAO,QACPL,QAAQ,EACRC,iBAAkB,CAChBC,MAAO,uBAETC,WAAY,CACVD,MAAO,uBAkCb,OA7BAN,EAAWU,QAAQ,SAASC,GAC1B,IAAMC,EAAS,CACbV,MAAOS,EAAQT,MACfC,MAAOQ,EAAQE,QACfR,iBAAkB,CAChBC,MAAO,uBAETC,WAAY,CACVD,MAAO,sBAETG,MAAO,QACPD,OAAQ,UAGV,OAAQI,EAAOV,OACb,IAAK,QACHU,EAAOL,WAAW,SAAW,kBAC7B,MACF,IAAK,cACHK,EAAOJ,OAAS,SAChB,MACF,IAAK,QACHI,EAAOJ,OAAS,SAChB,MAGJP,EAAQa,KAAKF,KAGf,UAAWX,EAAX,CAAoB,KAGtB,SAASc,EAAWC,EAAYC,EAASC,GACvC,OAAO,IAAIC,QAAQ,SAASC,GAC1B,IAAMC,EAA+B,UAAlBH,EAA6B,aAAe,sBACzDI,EAAgB,8BAAH,OAAiCD,GAEpDzB,EAAE2B,IAAID,EAAeL,EAAS,SAASO,GAAU,IACxCC,EAAqBD,EAArBC,KAAMC,EAAeF,EAAfE,YAEPC,EAAOX,EACVY,QACAC,UAAU,CACTC,UAAU,EACVC,YAAY,EACZC,WAAY,CACVP,KAAMA,EACNQ,OAAQ,CACNC,MAAO,CACLC,GAAI,KACJC,OAAQ,CACNC,WAAY,CACVC,KAAM,UAERC,SAAU,CACRD,KAAM,UAERE,YAAa,CACXF,KAAM,QAERG,UAAW,CACTH,KAAM,YAMhBI,UAAW,SAASC,GAClB,GAAuB,cAAnBzB,EAAgC,CAClC,IAAM0B,EAAQD,EAAEE,OAAOb,WAAWP,OAAOqB,OAC5B,GAATF,GACFD,EAAEE,OAAOlC,QAAQoC,QAAQ,cAAcC,SAErCJ,EAAQ,IACVD,EAAEE,OAAOlC,QAAQoC,QAAQ,cAAcE,QAAQ,6BAGnD7B,EAAQO,IAEVuB,YAAY,EACZC,UAAU,EACVC,UAAU,EACVnD,QAASF,EAAe2B,KAEzBD,KAAK,iBAKC,cACb4B,OAAQ,SAASrC,EAAYC,GAAiC,IAAxBqC,EAAwB,uDAAb,YAC/C,OAAOvC,EAAWC,EAAYC,EAASqC","file":"js/chunk-2d0c1776.ce86862a.js","sourcesContent":["const $ = kendo.jQuery\n\nfunction getGridColumns(typeNumCol) {\n const columns = [\n {\n field: 'DivisionId',\n title: 'DivisionId',\n hidden: true,\n headerAttributes: {\n style: 'text-align: center;',\n },\n attributes: {\n style: 'text-align: left;',\n },\n },\n {\n field: 'Division',\n title: 'Division',\n hidden: true,\n headerAttributes: {\n style: 'text-align: center;',\n },\n attributes: {\n style: 'text-align: left;',\n },\n },\n {\n field: 'PeriodStart',\n title: 'PeriodStart',\n hidden: true,\n headerAttributes: {\n style: 'text-align: center;',\n },\n attributes: {\n style: 'text-align: right;',\n },\n format: '{0:yyyy-MMM}',\n },\n {\n field: 'PeriodEnd',\n title: 'PeriodEnd',\n headerAttributes: {\n style: 'text-align: center;',\n },\n attributes: {\n style: 'text-align: right;',\n },\n hidden: true,\n format: '{0:yyyy-MMM}',\n },\n {\n field: 'Period',\n title: 'Period',\n width: '150px',\n hidden: false,\n headerAttributes: {\n style: 'text-align: center;',\n },\n attributes: {\n style: 'text-align: left;',\n },\n },\n ]\n\n typeNumCol.forEach(function(element) {\n const column = {\n field: element.field,\n title: element.typeNum,\n headerAttributes: {\n style: 'text-align: center;',\n },\n attributes: {\n style: 'text-align: right;',\n },\n width: '120px',\n format: '{0:N0}',\n }\n\n switch (column.field) {\n case 'Hedge':\n column.attributes['class'] = 'hedgeCDrillDown'\n break\n case 'Hedge_Ratio':\n column.format = '{0:P2}'\n break\n case 'Level':\n column.format = '{0:N4}'\n break\n }\n\n columns.push(column)\n })\n\n return [...columns, {}]\n}\n\nfunction renderGrid($container, options, renderLocation) {\n return new Promise(function(resolve) {\n const actionName = renderLocation == 'report' ? 'dataSource' : 'dataSourceComponent'\n const dataSourceUrl = `/api/heroux/ExposureReport/${actionName}`\n\n $.get(dataSourceUrl, options, function(response) {\n const {data, typeNumCols} = response\n\n const grid = $container\n .empty()\n .kendoGrid({\n editable: false,\n scrollable: false,\n dataSource: {\n data: data,\n schema: {\n model: {\n id: 'Id',\n fields: {\n DivisionId: {\n type: 'number',\n },\n Division: {\n type: 'string',\n },\n PeriodStart: {\n type: 'date',\n },\n PeriodEnd: {\n type: 'date',\n },\n },\n },\n },\n },\n dataBound: function(e) {\n if (renderLocation === 'dashboard') {\n const items = e.sender.dataSource.data().length\n if (items == 0) {\n e.sender.element.closest('.component').remove()\n }\n if (items > 25) {\n e.sender.element.closest('.component').prepend('