angular-ui-grid
Advanced tools
Comparing version 4.11.0 to 4.11.1
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
!function(){"use strict";var e=angular.module("ui.grid.exporter",["ui.grid"]);e.constant("uiGridExporterConstants",{featureName:"exporter",rowHeaderColName:"treeBaseRowHeaderCol",selectionRowHeaderColName:"selectionRowHeaderCol",ALL:"all",VISIBLE:"visible",SELECTED:"selected",CSV_CONTENT:"CSV_CONTENT",BUTTON_LABEL:"BUTTON_LABEL",FILE_NAME:"FILE_NAME"}),e.service("uiGridExporterService",["$filter","$q","uiGridExporterConstants","gridUtil","$compile","$interval","i18nService",function(p,n,x,d,e,t,r){var o={delay:100,initializeGrid:function(r){r.exporter={},this.defaultGridOptions(r.options);var e={events:{exporter:{}},methods:{exporter:{csvExport:function(e,t){o.csvExport(r,e,t)},pdfExport:function(e,t){o.pdfExport(r,e,t)},excelExport:function(e,t){o.excelExport(r,e,t)}}}};r.api.registerEventsFromObject(e.events),r.api.registerMethodsFromObject(e.methods),r.api.core.addToGridMenu?o.addToMenu(r):t(function(){r.api.core.addToGridMenu&&o.addToMenu(r)},this.delay,1)},defaultGridOptions:function(e){e.exporterSuppressMenu=!0===e.exporterSuppressMenu,e.exporterMenuLabel=e.exporterMenuLabel?e.exporterMenuLabel:"Export",e.exporterSuppressColumns=e.exporterSuppressColumns?e.exporterSuppressColumns:[],e.exporterCsvColumnSeparator=e.exporterCsvColumnSeparator?e.exporterCsvColumnSeparator:",",e.exporterCsvFilename=e.exporterCsvFilename?e.exporterCsvFilename:"download.csv",e.exporterPdfFilename=e.exporterPdfFilename?e.exporterPdfFilename:"download.pdf",e.exporterExcelFilename=e.exporterExcelFilename?e.exporterExcelFilename:"download.xlsx",e.exporterExcelSheetName=e.exporterExcelSheetName?e.exporterExcelSheetName:"Sheet1",e.exporterOlderExcelCompatibility=!0===e.exporterOlderExcelCompatibility,e.exporterIsExcelCompatible=!0===e.exporterIsExcelCompatible,e.exporterMenuItemOrder=e.exporterMenuItemOrder?e.exporterMenuItemOrder:200,e.exporterPdfDefaultStyle=e.exporterPdfDefaultStyle?e.exporterPdfDefaultStyle:{fontSize:11},e.exporterPdfTableStyle=e.exporterPdfTableStyle?e.exporterPdfTableStyle:{margin:[0,5,0,15]},e.exporterPdfTableHeaderStyle=e.exporterPdfTableHeaderStyle?e.exporterPdfTableHeaderStyle:{bold:!0,fontSize:12,color:"black"},e.exporterPdfHeader=e.exporterPdfHeader?e.exporterPdfHeader:null,e.exporterPdfFooter=e.exporterPdfFooter?e.exporterPdfFooter:null,e.exporterPdfOrientation=e.exporterPdfOrientation?e.exporterPdfOrientation:"landscape",e.exporterPdfPageSize=e.exporterPdfPageSize?e.exporterPdfPageSize:"A4",e.exporterPdfMaxGridWidth=e.exporterPdfMaxGridWidth?e.exporterPdfMaxGridWidth:720,e.exporterMenuAllData=void 0===e.exporterMenuAllData||e.exporterMenuAllData,e.exporterMenuVisibleData=void 0===e.exporterMenuVisibleData||e.exporterMenuVisibleData,e.exporterMenuSelectedData=void 0===e.exporterMenuSelectedData||e.exporterMenuSelectedData,e.exporterMenuCsv=void 0===e.exporterMenuCsv||e.exporterMenuCsv,e.exporterMenuPdf=void 0===e.exporterMenuPdf||e.exporterMenuPdf,e.exporterMenuExcel=void 0===e.exporterMenuExcel||e.exporterMenuExcel,e.exporterPdfCustomFormatter=e.exporterPdfCustomFormatter&&"function"==typeof e.exporterPdfCustomFormatter?e.exporterPdfCustomFormatter:function(e){return e},e.exporterHeaderFilterUseName=!0===e.exporterHeaderFilterUseName,e.exporterFieldCallback=e.exporterFieldCallback?e.exporterFieldCallback:i,e.exporterFieldFormatCallback=e.exporterFieldFormatCallback?e.exporterFieldFormatCallback:function(e,t,r,o){return null},e.exporterExcelCustomFormatters=e.exporterExcelCustomFormatters?e.exporterExcelCustomFormatters:function(e,t,r){return r},e.exporterExcelHeader=e.exporterExcelHeader?e.exporterExcelHeader:function(e,t,r,o){return null},e.exporterColumnScaleFactor=e.exporterColumnScaleFactor?e.exporterColumnScaleFactor:3.5,e.exporterFieldApplyFilters=!0===e.exporterFieldApplyFilters,e.exporterAllDataFn=e.exporterAllDataFn?e.exporterAllDataFn:null,null===e.exporterAllDataFn&&e.exporterAllDataPromise&&(e.exporterAllDataFn=e.exporterAllDataPromise)},addToMenu:function(e){e.api.core.addToGridMenu(e,[{title:r.getSafeText("gridMenu.exporterAllAsCsv"),action:function(){e.api.exporter.csvExport(x.ALL,x.ALL)},shown:function(){return e.options.exporterMenuCsv&&e.options.exporterMenuAllData},order:e.options.exporterMenuItemOrder},{title:r.getSafeText("gridMenu.exporterVisibleAsCsv"),action:function(){e.api.exporter.csvExport(x.VISIBLE,x.VISIBLE)},shown:function(){return e.options.exporterMenuCsv&&e.options.exporterMenuVisibleData},order:e.options.exporterMenuItemOrder+1},{title:r.getSafeText("gridMenu.exporterSelectedAsCsv"),action:function(){e.api.exporter.csvExport(x.SELECTED,x.VISIBLE)},shown:function(){return e.options.exporterMenuCsv&&e.options.exporterMenuSelectedData&&e.api.selection&&0<e.api.selection.getSelectedRows().length},order:e.options.exporterMenuItemOrder+2},{title:r.getSafeText("gridMenu.exporterAllAsPdf"),action:function(){e.api.exporter.pdfExport(x.ALL,x.ALL)},shown:function(){return e.options.exporterMenuPdf&&e.options.exporterMenuAllData},order:e.options.exporterMenuItemOrder+3},{title:r.getSafeText("gridMenu.exporterVisibleAsPdf"),action:function(){e.api.exporter.pdfExport(x.VISIBLE,x.VISIBLE)},shown:function(){return e.options.exporterMenuPdf&&e.options.exporterMenuVisibleData},order:e.options.exporterMenuItemOrder+4},{title:r.getSafeText("gridMenu.exporterSelectedAsPdf"),action:function(){e.api.exporter.pdfExport(x.SELECTED,x.VISIBLE)},shown:function(){return e.options.exporterMenuPdf&&e.options.exporterMenuSelectedData&&e.api.selection&&0<e.api.selection.getSelectedRows().length},order:e.options.exporterMenuItemOrder+5},{title:r.getSafeText("gridMenu.exporterAllAsExcel"),action:function(){e.api.exporter.excelExport(x.ALL,x.ALL)},shown:function(){return e.options.exporterMenuExcel&&e.options.exporterMenuAllData},order:e.options.exporterMenuItemOrder+6},{title:r.getSafeText("gridMenu.exporterVisibleAsExcel"),action:function(){e.api.exporter.excelExport(x.VISIBLE,x.VISIBLE)},shown:function(){return e.options.exporterMenuExcel&&e.options.exporterMenuVisibleData},order:e.options.exporterMenuItemOrder+7},{title:r.getSafeText("gridMenu.exporterSelectedAsExcel"),action:function(){e.api.exporter.excelExport(x.SELECTED,x.VISIBLE)},shown:function(){return e.options.exporterMenuExcel&&e.options.exporterMenuSelectedData&&e.api.selection&&0<e.api.selection.getSelectedRows().length},order:e.options.exporterMenuItemOrder+8}])},csvExport:function(o,n,i){var a=this;this.loadAllDataIfNeeded(o,n,i).then(function(){var e=o.options.showHeader?a.getColumnHeaders(o,i):[],t=a.getData(o,n,i),r=a.formatAsCsv(e,t,o.options.exporterCsvColumnSeparator);a.downloadFile(o.options.exporterCsvFilename,r,o.options.exporterCsvColumnSeparator,o.options.exporterOlderExcelCompatibility,o.options.exporterIsExcelCompatible)})},loadAllDataIfNeeded:function(t,e,r){if(e===x.ALL&&t.rows.length!==t.options.totalItems&&t.options.exporterAllDataFn)return t.options.exporterAllDataFn().then(function(e){t.modifyRows(e)});var o=n.defer();return o.resolve(),o.promise},getColumnHeaders:function(r,e){var t,o=[];if(e===x.ALL)t=r.columns;else{var n=r.renderContainers.left?r.renderContainers.left.visibleColumnCache.filter(function(e){return e.visible}):[],i=r.renderContainers.body?r.renderContainers.body.visibleColumnCache.filter(function(e){return e.visible}):[],a=r.renderContainers.right?r.renderContainers.right.visibleColumnCache.filter(function(e){return e.visible}):[];t=n.concat(i,a)}return t.forEach(function(e){if(!0!==e.colDef.exporterSuppressExport&&"$$hashKey"!==e.field&&-1===r.options.exporterSuppressColumns.indexOf(e.name)){var t={name:e.field,displayName:function(e,t){if(e.options.exporterHeaderFilter)return e.options.exporterHeaderFilterUseName?e.options.exporterHeaderFilter(t.name):e.options.exporterHeaderFilter(t.displayName);return t.headerCellFilter?p(t.headerCellFilter)(t.displayName):t.displayName}(r,e),width:e.drawnWidth?e.drawnWidth:e.width,align:e.colDef.align?e.colDef.align:"number"===e.colDef.type?"right":"left"};o.push(t)}}),o},getRowsFromNode:function(e){var t=[],r=e?Object.keys(e):["children"];if((1<r.length||"children"!=r[0])&&t.push(e),e&&e.children&&0<e.children.length)for(var o=0;o<e.children.length;o++)t=t.concat(this.getRowsFromNode(e.children[o]));return t},getDataSorted:function(e){if(!e.treeBase||0===e.treeBase.numberLevels)return e.rows;for(var t=[],r=0;r<e.treeBase.tree.length;r++)for(var o=this.getRowsFromNode(e.treeBase.tree[r]),n=0;n<o.length;n++)t.push(o[n].row);return t},getData:function(a,e,l,p){var t,r,o=[];switch(e){case x.ALL:t=this.getDataSorted(a,e,l,p);break;case x.VISIBLE:t=a.getVisibleRows();break;case x.SELECTED:a.api.selection?t=a.api.selection.getSelectedGridRows():d.logError("selection feature must be enabled to allow selected rows to be exported")}if(l===x.ALL)r=a.columns;else{var n=a.renderContainers.left?a.renderContainers.left.visibleColumnCache.filter(function(e){return e.visible}):[],i=a.renderContainers.body?a.renderContainers.body.visibleColumnCache.filter(function(e){return e.visible}):[],s=a.renderContainers.right?a.renderContainers.right.visibleColumnCache.filter(function(e){return e.visible}):[];r=n.concat(i,s)}return t.forEach(function(n){if(!1!==n.exporterEnableExporting){var i=[];r.forEach(function(e){if((e.visible||l===x.ALL)&&!0!==e.colDef.exporterSuppressExport&&"$$hashKey"!==e.field&&-1===a.options.exporterSuppressColumns.indexOf(e.name)){var t=p?a.getCellDisplayValue(n,e):a.getCellValue(n,e),r={value:a.options.exporterFieldCallback(a,n,e,t)},o=a.options.exporterFieldFormatCallback(a,n,e,t);o&&Object.assign(r,o),e.colDef.exporterPdfAlign&&(r.alignment=e.colDef.exporterPdfAlign),i.push(r)}}),o.push(i)}}),o},formatAsCsv:function(e,t,r){var o=e.map(function(e){return{value:e.displayName}}),n=0<o.length?this.formatRowAsCsv(this,r)(o)+"\n":"";return n+=t.map(this.formatRowAsCsv(this,r)).join("\n")},formatRowAsCsv:function(t,r){return function(e){return e.map(t.formatFieldAsCsv).join(r)}},formatFieldAsCsv:function(e){return null==e.value?"":"number"==typeof e.value?e.value:"boolean"==typeof e.value?e.value?"TRUE":"FALSE":"string"==typeof e.value?'"'+e.value.replace(/"/g,'""')+'"':"object"!=typeof e.value||e.value instanceof Date?JSON.stringify(e.value):'"'+JSON.stringify(e.value).replace(/"/g,'""')+'"'},isIE:function(){var e=!1;return-1!==navigator.userAgent.search(/(?:Edge|MSIE|Trident\/.*; rv:)/)&&(e=!0),e},downloadFile:function(e,t,r,o,n){var i,a=document,l=a.createElement("a"),p="application/octet-stream;charset=utf-8",s=this.isIE();if(n&&(t="sep="+r+"\r\n"+t),navigator.msSaveBlob)return navigator.msSaveOrOpenBlob(new Blob([o?"\ufeff":"",t],{type:p}),e);if(s){var d=a.createElement("iframe");return document.body.appendChild(d),d.contentWindow.document.open("text/html","replace"),d.contentWindow.document.write(t),d.contentWindow.document.close(),d.contentWindow.focus(),d.contentWindow.document.execCommand("SaveAs",!0,e),document.body.removeChild(d),!0}if("download"in l){var u=new Blob([o?"\ufeff":"",t],{type:p});i=URL.createObjectURL(u),l.setAttribute("download",e)}else i="data: "+p+","+encodeURIComponent(t),l.setAttribute("target","_blank");l.href=i,l.setAttribute("style","display:none;"),a.body.appendChild(l),setTimeout(function(){if(l.click)l.click();else if(document.createEvent){var e=document.createEvent("MouseEvents");e.initEvent("click",!0,!0),l.dispatchEvent(e)}a.body.removeChild(l)},this.delay)},pdfExport:function(o,n,i){var a=this;this.loadAllDataIfNeeded(o,n,i).then(function(){var e=a.getColumnHeaders(o,i),t=a.getData(o,n,i),r=a.prepareAsPdf(o,e,t);a.isIE()||-1!==navigator.appVersion.indexOf("Edge")?a.downloadPDF(o.options.exporterPdfFilename,r):pdfMake.createPdf(r).open()})},downloadPDF:function(r,e){var o,n,i=document;i.createElement("a");o=this.isIE(),pdfMake.createPdf(e).getBuffer(function(e){if(n=new Blob([e]),navigator.msSaveBlob)return navigator.msSaveBlob(n,r);if(o){var t=i.createElement("iframe");return document.body.appendChild(t),t.contentWindow.document.open("text/html","replace"),t.contentWindow.document.write(n),t.contentWindow.document.close(),t.contentWindow.focus(),t.contentWindow.document.execCommand("SaveAs",!0,r),document.body.removeChild(t),!0}})},prepareAsPdf:function(e,t,r){var o=this.calculatePdfHeaderWidths(e,t),n=t.map(function(e){return{text:e.displayName,style:"tableHeader"}}),i=r.map(this.formatRowAsPdf(this)),a=[n].concat(i),l={pageOrientation:e.options.exporterPdfOrientation,pageSize:e.options.exporterPdfPageSize,content:[{style:"tableStyle",table:{headerRows:1,widths:o,body:a}}],styles:{tableStyle:e.options.exporterPdfTableStyle,tableHeader:e.options.exporterPdfTableHeaderStyle},defaultStyle:e.options.exporterPdfDefaultStyle};return e.options.exporterPdfLayout&&(l.layout=e.options.exporterPdfLayout),e.options.exporterPdfHeader&&(l.header=e.options.exporterPdfHeader),e.options.exporterPdfFooter&&(l.footer=e.options.exporterPdfFooter),e.options.exporterPdfCustomFormatter&&(l=e.options.exporterPdfCustomFormatter(l)),l},calculatePdfHeaderWidths:function(t,e){var r=0;e.forEach(function(e){"number"==typeof e.width&&(r+=e.width)});var o=0;e.forEach(function(e){if("*"===e.width&&(o+=100),"string"==typeof e.width&&e.width.match(/(\d)*%/)){var t=parseInt(e.width.match(/(\d)*%/)[0]);e.width=r*t/100,o+=e.width}});var n=r+o;return e.map(function(e){return"*"===e.width?e.width:e.width*t.options.exporterPdfMaxGridWidth/n})},formatRowAsPdf:function(t){return function(e){return e.map(t.formatFieldAsPdfString)}},formatFieldAsPdfString:function(e){var t;return t=null==e.value?"":"number"==typeof e.value?e.value.toString():"boolean"==typeof e.value?e.value?"TRUE":"FALSE":"string"==typeof e.value?e.value.replace(/"/g,'""'):e.value instanceof Date?JSON.stringify(e.value).replace(/^"/,"").replace(/"$/,""):"object"==typeof e.value?e.value:JSON.stringify(e.value).replace(/^"/,"").replace(/"$/,""),e.alignment&&"string"==typeof e.alignment&&(t={text:t,alignment:e.alignment}),t},formatAsExcel:function(e,t,r,o,n){for(var i=e.map(function(e){return{value:e.displayName}}),a=[],l=[],p=0;p<i.length;p++){var s="header";switch(e[p].align){case"center":s="headerCenter";break;case"right":s="headerRight"}var d=n.styles&&n.styles[s]?{style:n.styles[s].id}:null;l.push({value:i[p].value,metadata:d})}a.push(l);for(var u=t.map(this.formatRowAsExcel(this,r,o)),c=0;c<u.length;c++)a.push(u[c]);return a},formatRowAsExcel:function(n,i,a){return function(e){for(var t=[],r=0;r<e.length;r++){var o=n.formatFieldAsExcel(e[r],i,a);t.push({value:o,metadata:e[r].metadata})}return t}},formatFieldAsExcel:function(e,t,r,o){return null==e.value?"":"number"==typeof e.value||"string"==typeof e.value?e.value:"boolean"==typeof e.value?e.value?"TRUE":"FALSE":JSON.stringify(e.value)},prepareAsExcel:function(e,t,r){var o={styles:{}};if(e.options.exporterExcelCustomFormatters&&(o=e.options.exporterExcelCustomFormatters(e,t,o)),e.options.exporterExcelHeader)if(angular.isFunction(e.options.exporterExcelHeader))e.options.exporterExcelHeader(e,t,r,o);else{var n=e.options.exporterExcelHeader.text,i=e.options.exporterExcelHeader.style;r.data.push([{value:n,metadata:{style:o.styles[i].id}}])}return o},excelExport:function(s,d,u){var c=this;this.loadAllDataIfNeeded(s,d,u).then(function(){var e=s.options.showHeader?c.getColumnHeaders(s,u):[],t=new ExcelBuilder.Workbook,r=s.options.exporterExcelSheetName?s.options.exporterExcelSheetName:"Sheet1",o=new ExcelBuilder.Worksheet({name:r});t.addWorksheet(o);for(var n=c.prepareAsExcel(s,t,o),i=[],a=s.treeBase?s.treeBase.numberLevels:s.enableRowSelection?1:0;a<s.columns.length;a++)s.columns[a].field!==x.rowHeaderColName&&s.columns[a].field!==x.selectionRowHeaderColName&&i.push({width:s.columns[a].drawnWidth/s.options.exporterColumnScaleFactor});o.setColumns(i);var l=c.getData(s,d,u,s.options.exporterFieldApplyFilters),p=c.formatAsExcel(e,l,t,o,n);o.setData(o.data.concat(p)),ExcelBuilder.Builder.createFile(t,{type:"blob"}).then(function(e){c.downloadFile(s.options.exporterExcelFilename,e,s.options.exporterCsvColumnSeparator,s.options.exporterOlderExcelCompatibility)})})}};function i(e,t,r,o){var n,i,a,l;return r.cellFilter?(i=(n=r.cellFilter.match(/(?:[^:"]+|"[^"]*")+/g))[0]?n[0].replace(/[\'\"\s]/g,""):null,a=n[1]?n[1].replace(/[\'\"]/g,"").trim():null,l=n[2]?n[2].replace(/[\'\"\s]/g,""):null,p(i)(o,a,l)):o}return o}]),e.directive("uiGridExporter",["uiGridExporterConstants","uiGridExporterService","gridUtil","$compile",function(e,n,t,r){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,link:function(e,t,r,o){n.initializeGrid(o.grid),o.grid.exporter.$scope=e}}}])}(),angular.module("ui.grid.exporter").run(["$templateCache",function(e){"use strict";e.put("ui-grid/csvLink",'<span class="ui-grid-exporter-csv-link-span"><a href="data:text/csv;charset=UTF-8,CSV_CONTENT" download="FILE_NAME">LINK_LABEL</a></span>')}]); | ||
!function(){"use strict";var e=angular.module("ui.grid.exporter",["ui.grid"]);e.constant("uiGridExporterConstants",{featureName:"exporter",rowHeaderColName:"treeBaseRowHeaderCol",selectionRowHeaderColName:"selectionRowHeaderCol",ALL:"all",VISIBLE:"visible",SELECTED:"selected",CSV_CONTENT:"CSV_CONTENT",BUTTON_LABEL:"BUTTON_LABEL",FILE_NAME:"FILE_NAME"}),e.service("uiGridExporterService",["$filter","$q","uiGridExporterConstants","gridUtil","$compile","$interval","i18nService",function(p,n,x,d,e,t,r){var o={delay:100,initializeGrid:function(r){r.exporter={},this.defaultGridOptions(r.options);var e={events:{exporter:{}},methods:{exporter:{csvExport:function(e,t){o.csvExport(r,e,t)},pdfExport:function(e,t){o.pdfExport(r,e,t)},excelExport:function(e,t){o.excelExport(r,e,t)}}}};r.api.registerEventsFromObject(e.events),r.api.registerMethodsFromObject(e.methods),r.api.core.addToGridMenu?o.addToMenu(r):t(function(){r.api.core.addToGridMenu&&o.addToMenu(r)},this.delay,1)},defaultGridOptions:function(e){e.exporterSuppressMenu=!0===e.exporterSuppressMenu,e.exporterMenuLabel=e.exporterMenuLabel?e.exporterMenuLabel:"Export",e.exporterSuppressColumns=e.exporterSuppressColumns?e.exporterSuppressColumns:[],e.exporterCsvColumnSeparator=e.exporterCsvColumnSeparator?e.exporterCsvColumnSeparator:",",e.exporterCsvFilename=e.exporterCsvFilename?e.exporterCsvFilename:"download.csv",e.exporterPdfFilename=e.exporterPdfFilename?e.exporterPdfFilename:"download.pdf",e.exporterExcelFilename=e.exporterExcelFilename?e.exporterExcelFilename:"download.xlsx",e.exporterExcelSheetName=e.exporterExcelSheetName?e.exporterExcelSheetName:"Sheet1",e.exporterOlderExcelCompatibility=!0===e.exporterOlderExcelCompatibility,e.exporterIsExcelCompatible=!0===e.exporterIsExcelCompatible,e.exporterMenuItemOrder=e.exporterMenuItemOrder?e.exporterMenuItemOrder:200,e.exporterPdfDefaultStyle=e.exporterPdfDefaultStyle?e.exporterPdfDefaultStyle:{fontSize:11},e.exporterPdfTableStyle=e.exporterPdfTableStyle?e.exporterPdfTableStyle:{margin:[0,5,0,15]},e.exporterPdfTableHeaderStyle=e.exporterPdfTableHeaderStyle?e.exporterPdfTableHeaderStyle:{bold:!0,fontSize:12,color:"black"},e.exporterPdfHeader=e.exporterPdfHeader?e.exporterPdfHeader:null,e.exporterPdfFooter=e.exporterPdfFooter?e.exporterPdfFooter:null,e.exporterPdfOrientation=e.exporterPdfOrientation?e.exporterPdfOrientation:"landscape",e.exporterPdfPageSize=e.exporterPdfPageSize?e.exporterPdfPageSize:"A4",e.exporterPdfMaxGridWidth=e.exporterPdfMaxGridWidth?e.exporterPdfMaxGridWidth:720,e.exporterMenuAllData=void 0===e.exporterMenuAllData||e.exporterMenuAllData,e.exporterMenuVisibleData=void 0===e.exporterMenuVisibleData||e.exporterMenuVisibleData,e.exporterMenuSelectedData=void 0===e.exporterMenuSelectedData||e.exporterMenuSelectedData,e.exporterMenuCsv=void 0===e.exporterMenuCsv||e.exporterMenuCsv,e.exporterMenuPdf=void 0===e.exporterMenuPdf||e.exporterMenuPdf,e.exporterMenuExcel=void 0===e.exporterMenuExcel||e.exporterMenuExcel,e.exporterPdfCustomFormatter=e.exporterPdfCustomFormatter&&"function"==typeof e.exporterPdfCustomFormatter?e.exporterPdfCustomFormatter:function(e){return e},e.exporterHeaderFilterUseName=!0===e.exporterHeaderFilterUseName,e.exporterFieldCallback=e.exporterFieldCallback?e.exporterFieldCallback:i,e.exporterFieldFormatCallback=e.exporterFieldFormatCallback?e.exporterFieldFormatCallback:function(e,t,r,o){return null},e.exporterExcelCustomFormatters=e.exporterExcelCustomFormatters?e.exporterExcelCustomFormatters:function(e,t,r){return r},e.exporterExcelHeader=e.exporterExcelHeader?e.exporterExcelHeader:function(e,t,r,o){return null},e.exporterColumnScaleFactor=e.exporterColumnScaleFactor?e.exporterColumnScaleFactor:3.5,e.exporterFieldApplyFilters=!0===e.exporterFieldApplyFilters,e.exporterAllDataFn=e.exporterAllDataFn?e.exporterAllDataFn:null,null===e.exporterAllDataFn&&e.exporterAllDataPromise&&(e.exporterAllDataFn=e.exporterAllDataPromise)},addToMenu:function(e){e.api.core.addToGridMenu(e,[{title:r.getSafeText("gridMenu.exporterAllAsCsv"),action:function(){e.api.exporter.csvExport(x.ALL,x.ALL)},shown:function(){return e.options.exporterMenuCsv&&e.options.exporterMenuAllData},order:e.options.exporterMenuItemOrder},{title:r.getSafeText("gridMenu.exporterVisibleAsCsv"),action:function(){e.api.exporter.csvExport(x.VISIBLE,x.VISIBLE)},shown:function(){return e.options.exporterMenuCsv&&e.options.exporterMenuVisibleData},order:e.options.exporterMenuItemOrder+1},{title:r.getSafeText("gridMenu.exporterSelectedAsCsv"),action:function(){e.api.exporter.csvExport(x.SELECTED,x.VISIBLE)},shown:function(){return e.options.exporterMenuCsv&&e.options.exporterMenuSelectedData&&e.api.selection&&0<e.api.selection.getSelectedRows().length},order:e.options.exporterMenuItemOrder+2},{title:r.getSafeText("gridMenu.exporterAllAsPdf"),action:function(){e.api.exporter.pdfExport(x.ALL,x.ALL)},shown:function(){return e.options.exporterMenuPdf&&e.options.exporterMenuAllData},order:e.options.exporterMenuItemOrder+3},{title:r.getSafeText("gridMenu.exporterVisibleAsPdf"),action:function(){e.api.exporter.pdfExport(x.VISIBLE,x.VISIBLE)},shown:function(){return e.options.exporterMenuPdf&&e.options.exporterMenuVisibleData},order:e.options.exporterMenuItemOrder+4},{title:r.getSafeText("gridMenu.exporterSelectedAsPdf"),action:function(){e.api.exporter.pdfExport(x.SELECTED,x.VISIBLE)},shown:function(){return e.options.exporterMenuPdf&&e.options.exporterMenuSelectedData&&e.api.selection&&0<e.api.selection.getSelectedRows().length},order:e.options.exporterMenuItemOrder+5},{title:r.getSafeText("gridMenu.exporterAllAsExcel"),action:function(){e.api.exporter.excelExport(x.ALL,x.ALL)},shown:function(){return e.options.exporterMenuExcel&&e.options.exporterMenuAllData},order:e.options.exporterMenuItemOrder+6},{title:r.getSafeText("gridMenu.exporterVisibleAsExcel"),action:function(){e.api.exporter.excelExport(x.VISIBLE,x.VISIBLE)},shown:function(){return e.options.exporterMenuExcel&&e.options.exporterMenuVisibleData},order:e.options.exporterMenuItemOrder+7},{title:r.getSafeText("gridMenu.exporterSelectedAsExcel"),action:function(){e.api.exporter.excelExport(x.SELECTED,x.VISIBLE)},shown:function(){return e.options.exporterMenuExcel&&e.options.exporterMenuSelectedData&&e.api.selection&&0<e.api.selection.getSelectedRows().length},order:e.options.exporterMenuItemOrder+8}])},csvExport:function(n,i,a){var l=this;this.loadAllDataIfNeeded(n,i,a).then(function(){var e=n.options.showHeader?l.getColumnHeaders(n,a):[],t=l.getData(n,i,a),r=l.formatAsCsv(e,t,n.options.exporterCsvColumnSeparator),o=angular.isFunction(n.options.exporterCsvFilename)?n.options.exporterCsvFilename(n,i,a):n.options.exporterCsvFilename;l.downloadFile(o,r,n.options.exporterCsvColumnSeparator,n.options.exporterOlderExcelCompatibility,n.options.exporterIsExcelCompatible)})},loadAllDataIfNeeded:function(t,e,r){if(e===x.ALL&&t.rows.length!==t.options.totalItems&&t.options.exporterAllDataFn)return t.options.exporterAllDataFn().then(function(e){t.modifyRows(e)});var o=n.defer();return o.resolve(),o.promise},getColumnHeaders:function(r,e){var t,o=[];if(e===x.ALL)t=r.columns;else{var n=r.renderContainers.left?r.renderContainers.left.visibleColumnCache.filter(function(e){return e.visible}):[],i=r.renderContainers.body?r.renderContainers.body.visibleColumnCache.filter(function(e){return e.visible}):[],a=r.renderContainers.right?r.renderContainers.right.visibleColumnCache.filter(function(e){return e.visible}):[];t=n.concat(i,a)}return t.forEach(function(e){if(!0!==e.colDef.exporterSuppressExport&&"$$hashKey"!==e.field&&-1===r.options.exporterSuppressColumns.indexOf(e.name)){var t={name:e.field,displayName:function(e,t){if(e.options.exporterHeaderFilter)return e.options.exporterHeaderFilterUseName?e.options.exporterHeaderFilter(t.name):e.options.exporterHeaderFilter(t.displayName);return t.headerCellFilter?p(t.headerCellFilter)(t.displayName):t.displayName}(r,e),width:e.drawnWidth?e.drawnWidth:e.width,align:e.colDef.align?e.colDef.align:"number"===e.colDef.type?"right":"left"};o.push(t)}}),o},getRowsFromNode:function(e){var t=[],r=e?Object.keys(e):["children"];if((1<r.length||"children"!=r[0])&&t.push(e),e&&e.children&&0<e.children.length)for(var o=0;o<e.children.length;o++)t=t.concat(this.getRowsFromNode(e.children[o]));return t},getDataSorted:function(e){if(!e.treeBase||0===e.treeBase.numberLevels)return e.rows;for(var t=[],r=0;r<e.treeBase.tree.length;r++)for(var o=this.getRowsFromNode(e.treeBase.tree[r]),n=0;n<o.length;n++)t.push(o[n].row);return t},getData:function(a,e,l,p){var t,r,o=[];switch(e){case x.ALL:t=this.getDataSorted(a,e,l,p);break;case x.VISIBLE:t=a.getVisibleRows();break;case x.SELECTED:a.api.selection?t=a.api.selection.getSelectedGridRows():d.logError("selection feature must be enabled to allow selected rows to be exported")}if(l===x.ALL)r=a.columns;else{var n=a.renderContainers.left?a.renderContainers.left.visibleColumnCache.filter(function(e){return e.visible}):[],i=a.renderContainers.body?a.renderContainers.body.visibleColumnCache.filter(function(e){return e.visible}):[],s=a.renderContainers.right?a.renderContainers.right.visibleColumnCache.filter(function(e){return e.visible}):[];r=n.concat(i,s)}return t.forEach(function(n){if(!1!==n.exporterEnableExporting){var i=[];r.forEach(function(e){if((e.visible||l===x.ALL)&&!0!==e.colDef.exporterSuppressExport&&"$$hashKey"!==e.field&&-1===a.options.exporterSuppressColumns.indexOf(e.name)){var t=p?a.getCellDisplayValue(n,e):a.getCellValue(n,e),r={value:a.options.exporterFieldCallback(a,n,e,t)},o=a.options.exporterFieldFormatCallback(a,n,e,t);o&&Object.assign(r,o),e.colDef.exporterPdfAlign&&(r.alignment=e.colDef.exporterPdfAlign),i.push(r)}}),o.push(i)}}),o},formatAsCsv:function(e,t,r){var o=e.map(function(e){return{value:e.displayName}}),n=0<o.length?this.formatRowAsCsv(this,r)(o)+"\n":"";return n+=t.map(this.formatRowAsCsv(this,r)).join("\n")},formatRowAsCsv:function(t,r){return function(e){return e.map(t.formatFieldAsCsv).join(r)}},formatFieldAsCsv:function(e){return null==e.value?"":"number"==typeof e.value?e.value:"boolean"==typeof e.value?e.value?"TRUE":"FALSE":"string"==typeof e.value?'"'+e.value.replace(/"/g,'""')+'"':"object"!=typeof e.value||e.value instanceof Date?JSON.stringify(e.value):'"'+JSON.stringify(e.value).replace(/"/g,'""')+'"'},isIE:function(){var e=!1;return-1!==navigator.userAgent.search(/(?:Edge|MSIE|Trident\/.*; rv:)/)&&(e=!0),e},downloadFile:function(e,t,r,o,n){var i,a=document,l=a.createElement("a"),p="application/octet-stream;charset=utf-8",s=this.isIE();if(n&&(t="sep="+r+"\r\n"+t),navigator.msSaveBlob)return navigator.msSaveOrOpenBlob(new Blob([o?"\ufeff":"",t],{type:p}),e);if(s){var d=a.createElement("iframe");return document.body.appendChild(d),d.contentWindow.document.open("text/html","replace"),d.contentWindow.document.write(t),d.contentWindow.document.close(),d.contentWindow.focus(),d.contentWindow.document.execCommand("SaveAs",!0,e),document.body.removeChild(d),!0}if("download"in l){var u=new Blob([o?"\ufeff":"",t],{type:p});i=URL.createObjectURL(u),l.setAttribute("download",e)}else i="data: "+p+","+encodeURIComponent(t),l.setAttribute("target","_blank");l.href=i,l.setAttribute("style","display:none;"),a.body.appendChild(l),setTimeout(function(){if(l.click)l.click();else if(document.createEvent){var e=document.createEvent("MouseEvents");e.initEvent("click",!0,!0),l.dispatchEvent(e)}a.body.removeChild(l)},this.delay)},pdfExport:function(n,i,a){var l=this;this.loadAllDataIfNeeded(n,i,a).then(function(){var e=l.getColumnHeaders(n,a),t=l.getData(n,i,a),r=l.prepareAsPdf(n,e,t);if(l.isIE()||-1!==navigator.appVersion.indexOf("Edge")){var o=angular.isFunction(n.options.exporterPdfFilename)?n.options.exporterPdfFilename(n,i,a):n.options.exporterPdfFilename;l.downloadPDF(o,r)}else pdfMake.createPdf(r).open()})},downloadPDF:function(r,e){var o,n,i=document;i.createElement("a");o=this.isIE(),pdfMake.createPdf(e).getBuffer(function(e){if(n=new Blob([e]),navigator.msSaveBlob)return navigator.msSaveBlob(n,r);if(o){var t=i.createElement("iframe");return document.body.appendChild(t),t.contentWindow.document.open("text/html","replace"),t.contentWindow.document.write(n),t.contentWindow.document.close(),t.contentWindow.focus(),t.contentWindow.document.execCommand("SaveAs",!0,r),document.body.removeChild(t),!0}})},prepareAsPdf:function(e,t,r){var o=this.calculatePdfHeaderWidths(e,t),n=t.map(function(e){return{text:e.displayName,style:"tableHeader"}}),i=r.map(this.formatRowAsPdf(this)),a=[n].concat(i),l={pageOrientation:e.options.exporterPdfOrientation,pageSize:e.options.exporterPdfPageSize,content:[{style:"tableStyle",table:{headerRows:1,widths:o,body:a}}],styles:{tableStyle:e.options.exporterPdfTableStyle,tableHeader:e.options.exporterPdfTableHeaderStyle},defaultStyle:e.options.exporterPdfDefaultStyle};return e.options.exporterPdfLayout&&(l.layout=e.options.exporterPdfLayout),e.options.exporterPdfHeader&&(l.header=e.options.exporterPdfHeader),e.options.exporterPdfFooter&&(l.footer=e.options.exporterPdfFooter),e.options.exporterPdfCustomFormatter&&(l=e.options.exporterPdfCustomFormatter(l)),l},calculatePdfHeaderWidths:function(t,e){var r=0;e.forEach(function(e){"number"==typeof e.width&&(r+=e.width)});var o=0;e.forEach(function(e){if("*"===e.width&&(o+=100),"string"==typeof e.width&&e.width.match(/(\d)*%/)){var t=parseInt(e.width.match(/(\d)*%/)[0]);e.width=r*t/100,o+=e.width}});var n=r+o;return e.map(function(e){return"*"===e.width?e.width:e.width*t.options.exporterPdfMaxGridWidth/n})},formatRowAsPdf:function(t){return function(e){return e.map(t.formatFieldAsPdfString)}},formatFieldAsPdfString:function(e){var t;return t=null==e.value?"":"number"==typeof e.value?e.value.toString():"boolean"==typeof e.value?e.value?"TRUE":"FALSE":"string"==typeof e.value?e.value.replace(/"/g,'""'):e.value instanceof Date?JSON.stringify(e.value).replace(/^"/,"").replace(/"$/,""):"object"==typeof e.value?e.value:JSON.stringify(e.value).replace(/^"/,"").replace(/"$/,""),e.alignment&&"string"==typeof e.alignment&&(t={text:t,alignment:e.alignment}),t},formatAsExcel:function(e,t,r,o,n){for(var i=e.map(function(e){return{value:e.displayName}}),a=[],l=[],p=0;p<i.length;p++){var s="header";switch(e[p].align){case"center":s="headerCenter";break;case"right":s="headerRight"}var d=n.styles&&n.styles[s]?{style:n.styles[s].id}:null;l.push({value:i[p].value,metadata:d})}a.push(l);for(var u=t.map(this.formatRowAsExcel(this,r,o)),c=0;c<u.length;c++)a.push(u[c]);return a},formatRowAsExcel:function(n,i,a){return function(e){for(var t=[],r=0;r<e.length;r++){var o=n.formatFieldAsExcel(e[r],i,a);t.push({value:o,metadata:e[r].metadata})}return t}},formatFieldAsExcel:function(e,t,r,o){return null==e.value?"":"number"==typeof e.value||"string"==typeof e.value?e.value:"boolean"==typeof e.value?e.value?"TRUE":"FALSE":JSON.stringify(e.value)},prepareAsExcel:function(e,t,r){var o={styles:{}};if(e.options.exporterExcelCustomFormatters&&(o=e.options.exporterExcelCustomFormatters(e,t,o)),e.options.exporterExcelHeader)if(angular.isFunction(e.options.exporterExcelHeader))e.options.exporterExcelHeader(e,t,r,o);else{var n=e.options.exporterExcelHeader.text,i=e.options.exporterExcelHeader.style;r.data.push([{value:n,metadata:{style:o.styles[i].id}}])}return o},excelExport:function(s,d,u){var c=this;this.loadAllDataIfNeeded(s,d,u).then(function(){var e=s.options.showHeader?c.getColumnHeaders(s,u):[],t="Sheet1";s.options.exporterExcelSheetName&&(t=angular.isFunction(s.options.exporterExcelSheetName)?s.options.exporterExcelSheetName(s,d,u):s.options.exporterExcelSheetName);var r=new ExcelBuilder.Worksheet({name:t}),o=new ExcelBuilder.Workbook;o.addWorksheet(r);for(var n=c.prepareAsExcel(s,o,r),i=[],a=s.treeBase?s.treeBase.numberLevels:s.enableRowSelection?1:0;a<s.columns.length;a++)s.columns[a].field!==x.rowHeaderColName&&s.columns[a].field!==x.selectionRowHeaderColName&&i.push({width:s.columns[a].drawnWidth/s.options.exporterColumnScaleFactor});r.setColumns(i);var l=c.getData(s,d,u,s.options.exporterFieldApplyFilters),p=c.formatAsExcel(e,l,o,r,n);r.setData(r.data.concat(p)),ExcelBuilder.Builder.createFile(o,{type:"blob"}).then(function(e){var t=angular.isFunction(s.options.exporterExcelFilename)?s.options.exporterExcelFilename(s,d,u):s.options.exporterExcelFilename;c.downloadFile(t,e,s.options.exporterCsvColumnSeparator,s.options.exporterOlderExcelCompatibility)})})}};function i(e,t,r,o){var n,i,a,l;return r.cellFilter?(i=(n=r.cellFilter.match(/(?:[^:"]+|"[^"]*")+/g))[0]?n[0].replace(/[\'\"\s]/g,""):null,a=n[1]?n[1].replace(/[\'\"]/g,"").trim():null,l=n[2]?n[2].replace(/[\'\"\s]/g,""):null,p(i)(o,a,l)):o}return o}]),e.directive("uiGridExporter",["uiGridExporterConstants","uiGridExporterService","gridUtil","$compile",function(e,n,t,r){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,link:function(e,t,r,o){n.initializeGrid(o.grid),o.grid.exporter.$scope=e}}}])}(),angular.module("ui.grid.exporter").run(["$templateCache",function(e){"use strict";e.put("ui-grid/csvLink",'<span class="ui-grid-exporter-csv-link-span"><a href="data:text/csv;charset=UTF-8,CSV_CONTENT" download="FILE_NAME">LINK_LABEL</a></span>')}]); |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -961,3 +961,3 @@ | ||
// look for change of value - and insert a header | ||
if ( !groupFieldState.initialised || rowSorter.getSortFn(grid, groupFieldState.col, renderableRows)(fieldValue, groupFieldState.currentValue) !== 0 ) { | ||
if ( !groupFieldState.initialised || rowSorter.getSortFn(groupFieldState.col)(fieldValue, groupFieldState.currentValue) !== 0 ) { | ||
service.insertGroupHeader( grid, renderableRows, i, processingState, stateIndex ); | ||
@@ -964,0 +964,0 @@ i++; |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
!function(){"use strict";var r=angular.module("ui.grid.grouping",["ui.grid","ui.grid.treeBase"]);r.constant("uiGridGroupingConstants",{featureName:"grouping",rowHeaderColName:"treeBaseRowHeaderCol",EXPANDED:"expanded",COLLAPSED:"collapsed",aggregation:{COUNT:"count",SUM:"sum",MAX:"max",MIN:"min",AVG:"avg"}}),r.service("uiGridGroupingService",["$q","uiGridGroupingConstants","gridUtil","rowSorter","GridRow","gridClassFactory","i18nService","uiGridConstants","uiGridTreeBaseService",function(r,u,a,p,s,d,l,e,c){var f={initializeGrid:function(n,r){c.initializeGrid(n,r),n.grouping={},n.grouping.groupHeaderCache={},f.defaultGridOptions(n.options),n.registerRowsProcessor(f.groupRows,400),n.registerColumnBuilder(f.groupingColumnBuilder),n.registerColumnsProcessor(f.groupingColumnProcessor,400);var o={events:{grouping:{aggregationChanged:{},groupingChanged:{}}},methods:{grouping:{getGrouping:function(r){var o=f.getGrouping(n);return o.grouping.forEach(function(r){r.colName=r.col.name,delete r.col}),o.aggregations.forEach(function(r){r.colName=r.col.name,delete r.col}),o.aggregations=o.aggregations.filter(function(r){return!r.aggregation.source||"grouping"!==r.aggregation.source}),r&&(o.rowExpandedStates=f.getRowExpandedStates(n.grouping.groupingHeaderCache)),o},setGrouping:function(r){f.setGrouping(n,r)},groupColumn:function(r){var o=n.getColumn(r);f.groupColumn(n,o)},ungroupColumn:function(r){var o=n.getColumn(r);f.ungroupColumn(n,o)},clearGrouping:function(){f.clearGrouping(n)},aggregateColumn:function(r,o,i){var e=n.getColumn(r);f.aggregateColumn(n,e,o,i)}}}};n.api.registerEventsFromObject(o.events),n.api.registerMethodsFromObject(o.methods),n.api.core.on.sortChanged(r,f.tidyPriorities)},defaultGridOptions:function(r){r.enableGrouping=!1!==r.enableGrouping,r.groupingShowCounts=!1!==r.groupingShowCounts,r.groupingNullLabel=void 0===r.groupingNullLabel?"Null":r.groupingNullLabel,r.enableGroupHeaderSelection=!0===r.enableGroupHeaderSelection},groupingColumnBuilder:function(r,e,o){if(!1!==r.enableGrouping){void 0===e.grouping&&void 0!==r.grouping?(e.grouping=angular.copy(r.grouping),void 0!==e.grouping.groupPriority&&-1<e.grouping.groupPriority&&(e.treeAggregationFn=c.nativeAggregations()[u.aggregation.COUNT].aggregationFn,e.treeAggregationFinalizerFn=f.groupedFinalizerFn)):void 0===e.grouping&&(e.grouping={}),void 0!==e.grouping&&void 0!==e.grouping.groupPriority&&0<=e.grouping.groupPriority&&(e.suppressRemoveSort=!0);var i={name:"ui.grid.grouping.group",title:l.get().grouping.group,icon:"ui-grid-icon-indent-right",shown:function(){return void 0===this.context.col.grouping||void 0===this.context.col.grouping.groupPriority||this.context.col.grouping.groupPriority<0},action:function(){f.groupColumn(this.context.col.grid,this.context.col)}},n={name:"ui.grid.grouping.ungroup",title:l.get().grouping.ungroup,icon:"ui-grid-icon-indent-left",shown:function(){return void 0!==this.context.col.grouping&&void 0!==this.context.col.grouping.groupPriority&&0<=this.context.col.grouping.groupPriority},action:function(){f.ungroupColumn(this.context.col.grid,this.context.col)}},g={name:"ui.grid.grouping.aggregateRemove",title:l.get().grouping.aggregate_remove,shown:function(){return void 0!==this.context.col.treeAggregationFn},action:function(){f.aggregateColumn(this.context.col.grid,this.context.col,null)}},t=function(r,o){o=o||l.get().grouping["aggregate_"+r]||r;var i={name:"ui.grid.grouping.aggregate"+r,title:o,shown:function(){return void 0===this.context.col.treeAggregation||void 0===this.context.col.treeAggregation.type||this.context.col.treeAggregation.type!==r},action:function(){f.aggregateColumn(this.context.col.grid,this.context.col,r)}};a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.aggregate"+r)||e.menuItems.push(i)};!1!==e.colDef.groupingShowGroupingMenu&&(a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.group")||e.menuItems.push(i),a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.ungroup")||e.menuItems.push(n)),!1!==e.colDef.groupingShowAggregationMenu&&(angular.forEach(c.nativeAggregations(),function(r,o){t(o)}),angular.forEach(o.treeCustomAggregations,function(r,o){t(o,r.menuTitle)}),a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.aggregateRemove")||e.menuItems.push(g))}},groupingColumnProcessor:function(r,o){return r=f.moveGroupColumns(this,r,o)},groupedFinalizerFn:function(r){var o=this;void 0!==r.groupVal?(r.rendered=r.groupVal,o.grid.options.groupingShowCounts&&"date"!==o.colDef.type&&"object"!==o.colDef.type&&(r.rendered+=" ("+r.value+")")):r.rendered=null},moveGroupColumns:function(r,o){return!1===r.options.moveGroupColumns||(o.forEach(function(r,o){r.groupingPosition=o}),o.sort(function(r,o){var i,e;return i=r.isRowHeader?r.headerPriority:void 0===r.grouping||void 0===r.grouping.groupPriority||r.grouping.groupPriority<0?null:r.grouping.groupPriority,e=o.isRowHeader?o.headerPriority:void 0===o.grouping||void 0===o.grouping.groupPriority||o.grouping.groupPriority<0?null:o.grouping.groupPriority,null!==i&&null===e?-1:null!==e&&null===i?1:null!==i&&null!==e?i-e:r.groupingPosition-o.groupingPosition}),o.forEach(function(r){delete r.groupingPosition})),o},groupColumn:function(r,o){void 0===o.grouping&&(o.grouping={});var i=f.getGrouping(r);o.grouping.groupPriority=i.grouping.length,o.previousSort=angular.copy(o.sort),o.sort?void 0!==o.sort.direction&&null!==o.sort.direction||(o.sort.direction=e.ASC):o.sort={direction:e.ASC},o.treeAggregation={type:u.aggregation.COUNT,source:"grouping"},o.colDef&&angular.isFunction(o.colDef.customTreeAggregationFn)?o.treeAggregationFn=o.colDef.customTreeAggregationFn:o.treeAggregationFn=c.nativeAggregations()[u.aggregation.COUNT].aggregationFn,o.treeAggregationFinalizerFn=f.groupedFinalizerFn,r.api.grouping.raise.groupingChanged(o),r.api.core.raise.sortChanged(r,r.getColumnSorting()),r.queueGridRefresh()},ungroupColumn:function(r,o){void 0!==o.grouping&&(delete o.grouping.groupPriority,delete o.treeAggregation,delete o.customTreeAggregationFinalizer,o.previousSort&&(o.sort=o.previousSort,delete o.previousSort),f.tidyPriorities(r),r.api.grouping.raise.groupingChanged(o),r.api.core.raise.sortChanged(r,r.getColumnSorting()),r.queueGridRefresh())},aggregateColumn:function(r,o,i,e){void 0!==o.grouping&&void 0!==o.grouping.groupPriority&&0<=o.grouping.groupPriority&&f.ungroupColumn(r,o);var n={};void 0!==r.options.treeCustomAggregations[i]?n=r.options.treeCustomAggregations[i]:void 0!==c.nativeAggregations()[i]&&(n=c.nativeAggregations()[i]),o.treeAggregation={type:i,label:"string"==typeof e?e:l.get().aggregation[n.label]||n.label},o.treeAggregationFn=n.aggregationFn,o.treeAggregationFinalizerFn=n.finalizerFn,r.api.grouping.raise.aggregationChanged(o),r.queueGridRefresh()},setGrouping:function(i,r){void 0!==r&&(f.clearGrouping(i),r.grouping&&r.grouping.length&&0<r.grouping.length&&r.grouping.forEach(function(r){var o=i.getColumn(r.colName);o&&f.groupColumn(i,o)}),r.aggregations&&r.aggregations.length&&r.aggregations.forEach(function(r){var o=i.getColumn(r.colName);o&&f.aggregateColumn(i,o,r.aggregation.type)}),r.rowExpandedStates&&f.applyRowExpandedStates(i.grouping.groupingHeaderCache,r.rowExpandedStates))},clearGrouping:function(o){var r=f.getGrouping(o);0<r.grouping.length&&r.grouping.forEach(function(r){r.col||(r.col=o.getColumn(r.colName)),f.ungroupColumn(o,r.col)}),0<r.aggregations.length&&r.aggregations.forEach(function(r){r.col||(r.col=o.getColumn(r.colName)),f.aggregateColumn(o,r.col,null)})},tidyPriorities:function(r){void 0!==r&&void 0===r.grid||void 0===this.grid||(r=this.grid);var i=[],e=[];r.columns.forEach(function(r,o){void 0!==r.grouping&&void 0!==r.grouping.groupPriority&&0<=r.grouping.groupPriority?i.push(r):void 0!==r.sort&&void 0!==r.sort.priority&&0<=r.sort.priority&&e.push(r)}),i.sort(function(r,o){return r.grouping.groupPriority-o.grouping.groupPriority}),i.forEach(function(r,o){r.grouping.groupPriority=o,r.suppressRemoveSort=!0,void 0===r.sort&&(r.sort={}),r.sort.priority=o});var o=i.length;e.sort(function(r,o){return r.sort.priority-o.sort.priority}),e.forEach(function(r){r.sort.priority=o,r.suppressRemoveSort=r.colDef.suppressRemoveSort,o++})},groupRows:function(e){if(0===e.length)return e;var n=this;n.grouping.oldGroupingHeaderCache=n.grouping.groupingHeaderCache||{},n.grouping.groupingHeaderCache={};for(var g=f.initialiseProcessingState(n),r=function(r,o){var i=n.getCellValue(u,r.col);r.initialised&&0===p.getSortFn(n,r.col,e)(i,r.currentValue)||(f.insertGroupHeader(n,e,t,g,o),t++)},t=0;t<e.length;t++){var u=e[t];u.visible&&g.forEach(r)}return delete n.grouping.oldGroupingHeaderCache,e},initialiseProcessingState:function(r){var i=[];return f.getGrouping(r).grouping.forEach(function(r,o){i.push({fieldName:r.field,col:r.col,initialised:!1,currentValue:null,currentRow:null})}),i},getGrouping:function(r){var o=[],i=[];return r.columns.forEach(function(r){r.grouping&&void 0!==r.grouping.groupPriority&&0<=r.grouping.groupPriority&&o.push({field:r.field,col:r,groupPriority:r.grouping.groupPriority,grouping:r.grouping}),r.treeAggregation&&r.treeAggregation.type&&i.push({field:r.field,col:r,aggregation:r.treeAggregation})}),o.sort(function(r,o){return r.groupPriority-o.groupPriority}),o.forEach(function(r,o){r.grouping.groupPriority=o,r.groupPriority=o,delete r.grouping}),{grouping:o,aggregations:i}},insertGroupHeader:function(r,o,i,e,n){var g=e[n].col,t=r.getCellValue(o[i],g),u=t;function a(r){return angular.isObject(r)?JSON.stringify(r):r}null==t&&(u=r.options.groupingNullLabel);for(var p,l=r.grouping.oldGroupingHeaderCache,c=0;c<n;c++)l&&l[a(e[c].currentValue)]&&(l=l[a(e[c].currentValue)].children);for(l&&l[a(t)]?(p=l[a(t)].row).entity={}:(p=new s({},null,r),d.rowTemplateAssigner.call(r,p)),p.entity["$$"+e[n].col.uid]={groupVal:u},p.treeLevel=n,p.groupHeader=!0,p.internalRow=!0,p.enableCellEdit=!1,p.enableSelection=r.options.enableGroupHeaderSelection,e[n].initialised=!0,e[n].currentValue=t,e[n].currentRow=p,f.finaliseProcessingState(e,n+1),o.splice(i,0,p),l=r.grouping.groupingHeaderCache,c=0;c<n;c++)l=l[a(e[c].currentValue)].children;l[a(t)]={row:p,children:{}}},finaliseProcessingState:function(r,o){for(var i=o;i<r.length;i++)r[i].initialised=!1,r[i].currentRow=null,r[i].currentValue=null},getRowExpandedStates:function(r){if(void 0===r)return{};var i={};return angular.forEach(r,function(r,o){i[o]={state:r.row.treeNode.state},r.children?i[o].children=f.getRowExpandedStates(r.children):i[o].children={}}),i},applyRowExpandedStates:function(i,r){void 0!==r&&angular.forEach(r,function(r,o){i[o]&&(i[o].row.treeNode.state=r.state,r.children&&i[o].children&&f.applyRowExpandedStates(i[o].children,r.children))})}};return f}]),r.directive("uiGridGrouping",["uiGridGroupingConstants","uiGridGroupingService",function(r,n){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,compile:function(){return{pre:function(r,o,i,e){!1!==e.grid.options.enableGrouping&&n.initializeGrid(e.grid,r)},post:function(r,o,i,e){}}}}}])}(); | ||
!function(){"use strict";var r=angular.module("ui.grid.grouping",["ui.grid","ui.grid.treeBase"]);r.constant("uiGridGroupingConstants",{featureName:"grouping",rowHeaderColName:"treeBaseRowHeaderCol",EXPANDED:"expanded",COLLAPSED:"collapsed",aggregation:{COUNT:"count",SUM:"sum",MAX:"max",MIN:"min",AVG:"avg"}}),r.service("uiGridGroupingService",["$q","uiGridGroupingConstants","gridUtil","rowSorter","GridRow","gridClassFactory","i18nService","uiGridConstants","uiGridTreeBaseService",function(r,u,a,p,s,d,l,e,c){var f={initializeGrid:function(n,r){c.initializeGrid(n,r),n.grouping={},n.grouping.groupHeaderCache={},f.defaultGridOptions(n.options),n.registerRowsProcessor(f.groupRows,400),n.registerColumnBuilder(f.groupingColumnBuilder),n.registerColumnsProcessor(f.groupingColumnProcessor,400);var o={events:{grouping:{aggregationChanged:{},groupingChanged:{}}},methods:{grouping:{getGrouping:function(r){var o=f.getGrouping(n);return o.grouping.forEach(function(r){r.colName=r.col.name,delete r.col}),o.aggregations.forEach(function(r){r.colName=r.col.name,delete r.col}),o.aggregations=o.aggregations.filter(function(r){return!r.aggregation.source||"grouping"!==r.aggregation.source}),r&&(o.rowExpandedStates=f.getRowExpandedStates(n.grouping.groupingHeaderCache)),o},setGrouping:function(r){f.setGrouping(n,r)},groupColumn:function(r){var o=n.getColumn(r);f.groupColumn(n,o)},ungroupColumn:function(r){var o=n.getColumn(r);f.ungroupColumn(n,o)},clearGrouping:function(){f.clearGrouping(n)},aggregateColumn:function(r,o,i){var e=n.getColumn(r);f.aggregateColumn(n,e,o,i)}}}};n.api.registerEventsFromObject(o.events),n.api.registerMethodsFromObject(o.methods),n.api.core.on.sortChanged(r,f.tidyPriorities)},defaultGridOptions:function(r){r.enableGrouping=!1!==r.enableGrouping,r.groupingShowCounts=!1!==r.groupingShowCounts,r.groupingNullLabel=void 0===r.groupingNullLabel?"Null":r.groupingNullLabel,r.enableGroupHeaderSelection=!0===r.enableGroupHeaderSelection},groupingColumnBuilder:function(r,e,o){if(!1!==r.enableGrouping){void 0===e.grouping&&void 0!==r.grouping?(e.grouping=angular.copy(r.grouping),void 0!==e.grouping.groupPriority&&-1<e.grouping.groupPriority&&(e.treeAggregationFn=c.nativeAggregations()[u.aggregation.COUNT].aggregationFn,e.treeAggregationFinalizerFn=f.groupedFinalizerFn)):void 0===e.grouping&&(e.grouping={}),void 0!==e.grouping&&void 0!==e.grouping.groupPriority&&0<=e.grouping.groupPriority&&(e.suppressRemoveSort=!0);var i={name:"ui.grid.grouping.group",title:l.get().grouping.group,icon:"ui-grid-icon-indent-right",shown:function(){return void 0===this.context.col.grouping||void 0===this.context.col.grouping.groupPriority||this.context.col.grouping.groupPriority<0},action:function(){f.groupColumn(this.context.col.grid,this.context.col)}},n={name:"ui.grid.grouping.ungroup",title:l.get().grouping.ungroup,icon:"ui-grid-icon-indent-left",shown:function(){return void 0!==this.context.col.grouping&&void 0!==this.context.col.grouping.groupPriority&&0<=this.context.col.grouping.groupPriority},action:function(){f.ungroupColumn(this.context.col.grid,this.context.col)}},g={name:"ui.grid.grouping.aggregateRemove",title:l.get().grouping.aggregate_remove,shown:function(){return void 0!==this.context.col.treeAggregationFn},action:function(){f.aggregateColumn(this.context.col.grid,this.context.col,null)}},t=function(r,o){o=o||l.get().grouping["aggregate_"+r]||r;var i={name:"ui.grid.grouping.aggregate"+r,title:o,shown:function(){return void 0===this.context.col.treeAggregation||void 0===this.context.col.treeAggregation.type||this.context.col.treeAggregation.type!==r},action:function(){f.aggregateColumn(this.context.col.grid,this.context.col,r)}};a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.aggregate"+r)||e.menuItems.push(i)};!1!==e.colDef.groupingShowGroupingMenu&&(a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.group")||e.menuItems.push(i),a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.ungroup")||e.menuItems.push(n)),!1!==e.colDef.groupingShowAggregationMenu&&(angular.forEach(c.nativeAggregations(),function(r,o){t(o)}),angular.forEach(o.treeCustomAggregations,function(r,o){t(o,r.menuTitle)}),a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.aggregateRemove")||e.menuItems.push(g))}},groupingColumnProcessor:function(r,o){return r=f.moveGroupColumns(this,r,o)},groupedFinalizerFn:function(r){var o=this;void 0!==r.groupVal?(r.rendered=r.groupVal,o.grid.options.groupingShowCounts&&"date"!==o.colDef.type&&"object"!==o.colDef.type&&(r.rendered+=" ("+r.value+")")):r.rendered=null},moveGroupColumns:function(r,o){return!1===r.options.moveGroupColumns||(o.forEach(function(r,o){r.groupingPosition=o}),o.sort(function(r,o){var i,e;return i=r.isRowHeader?r.headerPriority:void 0===r.grouping||void 0===r.grouping.groupPriority||r.grouping.groupPriority<0?null:r.grouping.groupPriority,e=o.isRowHeader?o.headerPriority:void 0===o.grouping||void 0===o.grouping.groupPriority||o.grouping.groupPriority<0?null:o.grouping.groupPriority,null!==i&&null===e?-1:null!==e&&null===i?1:null!==i&&null!==e?i-e:r.groupingPosition-o.groupingPosition}),o.forEach(function(r){delete r.groupingPosition})),o},groupColumn:function(r,o){void 0===o.grouping&&(o.grouping={});var i=f.getGrouping(r);o.grouping.groupPriority=i.grouping.length,o.previousSort=angular.copy(o.sort),o.sort?void 0!==o.sort.direction&&null!==o.sort.direction||(o.sort.direction=e.ASC):o.sort={direction:e.ASC},o.treeAggregation={type:u.aggregation.COUNT,source:"grouping"},o.colDef&&angular.isFunction(o.colDef.customTreeAggregationFn)?o.treeAggregationFn=o.colDef.customTreeAggregationFn:o.treeAggregationFn=c.nativeAggregations()[u.aggregation.COUNT].aggregationFn,o.treeAggregationFinalizerFn=f.groupedFinalizerFn,r.api.grouping.raise.groupingChanged(o),r.api.core.raise.sortChanged(r,r.getColumnSorting()),r.queueGridRefresh()},ungroupColumn:function(r,o){void 0!==o.grouping&&(delete o.grouping.groupPriority,delete o.treeAggregation,delete o.customTreeAggregationFinalizer,o.previousSort&&(o.sort=o.previousSort,delete o.previousSort),f.tidyPriorities(r),r.api.grouping.raise.groupingChanged(o),r.api.core.raise.sortChanged(r,r.getColumnSorting()),r.queueGridRefresh())},aggregateColumn:function(r,o,i,e){void 0!==o.grouping&&void 0!==o.grouping.groupPriority&&0<=o.grouping.groupPriority&&f.ungroupColumn(r,o);var n={};void 0!==r.options.treeCustomAggregations[i]?n=r.options.treeCustomAggregations[i]:void 0!==c.nativeAggregations()[i]&&(n=c.nativeAggregations()[i]),o.treeAggregation={type:i,label:"string"==typeof e?e:l.get().aggregation[n.label]||n.label},o.treeAggregationFn=n.aggregationFn,o.treeAggregationFinalizerFn=n.finalizerFn,r.api.grouping.raise.aggregationChanged(o),r.queueGridRefresh()},setGrouping:function(i,r){void 0!==r&&(f.clearGrouping(i),r.grouping&&r.grouping.length&&0<r.grouping.length&&r.grouping.forEach(function(r){var o=i.getColumn(r.colName);o&&f.groupColumn(i,o)}),r.aggregations&&r.aggregations.length&&r.aggregations.forEach(function(r){var o=i.getColumn(r.colName);o&&f.aggregateColumn(i,o,r.aggregation.type)}),r.rowExpandedStates&&f.applyRowExpandedStates(i.grouping.groupingHeaderCache,r.rowExpandedStates))},clearGrouping:function(o){var r=f.getGrouping(o);0<r.grouping.length&&r.grouping.forEach(function(r){r.col||(r.col=o.getColumn(r.colName)),f.ungroupColumn(o,r.col)}),0<r.aggregations.length&&r.aggregations.forEach(function(r){r.col||(r.col=o.getColumn(r.colName)),f.aggregateColumn(o,r.col,null)})},tidyPriorities:function(r){void 0!==r&&void 0===r.grid||void 0===this.grid||(r=this.grid);var i=[],e=[];r.columns.forEach(function(r,o){void 0!==r.grouping&&void 0!==r.grouping.groupPriority&&0<=r.grouping.groupPriority?i.push(r):void 0!==r.sort&&void 0!==r.sort.priority&&0<=r.sort.priority&&e.push(r)}),i.sort(function(r,o){return r.grouping.groupPriority-o.grouping.groupPriority}),i.forEach(function(r,o){r.grouping.groupPriority=o,r.suppressRemoveSort=!0,void 0===r.sort&&(r.sort={}),r.sort.priority=o});var o=i.length;e.sort(function(r,o){return r.sort.priority-o.sort.priority}),e.forEach(function(r){r.sort.priority=o,r.suppressRemoveSort=r.colDef.suppressRemoveSort,o++})},groupRows:function(e){if(0===e.length)return e;var n=this;n.grouping.oldGroupingHeaderCache=n.grouping.groupingHeaderCache||{},n.grouping.groupingHeaderCache={};for(var g=f.initialiseProcessingState(n),r=function(r,o){var i=n.getCellValue(u,r.col);r.initialised&&0===p.getSortFn(r.col)(i,r.currentValue)||(f.insertGroupHeader(n,e,t,g,o),t++)},t=0;t<e.length;t++){var u=e[t];u.visible&&g.forEach(r)}return delete n.grouping.oldGroupingHeaderCache,e},initialiseProcessingState:function(r){var i=[];return f.getGrouping(r).grouping.forEach(function(r,o){i.push({fieldName:r.field,col:r.col,initialised:!1,currentValue:null,currentRow:null})}),i},getGrouping:function(r){var o=[],i=[];return r.columns.forEach(function(r){r.grouping&&void 0!==r.grouping.groupPriority&&0<=r.grouping.groupPriority&&o.push({field:r.field,col:r,groupPriority:r.grouping.groupPriority,grouping:r.grouping}),r.treeAggregation&&r.treeAggregation.type&&i.push({field:r.field,col:r,aggregation:r.treeAggregation})}),o.sort(function(r,o){return r.groupPriority-o.groupPriority}),o.forEach(function(r,o){r.grouping.groupPriority=o,r.groupPriority=o,delete r.grouping}),{grouping:o,aggregations:i}},insertGroupHeader:function(r,o,i,e,n){var g=e[n].col,t=r.getCellValue(o[i],g),u=t;function a(r){return angular.isObject(r)?JSON.stringify(r):r}null==t&&(u=r.options.groupingNullLabel);for(var p,l=r.grouping.oldGroupingHeaderCache,c=0;c<n;c++)l&&l[a(e[c].currentValue)]&&(l=l[a(e[c].currentValue)].children);for(l&&l[a(t)]?(p=l[a(t)].row).entity={}:(p=new s({},null,r),d.rowTemplateAssigner.call(r,p)),p.entity["$$"+e[n].col.uid]={groupVal:u},p.treeLevel=n,p.groupHeader=!0,p.internalRow=!0,p.enableCellEdit=!1,p.enableSelection=r.options.enableGroupHeaderSelection,e[n].initialised=!0,e[n].currentValue=t,e[n].currentRow=p,f.finaliseProcessingState(e,n+1),o.splice(i,0,p),l=r.grouping.groupingHeaderCache,c=0;c<n;c++)l=l[a(e[c].currentValue)].children;l[a(t)]={row:p,children:{}}},finaliseProcessingState:function(r,o){for(var i=o;i<r.length;i++)r[i].initialised=!1,r[i].currentRow=null,r[i].currentValue=null},getRowExpandedStates:function(r){if(void 0===r)return{};var i={};return angular.forEach(r,function(r,o){i[o]={state:r.row.treeNode.state},r.children?i[o].children=f.getRowExpandedStates(r.children):i[o].children={}}),i},applyRowExpandedStates:function(i,r){void 0!==r&&angular.forEach(r,function(r,o){i[o]&&(i[o].row.treeNode.state=r.state,r.children&&i[o].children&&f.applyRowExpandedStates(i[o].children,r.children))})}};return f}]),r.directive("uiGridGrouping",["uiGridGroupingConstants","uiGridGroupingService",function(r,n){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,compile:function(){return{pre:function(r,o,i,e){!1!==e.grid.options.enableGrouping&&n.initializeGrid(e.grid,r)},post:function(r,o,i,e){}}}}}])}(); |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -103,3 +103,3 @@ | ||
ungroup: 'Разгруппировать', | ||
aggregate_count: 'Группировать: Count', | ||
aggregate_count: 'Группировать: Количество', | ||
aggregate_sum: 'Для группы: Сумма', | ||
@@ -106,0 +106,0 @@ aggregate_max: 'Для группы: Максимум', |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
angular.module("ui.grid").config(["$provide",function(e){e.decorator("i18nService",["$delegate",function(e){return e.add("ru",{headerCell:{aria:{defaultFilterLabel:"Фильтр столбца",removeFilter:"Удалить фильтр",columnMenuButtonLabel:"Меню столбца"},priority:"Приоритет:",filterLabel:"Фильтр столбца: "},aggregate:{label:"элементы"},groupPanel:{description:"Для группировки по столбцу перетащите сюда его название."},search:{placeholder:"Поиск...",showingItems:"Показать элементы:",selectedItems:"Выбранные элементы:",totalItems:"Всего элементов:",size:"Размер страницы:",first:"Первая страница",next:"Следующая страница",previous:"Предыдущая страница",last:"Последняя страница"},menu:{text:"Выбрать столбцы:"},sort:{ascending:"По возрастанию",descending:"По убыванию",none:"Без сортировки",remove:"Убрать сортировку"},column:{hide:"Спрятать столбец"},aggregation:{count:"всего строк: ",sum:"итого: ",avg:"среднее: ",min:"мин: ",max:"макс: "},pinning:{pinLeft:"Закрепить слева",pinRight:"Закрепить справа",unpin:"Открепить"},columnMenu:{close:"Закрыть"},gridMenu:{aria:{buttonLabel:"Меню"},columns:"Столбцы:",importerTitle:"Импортировать файл",exporterAllAsCsv:"Экспортировать всё в CSV",exporterVisibleAsCsv:"Экспортировать видимые данные в CSV",exporterSelectedAsCsv:"Экспортировать выбранные данные в CSV",exporterAllAsPdf:"Экспортировать всё в PDF",exporterVisibleAsPdf:"Экспортировать видимые данные в PDF",exporterSelectedAsPdf:"Экспортировать выбранные данные в PDF",exporterAllAsExcel:"Экспортировать всё в Excel",exporterVisibleAsExcel:"Экспортировать видимые данные в Excel",exporterSelectedAsExcel:"Экспортировать выбранные данные в Excel",clearAllFilters:"Очистить все фильтры"},importer:{noHeaders:"Не удалось получить названия столбцов, есть ли в файле заголовок?",noObjects:"Не удалось получить данные, есть ли в файле строки кроме заголовка?",invalidCsv:"Не удалось обработать файл, это правильный CSV-файл?",invalidJson:"Не удалось обработать файл, это правильный JSON?",jsonNotArray:"Импортируемый JSON-файл должен содержать массив, операция отменена."},pagination:{aria:{pageToFirst:"Первая страница",pageBack:"Предыдущая страница",pageSelected:"Выбранная страница",pageForward:"Следующая страница",pageToLast:"Последняя страница"},sizes:"строк на страницу",totalItems:"строк",through:"по",of:"из"},grouping:{group:"Группировать",ungroup:"Разгруппировать",aggregate_count:"Группировать: Count",aggregate_sum:"Для группы: Сумма",aggregate_max:"Для группы: Максимум",aggregate_min:"Для группы: Минимум",aggregate_avg:"Для группы: Среднее",aggregate_remove:"Для группы: Пусто"}}),e}])}]); | ||
angular.module("ui.grid").config(["$provide",function(e){e.decorator("i18nService",["$delegate",function(e){return e.add("ru",{headerCell:{aria:{defaultFilterLabel:"Фильтр столбца",removeFilter:"Удалить фильтр",columnMenuButtonLabel:"Меню столбца"},priority:"Приоритет:",filterLabel:"Фильтр столбца: "},aggregate:{label:"элементы"},groupPanel:{description:"Для группировки по столбцу перетащите сюда его название."},search:{placeholder:"Поиск...",showingItems:"Показать элементы:",selectedItems:"Выбранные элементы:",totalItems:"Всего элементов:",size:"Размер страницы:",first:"Первая страница",next:"Следующая страница",previous:"Предыдущая страница",last:"Последняя страница"},menu:{text:"Выбрать столбцы:"},sort:{ascending:"По возрастанию",descending:"По убыванию",none:"Без сортировки",remove:"Убрать сортировку"},column:{hide:"Спрятать столбец"},aggregation:{count:"всего строк: ",sum:"итого: ",avg:"среднее: ",min:"мин: ",max:"макс: "},pinning:{pinLeft:"Закрепить слева",pinRight:"Закрепить справа",unpin:"Открепить"},columnMenu:{close:"Закрыть"},gridMenu:{aria:{buttonLabel:"Меню"},columns:"Столбцы:",importerTitle:"Импортировать файл",exporterAllAsCsv:"Экспортировать всё в CSV",exporterVisibleAsCsv:"Экспортировать видимые данные в CSV",exporterSelectedAsCsv:"Экспортировать выбранные данные в CSV",exporterAllAsPdf:"Экспортировать всё в PDF",exporterVisibleAsPdf:"Экспортировать видимые данные в PDF",exporterSelectedAsPdf:"Экспортировать выбранные данные в PDF",exporterAllAsExcel:"Экспортировать всё в Excel",exporterVisibleAsExcel:"Экспортировать видимые данные в Excel",exporterSelectedAsExcel:"Экспортировать выбранные данные в Excel",clearAllFilters:"Очистить все фильтры"},importer:{noHeaders:"Не удалось получить названия столбцов, есть ли в файле заголовок?",noObjects:"Не удалось получить данные, есть ли в файле строки кроме заголовка?",invalidCsv:"Не удалось обработать файл, это правильный CSV-файл?",invalidJson:"Не удалось обработать файл, это правильный JSON?",jsonNotArray:"Импортируемый JSON-файл должен содержать массив, операция отменена."},pagination:{aria:{pageToFirst:"Первая страница",pageBack:"Предыдущая страница",pageSelected:"Выбранная страница",pageForward:"Следующая страница",pageToLast:"Последняя страница"},sizes:"строк на страницу",totalItems:"строк",through:"по",of:"из"},grouping:{group:"Группировать",ungroup:"Разгруппировать",aggregate_count:"Группировать: Количество",aggregate_sum:"Для группы: Сумма",aggregate_max:"Для группы: Максимум",aggregate_min:"Для группы: Минимум",aggregate_avg:"Для группы: Среднее",aggregate_remove:"Для группы: Пусто"}}),e}])}]); |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -533,3 +533,3 @@ | ||
var width = gridUtil.elementWidth(e); | ||
var width = gridUtil.elementWidth(e) + 2; | ||
@@ -536,0 +536,0 @@ if (menuButton) { |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
!function(){"use strict";var e=angular.module("ui.grid.resizeColumns",["ui.grid"]);e.service("uiGridResizeColumnsService",["gridUtil","$q","$rootScope",function(r,o,t){return{defaultGridOptions:function(e){e.enableColumnResizing=!1!==e.enableColumnResizing,!1===e.enableColumnResize&&(e.enableColumnResizing=!1)},colResizerColumnBuilder:function(e,i,n){return e.enableColumnResizing=void 0===e.enableColumnResizing?n.enableColumnResizing:e.enableColumnResizing,!1===e.enableColumnResize&&(e.enableColumnResizing=!1),o.all([])},registerPublicApi:function(e){e.api.registerEventsFromObject({colResizable:{columnSizeChanged:function(e,i){}}})},fireColumnSizeChanged:function(e,i,n){t.$applyAsync(function(){e.api.colResizable?e.api.colResizable.raise.columnSizeChanged(i,n):r.logError("The resizeable api is not registered, this may indicate that you've included the module but not added the 'ui-grid-resize-columns' directive to your grid definition. Cannot raise any events.")})},findTargetCol:function(e,i,n){var r=e.getRenderContainer();if("left"!==i)return e;var o=r.visibleColumnCache.indexOf(e);return 0===o?r.visibleColumnCache[0]:r.visibleColumnCache[o-1*n]}}}]),e.directive("uiGridResizeColumns",["gridUtil","uiGridResizeColumnsService",function(e,o){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,compile:function(){return{pre:function(e,i,n,r){o.defaultGridOptions(r.grid.options),r.grid.registerColumnBuilder(o.colResizerColumnBuilder),o.registerPublicApi(r.grid)},post:function(e,i,n,r){}}}}}]),e.directive("uiGridHeaderCell",["gridUtil","$templateCache","$compile","$q","uiGridResizeColumnsService","uiGridConstants",function(e,t,d,i,c,g){return{priority:-10,require:"^uiGrid",compile:function(){return{post:function(l,u,e,i){var n=i.grid;if(n.options.enableColumnResizing){var a=t.get("ui-grid/columnResizer"),s=1;n.isRTL()&&(l.position="left",s=-1);var r=function(){for(var e=u[0].getElementsByClassName("ui-grid-column-resizer"),i=0;i<e.length;i++)angular.element(e[i]).remove();var n=c.findTargetCol(l.col,"left",s),r=l.col.getRenderContainer();if(n&&0!==r.visibleColumnCache.indexOf(l.col)&&!1!==n.colDef.enableColumnResizing){var o=angular.element(a).clone();o.attr("position","left"),u.prepend(o),d(o)(l)}if(!1!==l.col.colDef.enableColumnResizing){var t=angular.element(a).clone();t.attr("position","right"),u.append(t),d(t)(l)}};r();var o=n.registerDataChangeCallback(function(){l.$applyAsync(r)},[g.dataChange.COLUMN]);l.$on("$destroy",o)}}}}}}]),e.directive("uiGridColumnResizer",["$document","gridUtil","uiGridConstants","uiGridResizeColumnsService",function(v,h,p,z){var R=angular.element('<div class="ui-grid-resize-overlay"></div>');return{priority:0,scope:{col:"=",position:"@",renderIndex:"="},require:"?^uiGrid",link:function(u,a,e,s){var t=0,l=0,d=0,c=1;function g(e){s.grid.refreshCanvas(!0).then(function(){s.grid.queueGridRefresh()})}function f(e,i){var n=i;return e.minWidth&&n<e.minWidth?n=e.minWidth:e.maxWidth&&n>e.maxWidth&&(n=e.maxWidth),n}function n(e,i){e.originalEvent&&(e=e.originalEvent),e.preventDefault(),(l=(e.targetTouches?e.targetTouches[0]:e).clientX-d)<0?l=0:l>s.grid.gridWidth&&(l=s.grid.gridWidth);var n=z.findTargetCol(u.col,u.position,c);if(!1!==n.colDef.enableColumnResizing){s.grid.element.hasClass("column-resizing")||s.grid.element.addClass("column-resizing");var r=l-t,o=parseInt(n.drawnWidth+r*c,10);l+=(f(n,o)-o)*c,R.css({left:l+"px"}),s.fireEvent(p.events.ITEM_DRAGGING)}}function r(e){e.originalEvent&&(e=e.originalEvent),e.preventDefault(),s.grid.element.removeClass("column-resizing"),R.remove();var i=(l=(e.changedTouches?e.changedTouches[0]:e).clientX-d)-t;if(0===i)return C(),void m();var n=z.findTargetCol(u.col,u.position,c);if(!1!==n.colDef.enableColumnResizing){var r=parseInt(n.drawnWidth+i*c,10);n.width=f(n,r),n.hasCustomWidth=!0,g(),z.fireColumnSizeChanged(s.grid,n.colDef,i),C(),m()}}s.grid.isRTL()&&(u.position="left",c=-1),"left"===u.position?a.addClass("left"):"right"===u.position&&a.addClass("right");var o=function(e,i){e.originalEvent&&(e=e.originalEvent),e.stopPropagation(),d=s.grid.element[0].getBoundingClientRect().left,t=(e.targetTouches?e.targetTouches[0]:e).clientX-d,s.grid.element.append(R),R.css({left:t}),"touchstart"===e.type?(v.on("touchend",r),v.on("touchmove",n),a.off("mousedown",o)):(v.on("mouseup",r),v.on("mousemove",n),a.off("touchstart",o))},m=function(){a.on("mousedown",o),a.on("touchstart",o)},C=function(){v.off("mouseup",r),v.off("touchend",r),v.off("mousemove",n),v.off("touchmove",n),a.off("mousedown",o),a.off("touchstart",o)};m();var i=function(e,i){e.stopPropagation();var n=z.findTargetCol(u.col,u.position,c);if(!1!==n.colDef.enableColumnResizing){var o=0,r=h.closestElm(a,".ui-grid-render-container").querySelectorAll("."+p.COL_CLASS_PREFIX+n.uid+" .ui-grid-cell-contents");Array.prototype.forEach.call(r,function(e){var r;angular.element(e).parent().hasClass("ui-grid-header-cell")&&(r=angular.element(e).parent()[0].querySelectorAll(".ui-grid-column-menu-button")),h.fakeElement(e,{},function(e){var i=angular.element(e);i.attr("style","float: left");var n=h.elementWidth(i);r&&(n+=h.elementWidth(r));o<n&&(o=n)})});var t=f(n,o),l=t-n.drawnWidth;n.width=t,n.hasCustomWidth=!0,g(),z.fireColumnSizeChanged(s.grid,n.colDef,l)}};a.on("dblclick",i),a.on("$destroy",function(){a.off("dblclick",i),C()})}}}])}(),angular.module("ui.grid.resizeColumns").run(["$templateCache",function(e){"use strict";e.put("ui-grid/columnResizer",'<div ui-grid-column-resizer ng-if="grid.options.enableColumnResizing" class="ui-grid-column-resizer" col="col" position="right" render-index="renderIndex" unselectable="on"></div>')}]); | ||
!function(){"use strict";var e=angular.module("ui.grid.resizeColumns",["ui.grid"]);e.service("uiGridResizeColumnsService",["gridUtil","$q","$rootScope",function(r,o,t){return{defaultGridOptions:function(e){e.enableColumnResizing=!1!==e.enableColumnResizing,!1===e.enableColumnResize&&(e.enableColumnResizing=!1)},colResizerColumnBuilder:function(e,i,n){return e.enableColumnResizing=void 0===e.enableColumnResizing?n.enableColumnResizing:e.enableColumnResizing,!1===e.enableColumnResize&&(e.enableColumnResizing=!1),o.all([])},registerPublicApi:function(e){e.api.registerEventsFromObject({colResizable:{columnSizeChanged:function(e,i){}}})},fireColumnSizeChanged:function(e,i,n){t.$applyAsync(function(){e.api.colResizable?e.api.colResizable.raise.columnSizeChanged(i,n):r.logError("The resizeable api is not registered, this may indicate that you've included the module but not added the 'ui-grid-resize-columns' directive to your grid definition. Cannot raise any events.")})},findTargetCol:function(e,i,n){var r=e.getRenderContainer();if("left"!==i)return e;var o=r.visibleColumnCache.indexOf(e);return 0===o?r.visibleColumnCache[0]:r.visibleColumnCache[o-1*n]}}}]),e.directive("uiGridResizeColumns",["gridUtil","uiGridResizeColumnsService",function(e,o){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,compile:function(){return{pre:function(e,i,n,r){o.defaultGridOptions(r.grid.options),r.grid.registerColumnBuilder(o.colResizerColumnBuilder),o.registerPublicApi(r.grid)},post:function(e,i,n,r){}}}}}]),e.directive("uiGridHeaderCell",["gridUtil","$templateCache","$compile","$q","uiGridResizeColumnsService","uiGridConstants",function(e,t,d,i,c,g){return{priority:-10,require:"^uiGrid",compile:function(){return{post:function(l,u,e,i){var n=i.grid;if(n.options.enableColumnResizing){var a=t.get("ui-grid/columnResizer"),s=1;n.isRTL()&&(l.position="left",s=-1);var r=function(){for(var e=u[0].getElementsByClassName("ui-grid-column-resizer"),i=0;i<e.length;i++)angular.element(e[i]).remove();var n=c.findTargetCol(l.col,"left",s),r=l.col.getRenderContainer();if(n&&0!==r.visibleColumnCache.indexOf(l.col)&&!1!==n.colDef.enableColumnResizing){var o=angular.element(a).clone();o.attr("position","left"),u.prepend(o),d(o)(l)}if(!1!==l.col.colDef.enableColumnResizing){var t=angular.element(a).clone();t.attr("position","right"),u.append(t),d(t)(l)}};r();var o=n.registerDataChangeCallback(function(){l.$applyAsync(r)},[g.dataChange.COLUMN]);l.$on("$destroy",o)}}}}}}]),e.directive("uiGridColumnResizer",["$document","gridUtil","uiGridConstants","uiGridResizeColumnsService",function(v,h,p,z){var R=angular.element('<div class="ui-grid-resize-overlay"></div>');return{priority:0,scope:{col:"=",position:"@",renderIndex:"="},require:"?^uiGrid",link:function(u,a,e,s){var t=0,l=0,d=0,c=1;function g(e){s.grid.refreshCanvas(!0).then(function(){s.grid.queueGridRefresh()})}function f(e,i){var n=i;return e.minWidth&&n<e.minWidth?n=e.minWidth:e.maxWidth&&n>e.maxWidth&&(n=e.maxWidth),n}function n(e,i){e.originalEvent&&(e=e.originalEvent),e.preventDefault(),(l=(e.targetTouches?e.targetTouches[0]:e).clientX-d)<0?l=0:l>s.grid.gridWidth&&(l=s.grid.gridWidth);var n=z.findTargetCol(u.col,u.position,c);if(!1!==n.colDef.enableColumnResizing){s.grid.element.hasClass("column-resizing")||s.grid.element.addClass("column-resizing");var r=l-t,o=parseInt(n.drawnWidth+r*c,10);l+=(f(n,o)-o)*c,R.css({left:l+"px"}),s.fireEvent(p.events.ITEM_DRAGGING)}}function r(e){e.originalEvent&&(e=e.originalEvent),e.preventDefault(),s.grid.element.removeClass("column-resizing"),R.remove();var i=(l=(e.changedTouches?e.changedTouches[0]:e).clientX-d)-t;if(0===i)return C(),void m();var n=z.findTargetCol(u.col,u.position,c);if(!1!==n.colDef.enableColumnResizing){var r=parseInt(n.drawnWidth+i*c,10);n.width=f(n,r),n.hasCustomWidth=!0,g(),z.fireColumnSizeChanged(s.grid,n.colDef,i),C(),m()}}s.grid.isRTL()&&(u.position="left",c=-1),"left"===u.position?a.addClass("left"):"right"===u.position&&a.addClass("right");var o=function(e,i){e.originalEvent&&(e=e.originalEvent),e.stopPropagation(),d=s.grid.element[0].getBoundingClientRect().left,t=(e.targetTouches?e.targetTouches[0]:e).clientX-d,s.grid.element.append(R),R.css({left:t}),"touchstart"===e.type?(v.on("touchend",r),v.on("touchmove",n),a.off("mousedown",o)):(v.on("mouseup",r),v.on("mousemove",n),a.off("touchstart",o))},m=function(){a.on("mousedown",o),a.on("touchstart",o)},C=function(){v.off("mouseup",r),v.off("touchend",r),v.off("mousemove",n),v.off("touchmove",n),a.off("mousedown",o),a.off("touchstart",o)};m();var i=function(e,i){e.stopPropagation();var n=z.findTargetCol(u.col,u.position,c);if(!1!==n.colDef.enableColumnResizing){var o=0,r=h.closestElm(a,".ui-grid-render-container").querySelectorAll("."+p.COL_CLASS_PREFIX+n.uid+" .ui-grid-cell-contents");Array.prototype.forEach.call(r,function(e){var r;angular.element(e).parent().hasClass("ui-grid-header-cell")&&(r=angular.element(e).parent()[0].querySelectorAll(".ui-grid-column-menu-button")),h.fakeElement(e,{},function(e){var i=angular.element(e);i.attr("style","float: left");var n=h.elementWidth(i)+2;r&&(n+=h.elementWidth(r));o<n&&(o=n)})});var t=f(n,o),l=t-n.drawnWidth;n.width=t,n.hasCustomWidth=!0,g(),z.fireColumnSizeChanged(s.grid,n.colDef,l)}};a.on("dblclick",i),a.on("$destroy",function(){a.off("dblclick",i),C()})}}}])}(),angular.module("ui.grid.resizeColumns").run(["$templateCache",function(e){"use strict";e.put("ui-grid/columnResizer",'<div ui-grid-column-resizer ng-if="grid.options.enableColumnResizing" class="ui-grid-column-resizer" col="col" position="right" render-index="renderIndex" unselectable="on"></div>')}]); |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -209,4 +209,4 @@ | ||
var row = grid.getRow(rowEntity); | ||
if (row !== null) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect); | ||
if (row != void 0 && row !== null) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect, true); | ||
} | ||
@@ -224,4 +224,4 @@ }, | ||
var row = grid.getRow(rowEntity); | ||
if (row !== null && !row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect); | ||
if (row != void 0 && row !== null && !row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect, true); | ||
} | ||
@@ -242,4 +242,4 @@ }, | ||
var row = grid.renderContainers.body.visibleRowCache[rowNum]; | ||
if (row !== null && typeof (row) !== 'undefined' && !row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect); | ||
if (row != void 0 && row !== null && typeof (row) !== 'undefined' && !row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect, false); | ||
} | ||
@@ -249,2 +249,19 @@ }, | ||
* @ngdoc function | ||
* @name selectRowByKey | ||
* @methodOf ui.grid.selection.api:PublicApi | ||
* @description Select the data row | ||
* @param {boolean} isInEntity if true then key is in entity else it's directly in row | ||
* @param {Symbol} key the key to look for | ||
* @param {any} comparator the value that key should have | ||
* @param {Event} evt object if raised from an event | ||
* @param {array} lookInRows [optional] the rows to look in - if not provided then looks in grid.rows | ||
*/ | ||
selectRowByKey: function (isInEntity, key, comparator, evt, lookInRows) { | ||
var row = grid.findRowByKey(isInEntity, key, comparator, lookInRows); | ||
if (row != void 0 && row !== null && typeof (row) !== 'undefined' && !row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect, false); | ||
} | ||
}, | ||
/** | ||
* @ngdoc function | ||
* @name unSelectRow | ||
@@ -258,4 +275,4 @@ * @methodOf ui.grid.selection.api:PublicApi | ||
var row = grid.getRow(rowEntity); | ||
if (row !== null && row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect); | ||
if (row != void 0 && row !== null && row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect, true); | ||
} | ||
@@ -276,4 +293,4 @@ }, | ||
var row = grid.renderContainers.body.visibleRowCache[rowNum]; | ||
if (row !== null && typeof (row) !== 'undefined' && row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect); | ||
if (row != void 0 && row !== null && typeof (row) !== 'undefined' && row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect, false); | ||
} | ||
@@ -283,2 +300,19 @@ }, | ||
* @ngdoc function | ||
* @name unSelectRowByKey | ||
* @methodOf ui.grid.selection.api:PublicApi | ||
* @description Select the data row | ||
* @param {boolean} isInEntity if true then key is in entity else it's directly in row | ||
* @param {(string|number)} key the key to look for | ||
* @param {any} comparator the value that key should have | ||
* @param {Event} evt object if raised from an event | ||
* @param {array} lookInRows [optional] the rows to look in - if not provided then looks in grid.rows | ||
*/ | ||
unSelectRowByKey: function (isInEntity, key, comparator, evt, lookInRows) { | ||
var row = grid.findRowByKey(isInEntity, key, comparator, lookInRows); | ||
if (row != void 0 && row !== null && typeof (row) !== 'undefined' && row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect, false); | ||
} | ||
}, | ||
/** | ||
* @ngdoc function | ||
* @name selectAllRows | ||
@@ -341,13 +375,18 @@ * @methodOf ui.grid.selection.api:PublicApi | ||
* @methodOf ui.grid.selection.api:PublicApi | ||
* @description returns all selectedRow's entity references | ||
* @description returns all selected Row's entity references | ||
*/ | ||
getSelectedRows: function () { | ||
return service.getSelectedRows(grid).map(function (gridRow) { | ||
return gridRow.entity; | ||
}).filter(function (entity) { | ||
return entity.hasOwnProperty('$$hashKey') || !angular.isObject(entity); | ||
}); | ||
return service.mapAndFilterRowsByEntity(service.getSelectedRows(grid)); | ||
}, | ||
/** | ||
* @ngdoc function | ||
* @name getUnSelectedRows | ||
* @methodOf ui.grid.selection.api:PublicApi | ||
* @description returns all unselected Row's entity references | ||
*/ | ||
getUnSelectedRows: function () { | ||
return service.mapAndFilterRowsByEntity(service.getUnSelectedRows(grid)); | ||
}, | ||
/** | ||
* @ngdoc function | ||
* @name getSelectedGridRows | ||
@@ -362,2 +401,11 @@ * @methodOf ui.grid.selection.api:PublicApi | ||
* @ngdoc function | ||
* @name getSelectedGridRows | ||
* @methodOf ui.grid.selection.api:PublicApi | ||
* @description returns all unselected Row's as gridRows | ||
*/ | ||
getUnSelectedGridRows: function () { | ||
return service.getUnSelectedRows(grid); | ||
}, | ||
/** | ||
* @ngdoc function | ||
* @name getSelectedCount | ||
@@ -548,4 +596,5 @@ * @methodOf ui.grid.selection.api:PublicApi | ||
* @param {bool} noUnselect if true then rows cannot be unselected | ||
* @param {bool} [canBeInvisible=true] if false, row can only be selected when it's (theoretically) visible | ||
*/ | ||
toggleRowSelection: function (grid, row, evt, multiSelect, noUnselect) { | ||
toggleRowSelection: function (grid, row, evt, multiSelect, noUnselect, canBeInvisible) { | ||
if ( row.enableSelection === false ) { | ||
@@ -555,5 +604,8 @@ return; | ||
var selected = row.isSelected, | ||
selectedRows; | ||
if (canBeInvisible === void 0) { | ||
canBeInvisible = true; | ||
} | ||
var selected = row.isSelected; | ||
if (!multiSelect) { | ||
@@ -563,8 +615,5 @@ if (!selected) { | ||
} | ||
else { | ||
selectedRows = service.getSelectedRows(grid); | ||
if (selectedRows.length > 1) { | ||
selected = false; // Enable reselect of the row | ||
service.clearSelectedRows(grid, evt); | ||
} | ||
else if (service.getSelectedRows(grid).length > 1) { | ||
selected = false; // Enable reselect of the row | ||
service.clearSelectedRows(grid, evt); | ||
} | ||
@@ -574,3 +623,3 @@ } | ||
// only select row in this case | ||
if (!(selected && noUnselect)) { | ||
if (!(selected && noUnselect) && (canBeInvisible || row.visible)) { | ||
row.setSelected(!selected); | ||
@@ -581,5 +630,3 @@ if (row.isSelected === true) { | ||
selectedRows = service.getSelectedRows(grid); | ||
grid.selection.selectAll = grid.rows.length === selectedRows.length; | ||
grid.selection.selectAll = grid.rows.length === service.getSelectedRows(grid).length; | ||
grid.api.selection.raise.rowSelectionChanged(row, evt); | ||
@@ -637,3 +684,37 @@ } | ||
}, | ||
/** | ||
* @ngdoc function | ||
* @name getUnSelectedRows | ||
* @methodOf ui.grid.selection.service:uiGridSelectionService | ||
* @description Returns all the unselected rows | ||
* @param {Grid} grid grid object | ||
*/ | ||
getUnSelectedRows: function (grid) { | ||
return grid.rows.filter(function (row) { | ||
return !row.isSelected; | ||
}); | ||
}, | ||
/** | ||
* @ngdoc function | ||
* @name mapAndFilterRowsByEntity | ||
* @methodOf ui.grid.selection.service:uiGridSelectionService | ||
* @description Filters all rows by entity and then maps them to Array. | ||
*/ | ||
mapAndFilterRowsByEntity: function(gridRows) { | ||
if (typeof gridRows.reduce === 'function') { // If reduce is available it will be taken, due to better performance | ||
return gridRows.reduce(function (previousVal, currentRow) { | ||
if (currentRow.entity.hasOwnProperty('$$hashKey') || !angular.isObject(currentRow.entity)) { | ||
previousVal.push(currentRow.entity); | ||
} | ||
return previousVal; | ||
}, []); | ||
} | ||
return gridRows.filter(function (gridRow) { // stays as polyfill | ||
return gridRow.entity.hasOwnProperty('$$hashKey') || !angular.isObject(gridRow.entity); | ||
}).map(function (gridRow) { | ||
return gridRow.entity; | ||
}); | ||
}, | ||
/** | ||
@@ -650,3 +731,3 @@ * @ngdoc function | ||
service.getSelectedRows(grid).forEach(function (row) { | ||
if (row.isSelected && row.enableSelection !== false && grid.options.isRowSelectable(row) !== false) { | ||
if (row.isSelected && row.enableSelection !== false) { | ||
row.setSelected(false); | ||
@@ -826,8 +907,8 @@ service.decideRaiseSelectionEvent(grid, row, changedRows, evt); | ||
uiGridSelectionService.toggleRowSelection(self, row, evt, | ||
self.options.multiSelect, self.options.noUnselect); | ||
self.options.multiSelect, self.options.noUnselect, false); | ||
} | ||
else if (row.groupHeader) { | ||
uiGridSelectionService.toggleRowSelection(self, row, evt, self.options.multiSelect, self.options.noUnselect); | ||
uiGridSelectionService.toggleRowSelection(self, row, evt, self.options.multiSelect, self.options.noUnselect, false); | ||
for (var i = 0; i < row.treeNode.children.length; i++) { | ||
uiGridSelectionService.toggleRowSelection(self, row.treeNode.children[i].row, evt, self.options.multiSelect, self.options.noUnselect); | ||
uiGridSelectionService.toggleRowSelection(self, row.treeNode.children[i].row, evt, self.options.multiSelect, self.options.noUnselect, false); | ||
} | ||
@@ -837,3 +918,3 @@ } | ||
uiGridSelectionService.toggleRowSelection(self, row, evt, | ||
(self.options.multiSelect && !self.options.modifierKeysToMultiSelect), self.options.noUnselect); | ||
(self.options.multiSelect && !self.options.modifierKeysToMultiSelect), self.options.noUnselect, false); | ||
} | ||
@@ -959,3 +1040,3 @@ self.options.enableFocusRowOnRowHeaderClick && row.setFocused(!row.isFocused) && self.api.selection.raise.rowFocusChanged(row, evt); | ||
($scope.grid.options.multiSelect && !$scope.grid.options.modifierKeysToMultiSelect), | ||
$scope.grid.options.noUnselect); | ||
$scope.grid.options.noUnselect, false); | ||
$scope.$apply(); | ||
@@ -980,3 +1061,3 @@ } | ||
uiGridSelectionService.toggleRowSelection($scope.grid, $scope.row, evt, | ||
$scope.grid.options.multiSelect, $scope.grid.options.noUnselect); | ||
$scope.grid.options.multiSelect, $scope.grid.options.noUnselect, false); | ||
} | ||
@@ -986,3 +1067,3 @@ else if ($scope.grid.options.enableSelectRowOnFocus) { | ||
($scope.grid.options.multiSelect && !$scope.grid.options.modifierKeysToMultiSelect), | ||
$scope.grid.options.noUnselect); | ||
$scope.grid.options.noUnselect, false); | ||
} | ||
@@ -989,0 +1070,0 @@ $scope.row.setFocused(!$scope.row.isFocused); |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
!function(){"use strict";var e=angular.module("ui.grid.selection",["ui.grid"]);e.constant("uiGridSelectionConstants",{featureName:"selection",selectionRowHeaderColName:"selectionRowHeaderCol"}),angular.module("ui.grid").config(["$provide",function(e){e.decorator("GridRow",["$delegate",function(e){return e.prototype.setSelected=function(e){e!==this.isSelected&&(this.isSelected=e,this.grid.selection.selectedCount+=e?1:-1)},e.prototype.setFocused=function(e){e!==this.isFocused&&(this.grid.selection.focusedRow&&(this.grid.selection.focusedRow.isFocused=!1),this.grid.selection.focusedRow=e?this:null,this.isFocused=e)},e}])}]),e.service("uiGridSelectionService",function(){var a={initializeGrid:function(o){o.selection={lastSelectedRow:null,focusedRow:null,selectAll:!1},o.selection.selectedCount=0,a.defaultGridOptions(o.options);var e={events:{selection:{rowFocusChanged:function(e,t,i){},rowSelectionChanged:function(e,t,i){},rowSelectionChangedBatch:function(e,t,i){}}},methods:{selection:{toggleRowSelection:function(e,t){var i=o.getRow(e);null!==i&&a.toggleRowSelection(o,i,t,o.options.multiSelect,o.options.noUnselect)},selectRow:function(e,t){var i=o.getRow(e);null===i||i.isSelected||a.toggleRowSelection(o,i,t,o.options.multiSelect,o.options.noUnselect)},selectRowByVisibleIndex:function(e,t){var i=o.renderContainers.body.visibleRowCache[e];null==i||i.isSelected||a.toggleRowSelection(o,i,t,o.options.multiSelect,o.options.noUnselect)},unSelectRow:function(e,t){var i=o.getRow(e);null!==i&&i.isSelected&&a.toggleRowSelection(o,i,t,o.options.multiSelect,o.options.noUnselect)},unSelectRowByVisibleIndex:function(e,t){var i=o.renderContainers.body.visibleRowCache[e];null!=i&&i.isSelected&&a.toggleRowSelection(o,i,t,o.options.multiSelect,o.options.noUnselect)},selectAllRows:function(t){if(!1!==o.options.multiSelect){var i=[];o.rows.forEach(function(e){e.isSelected||!1===e.enableSelection||!1===o.options.isRowSelectable(e)||(e.setSelected(!0),a.decideRaiseSelectionEvent(o,e,i,t))}),o.selection.selectAll=!0,a.decideRaiseSelectionBatchEvent(o,i,t)}},selectAllVisibleRows:function(t){if(!1!==o.options.multiSelect){var i=[];o.rows.forEach(function(e){e.visible?e.isSelected||!1===e.enableSelection||!1===o.options.isRowSelectable(e)||(e.setSelected(!0),a.decideRaiseSelectionEvent(o,e,i,t)):e.isSelected&&(e.setSelected(!1),a.decideRaiseSelectionEvent(o,e,i,t))}),o.selection.selectAll=!0,a.decideRaiseSelectionBatchEvent(o,i,t)}},clearSelectedRows:function(e){a.clearSelectedRows(o,e)},getSelectedRows:function(){return a.getSelectedRows(o).map(function(e){return e.entity}).filter(function(e){return e.hasOwnProperty("$$hashKey")||!angular.isObject(e)})},getSelectedGridRows:function(){return a.getSelectedRows(o)},getSelectedCount:function(){return o.selection.selectedCount},setMultiSelect:function(e){o.options.multiSelect=e},setModifierKeysToMultiSelect:function(e){o.options.modifierKeysToMultiSelect=e},getSelectAllState:function(){return o.selection.selectAll}}}};o.api.registerEventsFromObject(e.events),o.api.registerMethodsFromObject(e.methods)},defaultGridOptions:function(e){e.enableRowSelection=!1!==e.enableRowSelection,e.multiSelect=!1!==e.multiSelect,e.noUnselect=!0===e.noUnselect,e.modifierKeysToMultiSelect=!0===e.modifierKeysToMultiSelect,e.enableRowHeaderSelection=!1!==e.enableRowHeaderSelection,void 0===e.enableFullRowSelection&&(e.enableFullRowSelection=!e.enableRowHeaderSelection),e.enableFocusRowOnRowHeaderClick=!1!==e.enableFocusRowOnRowHeaderClick||!e.enableRowHeaderSelection,e.enableSelectRowOnFocus=!1!==e.enableSelectRowOnFocus,e.enableSelectAll=!1!==e.enableSelectAll,e.enableSelectionBatchEvent=!1!==e.enableSelectionBatchEvent,e.selectionRowHeaderWidth=angular.isDefined(e.selectionRowHeaderWidth)?e.selectionRowHeaderWidth:30,e.enableFooterTotalSelected=!1!==e.enableFooterTotalSelected,e.isRowSelectable=angular.isDefined(e.isRowSelectable)?e.isRowSelectable:angular.noop},toggleRowSelection:function(e,t,i,o,n){if(!1!==t.enableSelection){var l,c=t.isSelected;o||(c?1<(l=a.getSelectedRows(e)).length&&(c=!1,a.clearSelectedRows(e,i)):a.clearSelectedRows(e,i)),c&&n||(t.setSelected(!c),!0===t.isSelected&&(e.selection.lastSelectedRow=t),l=a.getSelectedRows(e),e.selection.selectAll=e.rows.length===l.length,e.api.selection.raise.rowSelectionChanged(t,i))}},shiftSelect:function(e,t,i,o){if(o){var n=0<a.getSelectedRows(e).length?e.renderContainers.body.visibleRowCache.indexOf(e.selection.lastSelectedRow):0,l=e.renderContainers.body.visibleRowCache.indexOf(t);if(l<n){var c=n;n=l,l=c}for(var s=[],r=n;r<=l;r++){var d=e.renderContainers.body.visibleRowCache[r];d&&(d.isSelected||!1===d.enableSelection||(d.setSelected(!0),e.selection.lastSelectedRow=d,a.decideRaiseSelectionEvent(e,d,s,i)))}a.decideRaiseSelectionBatchEvent(e,s,i)}},getSelectedRows:function(e){return e.rows.filter(function(e){return e.isSelected})},clearSelectedRows:function(t,i){var o=[];a.getSelectedRows(t).forEach(function(e){e.isSelected&&!1!==e.enableSelection&&!1!==t.options.isRowSelectable(e)&&(e.setSelected(!1),a.decideRaiseSelectionEvent(t,e,o,i))}),t.selection.selectAll=!1,t.selection.selectedCount=0,a.decideRaiseSelectionBatchEvent(t,o,i)},decideRaiseSelectionEvent:function(e,t,i,o){e.options.enableSelectionBatchEvent?i.push(t):e.api.selection.raise.rowSelectionChanged(t,o)},decideRaiseSelectionBatchEvent:function(e,t,i){0<t.length&&e.api.selection.raise.rowSelectionChangedBatch(t,i)}};return a}),e.directive("uiGridSelection",["i18nService","uiGridSelectionConstants","uiGridSelectionService","uiGridConstants",function(d,a,u,g){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,compile:function(){return{pre:function(e,t,i,o){if(u.initializeGrid(o.grid),o.grid.options.enableRowHeaderSelection){var n={name:a.selectionRowHeaderColName,displayName:d.getSafeText("selection.displayName"),width:o.grid.options.selectionRowHeaderWidth,minWidth:10,cellTemplate:"ui-grid/selectionRowHeader",headerCellTemplate:"ui-grid/selectionHeaderCell",enableColumnResizing:!1,enableColumnMenu:!1,exporterSuppressExport:!0,allowCellFocus:!0};o.grid.addRowHeaderColumn(n,0)}var l=!1,c=function(e){return e.forEach(function(e){e.enableSelection=o.grid.options.isRowSelectable(e)}),e},s=function(){o.grid.options.isRowSelectable!==angular.noop&&!0!==l&&(o.grid.registerRowsProcessor(c,500),l=!0)};s();var r=o.grid.registerDataChangeCallback(s,[g.dataChange.OPTIONS]);e.$on("$destroy",r)},post:function(e,t,i,o){}}}}}]),e.directive("uiGridSelectionRowHeaderButtons",["$templateCache","uiGridSelectionService","gridUtil",function(e,c,s){return{replace:!0,restrict:"E",template:e.get("ui-grid/selectionRowHeaderButtons"),scope:!0,require:"^uiGrid",link:function(e,t,i,o){var n=o.grid;function l(e,t){if(t.stopPropagation(),t.shiftKey)c.shiftSelect(n,e,t,n.options.multiSelect);else if(t.ctrlKey||t.metaKey)c.toggleRowSelection(n,e,t,n.options.multiSelect,n.options.noUnselect);else if(e.groupHeader){c.toggleRowSelection(n,e,t,n.options.multiSelect,n.options.noUnselect);for(var i=0;i<e.treeNode.children.length;i++)c.toggleRowSelection(n,e.treeNode.children[i].row,t,n.options.multiSelect,n.options.noUnselect)}else c.toggleRowSelection(n,e,t,n.options.multiSelect&&!n.options.modifierKeysToMultiSelect,n.options.noUnselect);n.options.enableFocusRowOnRowHeaderClick&&e.setFocused(!e.isFocused)&&n.api.selection.raise.rowFocusChanged(e,t)}e.selectButtonClick=l,e.selectButtonKeyDown=function(e,t){32!==t.keyCode&&13!==t.keyCode||(t.preventDefault(),l(e,t))},"ie"===s.detectBrowser()&&t.on("mousedown",function(e){(e.ctrlKey||e.shiftKey)&&(e.target.onselectstart=function(){return!1},window.setTimeout(function(){e.target.onselectstart=null},0))}),e.$on("$destroy",function(){t.off()})}}}]),e.directive("uiGridSelectionSelectAllButtons",["$templateCache","uiGridSelectionService",function(e,o){return{replace:!0,restrict:"E",template:e.get("ui-grid/selectionSelectAllButtons"),scope:!1,link:function(t){var i=t.col.grid;t.headerButtonKeyDown=function(e){32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),t.headerButtonClick(e))},t.headerButtonClick=function(e){i.selection.selectAll?(o.clearSelectedRows(i,e),i.options.noUnselect&&i.api.selection.selectRowByVisibleIndex(0,e),i.selection.selectAll=!1):i.options.multiSelect&&(i.api.selection.selectAllVisibleRows(e),i.selection.selectAll=!0)}}}}]),e.directive("uiGridViewport",function(){return{priority:-200,scope:!1,compile:function(e){var t=angular.element(e[0].querySelector(".ui-grid-canvas:not(.ui-grid-empty-base-layer-container)").children[0]),i="'ui-grid-row-selected': row.isSelected, 'ui-grid-row-focused': row.isFocused}",o=t.attr("ng-class");return i=o?o.slice(0,-1)+","+i:"{"+i,t.attr("ng-class",i),{pre:function(e,t,i,o){},post:function(e,t,i,o){}}}}}),e.directive("uiGridCell",["uiGridConstants","uiGridSelectionService",function(u,g){return{priority:-200,restrict:"A",require:"?^uiGrid",scope:!1,link:function(i,c,e,t){var s=0,r={};t.grid.api.cellNav&&t.grid.api.cellNav.on.viewPortKeyDown(i,function(e,t){null!==t&&t.row===i.row&&t.col===i.col&&e.keyCode===u.keymap.SPACE&&"selectionRowHeaderCol"===i.col.colDef.name&&(e.preventDefault(),g.toggleRowSelection(i.grid,i.row,e,i.grid.options.multiSelect&&!i.grid.options.modifierKeysToMultiSelect,i.grid.options.noUnselect),i.$apply())});var d=function(e){"ui-grid-icon-minus-squared"!==e.target.className&&"ui-grid-icon-plus-squared"!==e.target.className&&(c.off("touchend",n),e.shiftKey?g.shiftSelect(i.grid,i.row,e,i.grid.options.multiSelect):e.ctrlKey||e.metaKey?g.toggleRowSelection(i.grid,i.row,e,i.grid.options.multiSelect,i.grid.options.noUnselect):i.grid.options.enableSelectRowOnFocus&&g.toggleRowSelection(i.grid,i.row,e,i.grid.options.multiSelect&&!i.grid.options.modifierKeysToMultiSelect,i.grid.options.noUnselect),i.row.setFocused(!i.row.isFocused),i.grid.api.selection.raise.rowFocusChanged(i.row,e),i.$apply(),window.setTimeout(function(){c.on("touchend",n)},300))},o=function(e){s=(new Date).getTime(),r=e.changedTouches[0],c.off("click",d)},n=function(e){var t=(new Date).getTime(),i=e.changedTouches[0],o=t-s,n=Math.abs(r.clientX-i.clientX),l=Math.abs(r.clientY-i.clientY);n<100&&l<100&&o<300&&d(e),window.setTimeout(function(){c.on("click",d)},300)};function l(){i.grid.options.enableRowSelection&&i.grid.options.enableFullRowSelection&&"selectionRowHeaderCol"!==i.col.colDef.name&&(c.addClass("ui-grid-disable-selection"),c.on("touchstart",o),c.on("touchend",n),c.on("click",d),i.registered=!0)}l();var a=i.grid.registerDataChangeCallback(function(){i.grid.options.enableRowSelection&&i.grid.options.enableFullRowSelection&&!i.registered?l():i.grid.options.enableRowSelection&&i.grid.options.enableFullRowSelection||!i.registered||i.registered&&(c.removeClass("ui-grid-disable-selection"),c.off("touchstart",o),c.off("touchend",n),c.off("click",d),i.registered=!1)},[u.dataChange.OPTIONS]);c.on("$destroy",a)}}}]),e.directive("uiGridGridFooter",["$compile","gridUtil",function(l,i){return{restrict:"EA",replace:!0,priority:-1e3,require:"^uiGrid",scope:!0,compile:function(){return{pre:function(o,n,e,t){t.grid.options.showGridFooter&&i.getTemplate("ui-grid/gridFooterSelectedItems").then(function(e){var t=angular.element(e),i=l(t)(o);angular.element(n[0].getElementsByClassName("ui-grid-grid-footer")[0]).append(i)})},post:function(e,t,i,o){}}}}}])}(),angular.module("ui.grid.selection").run(["$templateCache",function(e){"use strict";e.put("ui-grid/gridFooterSelectedItems",'<span ng-if="grid.selection.selectedCount !== 0 && grid.options.enableFooterTotalSelected">({{"search.selectedItems" | t}} {{grid.selection.selectedCount}})</span>'),e.put("ui-grid/selectionHeaderCell",'<div>\x3c!-- <div class="ui-grid-vertical-bar"> </div> --\x3e<div class="ui-grid-cell-contents" col-index="renderIndex"><ui-grid-selection-select-all-buttons ng-if="grid.options.enableSelectAll" role="checkbox" ng-model="grid.selection.selectAll"></ui-grid-selection-select-all-buttons></div></div>'),e.put("ui-grid/selectionRowHeader",'<div class="ui-grid-cell-contents ui-grid-disable-selection clickable"><ui-grid-selection-row-header-buttons></ui-grid-selection-row-header-buttons></div>'),e.put("ui-grid/selectionRowHeaderButtons",'<div class="ui-grid-selection-row-header-buttons ui-grid-icon-ok clickable" ng-class="{\'ui-grid-row-selected\': row.isSelected}" tabindex="0" ng-click="selectButtonClick(row, $event)" ng-keydown="selectButtonKeyDown(row, $event)" ng-attr-aria-label="{{(\'selection.aria.row\' | t) + \' \' + (row.index + 1) + \', \' + col.displayName}}" aria-checked="{{row.isSelected}}" role="checkbox" ng-model="row.isSelected"> </div>'),e.put("ui-grid/selectionSelectAllButtons",'<div role="checkbox" tabindex="0" class="ui-grid-selection-row-header-buttons ui-grid-icon-ok" ui-grid-one-bind-aria-label="\'selection.selectAll\' | t" aria-checked="{{grid.selection.selectAll}}" ng-class="{\'ui-grid-all-selected\': grid.selection.selectAll}" ng-click="headerButtonClick($event)" ng-keydown="headerButtonKeyDown($event)"></div>')}]); | ||
!function(){"use strict";var e=angular.module("ui.grid.selection",["ui.grid"]);e.constant("uiGridSelectionConstants",{featureName:"selection",selectionRowHeaderColName:"selectionRowHeaderCol"}),angular.module("ui.grid").config(["$provide",function(e){e.decorator("GridRow",["$delegate",function(e){return e.prototype.setSelected=function(e){e!==this.isSelected&&(this.isSelected=e,this.grid.selection.selectedCount+=e?1:-1)},e.prototype.setFocused=function(e){e!==this.isFocused&&(this.grid.selection.focusedRow&&(this.grid.selection.focusedRow.isFocused=!1),this.grid.selection.focusedRow=e?this:null,this.isFocused=e)},e}])}]),e.service("uiGridSelectionService",function(){var a={initializeGrid:function(c){c.selection={lastSelectedRow:null,focusedRow:null,selectAll:!1},c.selection.selectedCount=0,a.defaultGridOptions(c.options);var e={events:{selection:{rowFocusChanged:function(e,t,i){},rowSelectionChanged:function(e,t,i){},rowSelectionChangedBatch:function(e,t,i){}}},methods:{selection:{toggleRowSelection:function(e,t){var i=c.getRow(e);null!=i&&null!==i&&a.toggleRowSelection(c,i,t,c.options.multiSelect,c.options.noUnselect,!0)},selectRow:function(e,t){var i=c.getRow(e);null==i||null===i||i.isSelected||a.toggleRowSelection(c,i,t,c.options.multiSelect,c.options.noUnselect,!0)},selectRowByVisibleIndex:function(e,t){var i=c.renderContainers.body.visibleRowCache[e];null==i||null==i||i.isSelected||a.toggleRowSelection(c,i,t,c.options.multiSelect,c.options.noUnselect,!1)},selectRowByKey:function(e,t,i,o,n){var l=c.findRowByKey(e,t,i,n);null==l||null==l||l.isSelected||a.toggleRowSelection(c,l,o,c.options.multiSelect,c.options.noUnselect,!1)},unSelectRow:function(e,t){var i=c.getRow(e);null!=i&&null!==i&&i.isSelected&&a.toggleRowSelection(c,i,t,c.options.multiSelect,c.options.noUnselect,!0)},unSelectRowByVisibleIndex:function(e,t){var i=c.renderContainers.body.visibleRowCache[e];null!=i&&null!=i&&i.isSelected&&a.toggleRowSelection(c,i,t,c.options.multiSelect,c.options.noUnselect,!1)},unSelectRowByKey:function(e,t,i,o,n){var l=c.findRowByKey(e,t,i,n);null!=l&&null!=l&&l.isSelected&&a.toggleRowSelection(c,l,o,c.options.multiSelect,c.options.noUnselect,!1)},selectAllRows:function(t){if(!1!==c.options.multiSelect){var i=[];c.rows.forEach(function(e){e.isSelected||!1===e.enableSelection||!1===c.options.isRowSelectable(e)||(e.setSelected(!0),a.decideRaiseSelectionEvent(c,e,i,t))}),c.selection.selectAll=!0,a.decideRaiseSelectionBatchEvent(c,i,t)}},selectAllVisibleRows:function(t){if(!1!==c.options.multiSelect){var i=[];c.rows.forEach(function(e){e.visible?e.isSelected||!1===e.enableSelection||!1===c.options.isRowSelectable(e)||(e.setSelected(!0),a.decideRaiseSelectionEvent(c,e,i,t)):e.isSelected&&(e.setSelected(!1),a.decideRaiseSelectionEvent(c,e,i,t))}),c.selection.selectAll=!0,a.decideRaiseSelectionBatchEvent(c,i,t)}},clearSelectedRows:function(e){a.clearSelectedRows(c,e)},getSelectedRows:function(){return a.mapAndFilterRowsByEntity(a.getSelectedRows(c))},getUnSelectedRows:function(){return a.mapAndFilterRowsByEntity(a.getUnSelectedRows(c))},getSelectedGridRows:function(){return a.getSelectedRows(c)},getUnSelectedGridRows:function(){return a.getUnSelectedRows(c)},getSelectedCount:function(){return c.selection.selectedCount},setMultiSelect:function(e){c.options.multiSelect=e},setModifierKeysToMultiSelect:function(e){c.options.modifierKeysToMultiSelect=e},getSelectAllState:function(){return c.selection.selectAll}}}};c.api.registerEventsFromObject(e.events),c.api.registerMethodsFromObject(e.methods)},defaultGridOptions:function(e){e.enableRowSelection=!1!==e.enableRowSelection,e.multiSelect=!1!==e.multiSelect,e.noUnselect=!0===e.noUnselect,e.modifierKeysToMultiSelect=!0===e.modifierKeysToMultiSelect,e.enableRowHeaderSelection=!1!==e.enableRowHeaderSelection,void 0===e.enableFullRowSelection&&(e.enableFullRowSelection=!e.enableRowHeaderSelection),e.enableFocusRowOnRowHeaderClick=!1!==e.enableFocusRowOnRowHeaderClick||!e.enableRowHeaderSelection,e.enableSelectRowOnFocus=!1!==e.enableSelectRowOnFocus,e.enableSelectAll=!1!==e.enableSelectAll,e.enableSelectionBatchEvent=!1!==e.enableSelectionBatchEvent,e.selectionRowHeaderWidth=angular.isDefined(e.selectionRowHeaderWidth)?e.selectionRowHeaderWidth:30,e.enableFooterTotalSelected=!1!==e.enableFooterTotalSelected,e.isRowSelectable=angular.isDefined(e.isRowSelectable)?e.isRowSelectable:angular.noop},toggleRowSelection:function(e,t,i,o,n,l){if(!1!==t.enableSelection){void 0===l&&(l=!0);var c=t.isSelected;o||(c?1<a.getSelectedRows(e).length&&(c=!1,a.clearSelectedRows(e,i)):a.clearSelectedRows(e,i)),c&&n||!l&&!t.visible||(t.setSelected(!c),!0===t.isSelected&&(e.selection.lastSelectedRow=t),e.selection.selectAll=e.rows.length===a.getSelectedRows(e).length,e.api.selection.raise.rowSelectionChanged(t,i))}},shiftSelect:function(e,t,i,o){if(o){var n=0<a.getSelectedRows(e).length?e.renderContainers.body.visibleRowCache.indexOf(e.selection.lastSelectedRow):0,l=e.renderContainers.body.visibleRowCache.indexOf(t);if(l<n){var c=n;n=l,l=c}for(var s=[],r=n;r<=l;r++){var d=e.renderContainers.body.visibleRowCache[r];d&&(d.isSelected||!1===d.enableSelection||(d.setSelected(!0),e.selection.lastSelectedRow=d,a.decideRaiseSelectionEvent(e,d,s,i)))}a.decideRaiseSelectionBatchEvent(e,s,i)}},getSelectedRows:function(e){return e.rows.filter(function(e){return e.isSelected})},getUnSelectedRows:function(e){return e.rows.filter(function(e){return!e.isSelected})},mapAndFilterRowsByEntity:function(e){return"function"==typeof e.reduce?e.reduce(function(e,t){return!t.entity.hasOwnProperty("$$hashKey")&&angular.isObject(t.entity)||e.push(t.entity),e},[]):e.filter(function(e){return e.entity.hasOwnProperty("$$hashKey")||!angular.isObject(e.entity)}).map(function(e){return e.entity})},clearSelectedRows:function(t,i){var o=[];a.getSelectedRows(t).forEach(function(e){e.isSelected&&!1!==e.enableSelection&&(e.setSelected(!1),a.decideRaiseSelectionEvent(t,e,o,i))}),t.selection.selectAll=!1,t.selection.selectedCount=0,a.decideRaiseSelectionBatchEvent(t,o,i)},decideRaiseSelectionEvent:function(e,t,i,o){e.options.enableSelectionBatchEvent?i.push(t):e.api.selection.raise.rowSelectionChanged(t,o)},decideRaiseSelectionBatchEvent:function(e,t,i){0<t.length&&e.api.selection.raise.rowSelectionChangedBatch(t,i)}};return a}),e.directive("uiGridSelection",["i18nService","uiGridSelectionConstants","uiGridSelectionService","uiGridConstants",function(d,a,u,g){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,compile:function(){return{pre:function(e,t,i,o){if(u.initializeGrid(o.grid),o.grid.options.enableRowHeaderSelection){var n={name:a.selectionRowHeaderColName,displayName:d.getSafeText("selection.displayName"),width:o.grid.options.selectionRowHeaderWidth,minWidth:10,cellTemplate:"ui-grid/selectionRowHeader",headerCellTemplate:"ui-grid/selectionHeaderCell",enableColumnResizing:!1,enableColumnMenu:!1,exporterSuppressExport:!0,allowCellFocus:!0};o.grid.addRowHeaderColumn(n,0)}var l=!1,c=function(e){return e.forEach(function(e){e.enableSelection=o.grid.options.isRowSelectable(e)}),e},s=function(){o.grid.options.isRowSelectable!==angular.noop&&!0!==l&&(o.grid.registerRowsProcessor(c,500),l=!0)};s();var r=o.grid.registerDataChangeCallback(s,[g.dataChange.OPTIONS]);e.$on("$destroy",r)},post:function(e,t,i,o){}}}}}]),e.directive("uiGridSelectionRowHeaderButtons",["$templateCache","uiGridSelectionService","gridUtil",function(e,c,s){return{replace:!0,restrict:"E",template:e.get("ui-grid/selectionRowHeaderButtons"),scope:!0,require:"^uiGrid",link:function(e,t,i,o){var n=o.grid;function l(e,t){if(t.stopPropagation(),t.shiftKey)c.shiftSelect(n,e,t,n.options.multiSelect);else if(t.ctrlKey||t.metaKey)c.toggleRowSelection(n,e,t,n.options.multiSelect,n.options.noUnselect,!1);else if(e.groupHeader){c.toggleRowSelection(n,e,t,n.options.multiSelect,n.options.noUnselect,!1);for(var i=0;i<e.treeNode.children.length;i++)c.toggleRowSelection(n,e.treeNode.children[i].row,t,n.options.multiSelect,n.options.noUnselect,!1)}else c.toggleRowSelection(n,e,t,n.options.multiSelect&&!n.options.modifierKeysToMultiSelect,n.options.noUnselect,!1);n.options.enableFocusRowOnRowHeaderClick&&e.setFocused(!e.isFocused)&&n.api.selection.raise.rowFocusChanged(e,t)}e.selectButtonClick=l,e.selectButtonKeyDown=function(e,t){32!==t.keyCode&&13!==t.keyCode||(t.preventDefault(),l(e,t))},"ie"===s.detectBrowser()&&t.on("mousedown",function(e){(e.ctrlKey||e.shiftKey)&&(e.target.onselectstart=function(){return!1},window.setTimeout(function(){e.target.onselectstart=null},0))}),e.$on("$destroy",function(){t.off()})}}}]),e.directive("uiGridSelectionSelectAllButtons",["$templateCache","uiGridSelectionService",function(e,o){return{replace:!0,restrict:"E",template:e.get("ui-grid/selectionSelectAllButtons"),scope:!1,link:function(t){var i=t.col.grid;t.headerButtonKeyDown=function(e){32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),t.headerButtonClick(e))},t.headerButtonClick=function(e){i.selection.selectAll?(o.clearSelectedRows(i,e),i.options.noUnselect&&i.api.selection.selectRowByVisibleIndex(0,e),i.selection.selectAll=!1):i.options.multiSelect&&(i.api.selection.selectAllVisibleRows(e),i.selection.selectAll=!0)}}}}]),e.directive("uiGridViewport",function(){return{priority:-200,scope:!1,compile:function(e){var t=angular.element(e[0].querySelector(".ui-grid-canvas:not(.ui-grid-empty-base-layer-container)").children[0]),i="'ui-grid-row-selected': row.isSelected, 'ui-grid-row-focused': row.isFocused}",o=t.attr("ng-class");return i=o?o.slice(0,-1)+","+i:"{"+i,t.attr("ng-class",i),{pre:function(e,t,i,o){},post:function(e,t,i,o){}}}}}),e.directive("uiGridCell",["uiGridConstants","uiGridSelectionService",function(u,g){return{priority:-200,restrict:"A",require:"?^uiGrid",scope:!1,link:function(i,c,e,t){var s=0,r={};t.grid.api.cellNav&&t.grid.api.cellNav.on.viewPortKeyDown(i,function(e,t){null!==t&&t.row===i.row&&t.col===i.col&&e.keyCode===u.keymap.SPACE&&"selectionRowHeaderCol"===i.col.colDef.name&&(e.preventDefault(),g.toggleRowSelection(i.grid,i.row,e,i.grid.options.multiSelect&&!i.grid.options.modifierKeysToMultiSelect,i.grid.options.noUnselect,!1),i.$apply())});var d=function(e){"ui-grid-icon-minus-squared"!==e.target.className&&"ui-grid-icon-plus-squared"!==e.target.className&&(c.off("touchend",n),e.shiftKey?g.shiftSelect(i.grid,i.row,e,i.grid.options.multiSelect):e.ctrlKey||e.metaKey?g.toggleRowSelection(i.grid,i.row,e,i.grid.options.multiSelect,i.grid.options.noUnselect,!1):i.grid.options.enableSelectRowOnFocus&&g.toggleRowSelection(i.grid,i.row,e,i.grid.options.multiSelect&&!i.grid.options.modifierKeysToMultiSelect,i.grid.options.noUnselect,!1),i.row.setFocused(!i.row.isFocused),i.grid.api.selection.raise.rowFocusChanged(i.row,e),i.$apply(),window.setTimeout(function(){c.on("touchend",n)},300))},o=function(e){s=(new Date).getTime(),r=e.changedTouches[0],c.off("click",d)},n=function(e){var t=(new Date).getTime(),i=e.changedTouches[0],o=t-s,n=Math.abs(r.clientX-i.clientX),l=Math.abs(r.clientY-i.clientY);n<100&&l<100&&o<300&&d(e),window.setTimeout(function(){c.on("click",d)},300)};function l(){i.grid.options.enableRowSelection&&i.grid.options.enableFullRowSelection&&"selectionRowHeaderCol"!==i.col.colDef.name&&(c.addClass("ui-grid-disable-selection"),c.on("touchstart",o),c.on("touchend",n),c.on("click",d),i.registered=!0)}l();var a=i.grid.registerDataChangeCallback(function(){i.grid.options.enableRowSelection&&i.grid.options.enableFullRowSelection&&!i.registered?l():i.grid.options.enableRowSelection&&i.grid.options.enableFullRowSelection||!i.registered||i.registered&&(c.removeClass("ui-grid-disable-selection"),c.off("touchstart",o),c.off("touchend",n),c.off("click",d),i.registered=!1)},[u.dataChange.OPTIONS]);c.on("$destroy",a)}}}]),e.directive("uiGridGridFooter",["$compile","gridUtil",function(l,i){return{restrict:"EA",replace:!0,priority:-1e3,require:"^uiGrid",scope:!0,compile:function(){return{pre:function(o,n,e,t){t.grid.options.showGridFooter&&i.getTemplate("ui-grid/gridFooterSelectedItems").then(function(e){var t=angular.element(e),i=l(t)(o);angular.element(n[0].getElementsByClassName("ui-grid-grid-footer")[0]).append(i)})},post:function(e,t,i,o){}}}}}])}(),angular.module("ui.grid.selection").run(["$templateCache",function(e){"use strict";e.put("ui-grid/gridFooterSelectedItems",'<span ng-if="grid.selection.selectedCount !== 0 && grid.options.enableFooterTotalSelected">({{"search.selectedItems" | t}} {{grid.selection.selectedCount}})</span>'),e.put("ui-grid/selectionHeaderCell",'<div>\x3c!-- <div class="ui-grid-vertical-bar"> </div> --\x3e<div class="ui-grid-cell-contents" col-index="renderIndex"><ui-grid-selection-select-all-buttons ng-if="grid.options.enableSelectAll" role="checkbox" ng-model="grid.selection.selectAll"></ui-grid-selection-select-all-buttons></div></div>'),e.put("ui-grid/selectionRowHeader",'<div class="ui-grid-cell-contents ui-grid-disable-selection clickable"><ui-grid-selection-row-header-buttons></ui-grid-selection-row-header-buttons></div>'),e.put("ui-grid/selectionRowHeaderButtons",'<div class="ui-grid-selection-row-header-buttons ui-grid-icon-ok clickable" ng-class="{\'ui-grid-row-selected\': row.isSelected}" tabindex="0" ng-click="selectButtonClick(row, $event)" ng-keydown="selectButtonKeyDown(row, $event)" ng-attr-aria-label="{{(\'selection.aria.row\' | t) + \' \' + (row.index + 1) + \', \' + col.displayName}}" aria-checked="{{row.isSelected}}" role="checkbox" ng-model="row.isSelected"> </div>'),e.put("ui-grid/selectionSelectAllButtons",'<div role="checkbox" tabindex="0" class="ui-grid-selection-row-header-buttons ui-grid-icon-ok" ui-grid-one-bind-aria-label="\'selection.selectAll\' | t" aria-checked="{{grid.selection.selectAll}}" ng-class="{\'ui-grid-all-selected\': grid.selection.selectAll}" ng-click="headerButtonClick($event)" ng-keydown="headerButtonKeyDown($event)"></div>')}]); |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
@@ -30,3 +30,3 @@ { | ||
"license": "MIT", | ||
"version": "4.11.0", | ||
"version": "4.11.1", | ||
"files": [ | ||
@@ -33,0 +33,0 @@ "css", |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
!function(){"use strict";var e=angular.module("ui.grid.exporter",["ui.grid"]);e.constant("uiGridExporterConstants",{featureName:"exporter",rowHeaderColName:"treeBaseRowHeaderCol",selectionRowHeaderColName:"selectionRowHeaderCol",ALL:"all",VISIBLE:"visible",SELECTED:"selected",CSV_CONTENT:"CSV_CONTENT",BUTTON_LABEL:"BUTTON_LABEL",FILE_NAME:"FILE_NAME"}),e.service("uiGridExporterService",["$filter","$q","uiGridExporterConstants","gridUtil","$compile","$interval","i18nService",function(p,n,x,d,e,t,r){var o={delay:100,initializeGrid:function(r){r.exporter={},this.defaultGridOptions(r.options);var e={events:{exporter:{}},methods:{exporter:{csvExport:function(e,t){o.csvExport(r,e,t)},pdfExport:function(e,t){o.pdfExport(r,e,t)},excelExport:function(e,t){o.excelExport(r,e,t)}}}};r.api.registerEventsFromObject(e.events),r.api.registerMethodsFromObject(e.methods),r.api.core.addToGridMenu?o.addToMenu(r):t(function(){r.api.core.addToGridMenu&&o.addToMenu(r)},this.delay,1)},defaultGridOptions:function(e){e.exporterSuppressMenu=!0===e.exporterSuppressMenu,e.exporterMenuLabel=e.exporterMenuLabel?e.exporterMenuLabel:"Export",e.exporterSuppressColumns=e.exporterSuppressColumns?e.exporterSuppressColumns:[],e.exporterCsvColumnSeparator=e.exporterCsvColumnSeparator?e.exporterCsvColumnSeparator:",",e.exporterCsvFilename=e.exporterCsvFilename?e.exporterCsvFilename:"download.csv",e.exporterPdfFilename=e.exporterPdfFilename?e.exporterPdfFilename:"download.pdf",e.exporterExcelFilename=e.exporterExcelFilename?e.exporterExcelFilename:"download.xlsx",e.exporterExcelSheetName=e.exporterExcelSheetName?e.exporterExcelSheetName:"Sheet1",e.exporterOlderExcelCompatibility=!0===e.exporterOlderExcelCompatibility,e.exporterIsExcelCompatible=!0===e.exporterIsExcelCompatible,e.exporterMenuItemOrder=e.exporterMenuItemOrder?e.exporterMenuItemOrder:200,e.exporterPdfDefaultStyle=e.exporterPdfDefaultStyle?e.exporterPdfDefaultStyle:{fontSize:11},e.exporterPdfTableStyle=e.exporterPdfTableStyle?e.exporterPdfTableStyle:{margin:[0,5,0,15]},e.exporterPdfTableHeaderStyle=e.exporterPdfTableHeaderStyle?e.exporterPdfTableHeaderStyle:{bold:!0,fontSize:12,color:"black"},e.exporterPdfHeader=e.exporterPdfHeader?e.exporterPdfHeader:null,e.exporterPdfFooter=e.exporterPdfFooter?e.exporterPdfFooter:null,e.exporterPdfOrientation=e.exporterPdfOrientation?e.exporterPdfOrientation:"landscape",e.exporterPdfPageSize=e.exporterPdfPageSize?e.exporterPdfPageSize:"A4",e.exporterPdfMaxGridWidth=e.exporterPdfMaxGridWidth?e.exporterPdfMaxGridWidth:720,e.exporterMenuAllData=void 0===e.exporterMenuAllData||e.exporterMenuAllData,e.exporterMenuVisibleData=void 0===e.exporterMenuVisibleData||e.exporterMenuVisibleData,e.exporterMenuSelectedData=void 0===e.exporterMenuSelectedData||e.exporterMenuSelectedData,e.exporterMenuCsv=void 0===e.exporterMenuCsv||e.exporterMenuCsv,e.exporterMenuPdf=void 0===e.exporterMenuPdf||e.exporterMenuPdf,e.exporterMenuExcel=void 0===e.exporterMenuExcel||e.exporterMenuExcel,e.exporterPdfCustomFormatter=e.exporterPdfCustomFormatter&&"function"==typeof e.exporterPdfCustomFormatter?e.exporterPdfCustomFormatter:function(e){return e},e.exporterHeaderFilterUseName=!0===e.exporterHeaderFilterUseName,e.exporterFieldCallback=e.exporterFieldCallback?e.exporterFieldCallback:i,e.exporterFieldFormatCallback=e.exporterFieldFormatCallback?e.exporterFieldFormatCallback:function(e,t,r,o){return null},e.exporterExcelCustomFormatters=e.exporterExcelCustomFormatters?e.exporterExcelCustomFormatters:function(e,t,r){return r},e.exporterExcelHeader=e.exporterExcelHeader?e.exporterExcelHeader:function(e,t,r,o){return null},e.exporterColumnScaleFactor=e.exporterColumnScaleFactor?e.exporterColumnScaleFactor:3.5,e.exporterFieldApplyFilters=!0===e.exporterFieldApplyFilters,e.exporterAllDataFn=e.exporterAllDataFn?e.exporterAllDataFn:null,null===e.exporterAllDataFn&&e.exporterAllDataPromise&&(e.exporterAllDataFn=e.exporterAllDataPromise)},addToMenu:function(e){e.api.core.addToGridMenu(e,[{title:r.getSafeText("gridMenu.exporterAllAsCsv"),action:function(){e.api.exporter.csvExport(x.ALL,x.ALL)},shown:function(){return e.options.exporterMenuCsv&&e.options.exporterMenuAllData},order:e.options.exporterMenuItemOrder},{title:r.getSafeText("gridMenu.exporterVisibleAsCsv"),action:function(){e.api.exporter.csvExport(x.VISIBLE,x.VISIBLE)},shown:function(){return e.options.exporterMenuCsv&&e.options.exporterMenuVisibleData},order:e.options.exporterMenuItemOrder+1},{title:r.getSafeText("gridMenu.exporterSelectedAsCsv"),action:function(){e.api.exporter.csvExport(x.SELECTED,x.VISIBLE)},shown:function(){return e.options.exporterMenuCsv&&e.options.exporterMenuSelectedData&&e.api.selection&&0<e.api.selection.getSelectedRows().length},order:e.options.exporterMenuItemOrder+2},{title:r.getSafeText("gridMenu.exporterAllAsPdf"),action:function(){e.api.exporter.pdfExport(x.ALL,x.ALL)},shown:function(){return e.options.exporterMenuPdf&&e.options.exporterMenuAllData},order:e.options.exporterMenuItemOrder+3},{title:r.getSafeText("gridMenu.exporterVisibleAsPdf"),action:function(){e.api.exporter.pdfExport(x.VISIBLE,x.VISIBLE)},shown:function(){return e.options.exporterMenuPdf&&e.options.exporterMenuVisibleData},order:e.options.exporterMenuItemOrder+4},{title:r.getSafeText("gridMenu.exporterSelectedAsPdf"),action:function(){e.api.exporter.pdfExport(x.SELECTED,x.VISIBLE)},shown:function(){return e.options.exporterMenuPdf&&e.options.exporterMenuSelectedData&&e.api.selection&&0<e.api.selection.getSelectedRows().length},order:e.options.exporterMenuItemOrder+5},{title:r.getSafeText("gridMenu.exporterAllAsExcel"),action:function(){e.api.exporter.excelExport(x.ALL,x.ALL)},shown:function(){return e.options.exporterMenuExcel&&e.options.exporterMenuAllData},order:e.options.exporterMenuItemOrder+6},{title:r.getSafeText("gridMenu.exporterVisibleAsExcel"),action:function(){e.api.exporter.excelExport(x.VISIBLE,x.VISIBLE)},shown:function(){return e.options.exporterMenuExcel&&e.options.exporterMenuVisibleData},order:e.options.exporterMenuItemOrder+7},{title:r.getSafeText("gridMenu.exporterSelectedAsExcel"),action:function(){e.api.exporter.excelExport(x.SELECTED,x.VISIBLE)},shown:function(){return e.options.exporterMenuExcel&&e.options.exporterMenuSelectedData&&e.api.selection&&0<e.api.selection.getSelectedRows().length},order:e.options.exporterMenuItemOrder+8}])},csvExport:function(o,n,i){var a=this;this.loadAllDataIfNeeded(o,n,i).then(function(){var e=o.options.showHeader?a.getColumnHeaders(o,i):[],t=a.getData(o,n,i),r=a.formatAsCsv(e,t,o.options.exporterCsvColumnSeparator);a.downloadFile(o.options.exporterCsvFilename,r,o.options.exporterCsvColumnSeparator,o.options.exporterOlderExcelCompatibility,o.options.exporterIsExcelCompatible)})},loadAllDataIfNeeded:function(t,e,r){if(e===x.ALL&&t.rows.length!==t.options.totalItems&&t.options.exporterAllDataFn)return t.options.exporterAllDataFn().then(function(e){t.modifyRows(e)});var o=n.defer();return o.resolve(),o.promise},getColumnHeaders:function(r,e){var t,o=[];if(e===x.ALL)t=r.columns;else{var n=r.renderContainers.left?r.renderContainers.left.visibleColumnCache.filter(function(e){return e.visible}):[],i=r.renderContainers.body?r.renderContainers.body.visibleColumnCache.filter(function(e){return e.visible}):[],a=r.renderContainers.right?r.renderContainers.right.visibleColumnCache.filter(function(e){return e.visible}):[];t=n.concat(i,a)}return t.forEach(function(e){if(!0!==e.colDef.exporterSuppressExport&&"$$hashKey"!==e.field&&-1===r.options.exporterSuppressColumns.indexOf(e.name)){var t={name:e.field,displayName:function(e,t){if(e.options.exporterHeaderFilter)return e.options.exporterHeaderFilterUseName?e.options.exporterHeaderFilter(t.name):e.options.exporterHeaderFilter(t.displayName);return t.headerCellFilter?p(t.headerCellFilter)(t.displayName):t.displayName}(r,e),width:e.drawnWidth?e.drawnWidth:e.width,align:e.colDef.align?e.colDef.align:"number"===e.colDef.type?"right":"left"};o.push(t)}}),o},getRowsFromNode:function(e){var t=[],r=e?Object.keys(e):["children"];if((1<r.length||"children"!=r[0])&&t.push(e),e&&e.children&&0<e.children.length)for(var o=0;o<e.children.length;o++)t=t.concat(this.getRowsFromNode(e.children[o]));return t},getDataSorted:function(e){if(!e.treeBase||0===e.treeBase.numberLevels)return e.rows;for(var t=[],r=0;r<e.treeBase.tree.length;r++)for(var o=this.getRowsFromNode(e.treeBase.tree[r]),n=0;n<o.length;n++)t.push(o[n].row);return t},getData:function(a,e,l,p){var t,r,o=[];switch(e){case x.ALL:t=this.getDataSorted(a,e,l,p);break;case x.VISIBLE:t=a.getVisibleRows();break;case x.SELECTED:a.api.selection?t=a.api.selection.getSelectedGridRows():d.logError("selection feature must be enabled to allow selected rows to be exported")}if(l===x.ALL)r=a.columns;else{var n=a.renderContainers.left?a.renderContainers.left.visibleColumnCache.filter(function(e){return e.visible}):[],i=a.renderContainers.body?a.renderContainers.body.visibleColumnCache.filter(function(e){return e.visible}):[],s=a.renderContainers.right?a.renderContainers.right.visibleColumnCache.filter(function(e){return e.visible}):[];r=n.concat(i,s)}return t.forEach(function(n){if(!1!==n.exporterEnableExporting){var i=[];r.forEach(function(e){if((e.visible||l===x.ALL)&&!0!==e.colDef.exporterSuppressExport&&"$$hashKey"!==e.field&&-1===a.options.exporterSuppressColumns.indexOf(e.name)){var t=p?a.getCellDisplayValue(n,e):a.getCellValue(n,e),r={value:a.options.exporterFieldCallback(a,n,e,t)},o=a.options.exporterFieldFormatCallback(a,n,e,t);o&&Object.assign(r,o),e.colDef.exporterPdfAlign&&(r.alignment=e.colDef.exporterPdfAlign),i.push(r)}}),o.push(i)}}),o},formatAsCsv:function(e,t,r){var o=e.map(function(e){return{value:e.displayName}}),n=0<o.length?this.formatRowAsCsv(this,r)(o)+"\n":"";return n+=t.map(this.formatRowAsCsv(this,r)).join("\n")},formatRowAsCsv:function(t,r){return function(e){return e.map(t.formatFieldAsCsv).join(r)}},formatFieldAsCsv:function(e){return null==e.value?"":"number"==typeof e.value?e.value:"boolean"==typeof e.value?e.value?"TRUE":"FALSE":"string"==typeof e.value?'"'+e.value.replace(/"/g,'""')+'"':"object"!=typeof e.value||e.value instanceof Date?JSON.stringify(e.value):'"'+JSON.stringify(e.value).replace(/"/g,'""')+'"'},isIE:function(){var e=!1;return-1!==navigator.userAgent.search(/(?:Edge|MSIE|Trident\/.*; rv:)/)&&(e=!0),e},downloadFile:function(e,t,r,o,n){var i,a=document,l=a.createElement("a"),p="application/octet-stream;charset=utf-8",s=this.isIE();if(n&&(t="sep="+r+"\r\n"+t),navigator.msSaveBlob)return navigator.msSaveOrOpenBlob(new Blob([o?"\ufeff":"",t],{type:p}),e);if(s){var d=a.createElement("iframe");return document.body.appendChild(d),d.contentWindow.document.open("text/html","replace"),d.contentWindow.document.write(t),d.contentWindow.document.close(),d.contentWindow.focus(),d.contentWindow.document.execCommand("SaveAs",!0,e),document.body.removeChild(d),!0}if("download"in l){var u=new Blob([o?"\ufeff":"",t],{type:p});i=URL.createObjectURL(u),l.setAttribute("download",e)}else i="data: "+p+","+encodeURIComponent(t),l.setAttribute("target","_blank");l.href=i,l.setAttribute("style","display:none;"),a.body.appendChild(l),setTimeout(function(){if(l.click)l.click();else if(document.createEvent){var e=document.createEvent("MouseEvents");e.initEvent("click",!0,!0),l.dispatchEvent(e)}a.body.removeChild(l)},this.delay)},pdfExport:function(o,n,i){var a=this;this.loadAllDataIfNeeded(o,n,i).then(function(){var e=a.getColumnHeaders(o,i),t=a.getData(o,n,i),r=a.prepareAsPdf(o,e,t);a.isIE()||-1!==navigator.appVersion.indexOf("Edge")?a.downloadPDF(o.options.exporterPdfFilename,r):pdfMake.createPdf(r).open()})},downloadPDF:function(r,e){var o,n,i=document;i.createElement("a");o=this.isIE(),pdfMake.createPdf(e).getBuffer(function(e){if(n=new Blob([e]),navigator.msSaveBlob)return navigator.msSaveBlob(n,r);if(o){var t=i.createElement("iframe");return document.body.appendChild(t),t.contentWindow.document.open("text/html","replace"),t.contentWindow.document.write(n),t.contentWindow.document.close(),t.contentWindow.focus(),t.contentWindow.document.execCommand("SaveAs",!0,r),document.body.removeChild(t),!0}})},prepareAsPdf:function(e,t,r){var o=this.calculatePdfHeaderWidths(e,t),n=t.map(function(e){return{text:e.displayName,style:"tableHeader"}}),i=r.map(this.formatRowAsPdf(this)),a=[n].concat(i),l={pageOrientation:e.options.exporterPdfOrientation,pageSize:e.options.exporterPdfPageSize,content:[{style:"tableStyle",table:{headerRows:1,widths:o,body:a}}],styles:{tableStyle:e.options.exporterPdfTableStyle,tableHeader:e.options.exporterPdfTableHeaderStyle},defaultStyle:e.options.exporterPdfDefaultStyle};return e.options.exporterPdfLayout&&(l.layout=e.options.exporterPdfLayout),e.options.exporterPdfHeader&&(l.header=e.options.exporterPdfHeader),e.options.exporterPdfFooter&&(l.footer=e.options.exporterPdfFooter),e.options.exporterPdfCustomFormatter&&(l=e.options.exporterPdfCustomFormatter(l)),l},calculatePdfHeaderWidths:function(t,e){var r=0;e.forEach(function(e){"number"==typeof e.width&&(r+=e.width)});var o=0;e.forEach(function(e){if("*"===e.width&&(o+=100),"string"==typeof e.width&&e.width.match(/(\d)*%/)){var t=parseInt(e.width.match(/(\d)*%/)[0]);e.width=r*t/100,o+=e.width}});var n=r+o;return e.map(function(e){return"*"===e.width?e.width:e.width*t.options.exporterPdfMaxGridWidth/n})},formatRowAsPdf:function(t){return function(e){return e.map(t.formatFieldAsPdfString)}},formatFieldAsPdfString:function(e){var t;return t=null==e.value?"":"number"==typeof e.value?e.value.toString():"boolean"==typeof e.value?e.value?"TRUE":"FALSE":"string"==typeof e.value?e.value.replace(/"/g,'""'):e.value instanceof Date?JSON.stringify(e.value).replace(/^"/,"").replace(/"$/,""):"object"==typeof e.value?e.value:JSON.stringify(e.value).replace(/^"/,"").replace(/"$/,""),e.alignment&&"string"==typeof e.alignment&&(t={text:t,alignment:e.alignment}),t},formatAsExcel:function(e,t,r,o,n){for(var i=e.map(function(e){return{value:e.displayName}}),a=[],l=[],p=0;p<i.length;p++){var s="header";switch(e[p].align){case"center":s="headerCenter";break;case"right":s="headerRight"}var d=n.styles&&n.styles[s]?{style:n.styles[s].id}:null;l.push({value:i[p].value,metadata:d})}a.push(l);for(var u=t.map(this.formatRowAsExcel(this,r,o)),c=0;c<u.length;c++)a.push(u[c]);return a},formatRowAsExcel:function(n,i,a){return function(e){for(var t=[],r=0;r<e.length;r++){var o=n.formatFieldAsExcel(e[r],i,a);t.push({value:o,metadata:e[r].metadata})}return t}},formatFieldAsExcel:function(e,t,r,o){return null==e.value?"":"number"==typeof e.value||"string"==typeof e.value?e.value:"boolean"==typeof e.value?e.value?"TRUE":"FALSE":JSON.stringify(e.value)},prepareAsExcel:function(e,t,r){var o={styles:{}};if(e.options.exporterExcelCustomFormatters&&(o=e.options.exporterExcelCustomFormatters(e,t,o)),e.options.exporterExcelHeader)if(angular.isFunction(e.options.exporterExcelHeader))e.options.exporterExcelHeader(e,t,r,o);else{var n=e.options.exporterExcelHeader.text,i=e.options.exporterExcelHeader.style;r.data.push([{value:n,metadata:{style:o.styles[i].id}}])}return o},excelExport:function(s,d,u){var c=this;this.loadAllDataIfNeeded(s,d,u).then(function(){var e=s.options.showHeader?c.getColumnHeaders(s,u):[],t=new ExcelBuilder.Workbook,r=s.options.exporterExcelSheetName?s.options.exporterExcelSheetName:"Sheet1",o=new ExcelBuilder.Worksheet({name:r});t.addWorksheet(o);for(var n=c.prepareAsExcel(s,t,o),i=[],a=s.treeBase?s.treeBase.numberLevels:s.enableRowSelection?1:0;a<s.columns.length;a++)s.columns[a].field!==x.rowHeaderColName&&s.columns[a].field!==x.selectionRowHeaderColName&&i.push({width:s.columns[a].drawnWidth/s.options.exporterColumnScaleFactor});o.setColumns(i);var l=c.getData(s,d,u,s.options.exporterFieldApplyFilters),p=c.formatAsExcel(e,l,t,o,n);o.setData(o.data.concat(p)),ExcelBuilder.Builder.createFile(t,{type:"blob"}).then(function(e){c.downloadFile(s.options.exporterExcelFilename,e,s.options.exporterCsvColumnSeparator,s.options.exporterOlderExcelCompatibility)})})}};function i(e,t,r,o){var n,i,a,l;return r.cellFilter?(i=(n=r.cellFilter.match(/(?:[^:"]+|"[^"]*")+/g))[0]?n[0].replace(/[\'\"\s]/g,""):null,a=n[1]?n[1].replace(/[\'\"]/g,"").trim():null,l=n[2]?n[2].replace(/[\'\"\s]/g,""):null,p(i)(o,a,l)):o}return o}]),e.directive("uiGridExporter",["uiGridExporterConstants","uiGridExporterService","gridUtil","$compile",function(e,n,t,r){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,link:function(e,t,r,o){n.initializeGrid(o.grid),o.grid.exporter.$scope=e}}}])}(),angular.module("ui.grid.exporter").run(["$templateCache",function(e){"use strict";e.put("ui-grid/csvLink",'<span class="ui-grid-exporter-csv-link-span"><a href="data:text/csv;charset=UTF-8,CSV_CONTENT" download="FILE_NAME">LINK_LABEL</a></span>')}]); | ||
!function(){"use strict";var e=angular.module("ui.grid.exporter",["ui.grid"]);e.constant("uiGridExporterConstants",{featureName:"exporter",rowHeaderColName:"treeBaseRowHeaderCol",selectionRowHeaderColName:"selectionRowHeaderCol",ALL:"all",VISIBLE:"visible",SELECTED:"selected",CSV_CONTENT:"CSV_CONTENT",BUTTON_LABEL:"BUTTON_LABEL",FILE_NAME:"FILE_NAME"}),e.service("uiGridExporterService",["$filter","$q","uiGridExporterConstants","gridUtil","$compile","$interval","i18nService",function(p,n,x,d,e,t,r){var o={delay:100,initializeGrid:function(r){r.exporter={},this.defaultGridOptions(r.options);var e={events:{exporter:{}},methods:{exporter:{csvExport:function(e,t){o.csvExport(r,e,t)},pdfExport:function(e,t){o.pdfExport(r,e,t)},excelExport:function(e,t){o.excelExport(r,e,t)}}}};r.api.registerEventsFromObject(e.events),r.api.registerMethodsFromObject(e.methods),r.api.core.addToGridMenu?o.addToMenu(r):t(function(){r.api.core.addToGridMenu&&o.addToMenu(r)},this.delay,1)},defaultGridOptions:function(e){e.exporterSuppressMenu=!0===e.exporterSuppressMenu,e.exporterMenuLabel=e.exporterMenuLabel?e.exporterMenuLabel:"Export",e.exporterSuppressColumns=e.exporterSuppressColumns?e.exporterSuppressColumns:[],e.exporterCsvColumnSeparator=e.exporterCsvColumnSeparator?e.exporterCsvColumnSeparator:",",e.exporterCsvFilename=e.exporterCsvFilename?e.exporterCsvFilename:"download.csv",e.exporterPdfFilename=e.exporterPdfFilename?e.exporterPdfFilename:"download.pdf",e.exporterExcelFilename=e.exporterExcelFilename?e.exporterExcelFilename:"download.xlsx",e.exporterExcelSheetName=e.exporterExcelSheetName?e.exporterExcelSheetName:"Sheet1",e.exporterOlderExcelCompatibility=!0===e.exporterOlderExcelCompatibility,e.exporterIsExcelCompatible=!0===e.exporterIsExcelCompatible,e.exporterMenuItemOrder=e.exporterMenuItemOrder?e.exporterMenuItemOrder:200,e.exporterPdfDefaultStyle=e.exporterPdfDefaultStyle?e.exporterPdfDefaultStyle:{fontSize:11},e.exporterPdfTableStyle=e.exporterPdfTableStyle?e.exporterPdfTableStyle:{margin:[0,5,0,15]},e.exporterPdfTableHeaderStyle=e.exporterPdfTableHeaderStyle?e.exporterPdfTableHeaderStyle:{bold:!0,fontSize:12,color:"black"},e.exporterPdfHeader=e.exporterPdfHeader?e.exporterPdfHeader:null,e.exporterPdfFooter=e.exporterPdfFooter?e.exporterPdfFooter:null,e.exporterPdfOrientation=e.exporterPdfOrientation?e.exporterPdfOrientation:"landscape",e.exporterPdfPageSize=e.exporterPdfPageSize?e.exporterPdfPageSize:"A4",e.exporterPdfMaxGridWidth=e.exporterPdfMaxGridWidth?e.exporterPdfMaxGridWidth:720,e.exporterMenuAllData=void 0===e.exporterMenuAllData||e.exporterMenuAllData,e.exporterMenuVisibleData=void 0===e.exporterMenuVisibleData||e.exporterMenuVisibleData,e.exporterMenuSelectedData=void 0===e.exporterMenuSelectedData||e.exporterMenuSelectedData,e.exporterMenuCsv=void 0===e.exporterMenuCsv||e.exporterMenuCsv,e.exporterMenuPdf=void 0===e.exporterMenuPdf||e.exporterMenuPdf,e.exporterMenuExcel=void 0===e.exporterMenuExcel||e.exporterMenuExcel,e.exporterPdfCustomFormatter=e.exporterPdfCustomFormatter&&"function"==typeof e.exporterPdfCustomFormatter?e.exporterPdfCustomFormatter:function(e){return e},e.exporterHeaderFilterUseName=!0===e.exporterHeaderFilterUseName,e.exporterFieldCallback=e.exporterFieldCallback?e.exporterFieldCallback:i,e.exporterFieldFormatCallback=e.exporterFieldFormatCallback?e.exporterFieldFormatCallback:function(e,t,r,o){return null},e.exporterExcelCustomFormatters=e.exporterExcelCustomFormatters?e.exporterExcelCustomFormatters:function(e,t,r){return r},e.exporterExcelHeader=e.exporterExcelHeader?e.exporterExcelHeader:function(e,t,r,o){return null},e.exporterColumnScaleFactor=e.exporterColumnScaleFactor?e.exporterColumnScaleFactor:3.5,e.exporterFieldApplyFilters=!0===e.exporterFieldApplyFilters,e.exporterAllDataFn=e.exporterAllDataFn?e.exporterAllDataFn:null,null===e.exporterAllDataFn&&e.exporterAllDataPromise&&(e.exporterAllDataFn=e.exporterAllDataPromise)},addToMenu:function(e){e.api.core.addToGridMenu(e,[{title:r.getSafeText("gridMenu.exporterAllAsCsv"),action:function(){e.api.exporter.csvExport(x.ALL,x.ALL)},shown:function(){return e.options.exporterMenuCsv&&e.options.exporterMenuAllData},order:e.options.exporterMenuItemOrder},{title:r.getSafeText("gridMenu.exporterVisibleAsCsv"),action:function(){e.api.exporter.csvExport(x.VISIBLE,x.VISIBLE)},shown:function(){return e.options.exporterMenuCsv&&e.options.exporterMenuVisibleData},order:e.options.exporterMenuItemOrder+1},{title:r.getSafeText("gridMenu.exporterSelectedAsCsv"),action:function(){e.api.exporter.csvExport(x.SELECTED,x.VISIBLE)},shown:function(){return e.options.exporterMenuCsv&&e.options.exporterMenuSelectedData&&e.api.selection&&0<e.api.selection.getSelectedRows().length},order:e.options.exporterMenuItemOrder+2},{title:r.getSafeText("gridMenu.exporterAllAsPdf"),action:function(){e.api.exporter.pdfExport(x.ALL,x.ALL)},shown:function(){return e.options.exporterMenuPdf&&e.options.exporterMenuAllData},order:e.options.exporterMenuItemOrder+3},{title:r.getSafeText("gridMenu.exporterVisibleAsPdf"),action:function(){e.api.exporter.pdfExport(x.VISIBLE,x.VISIBLE)},shown:function(){return e.options.exporterMenuPdf&&e.options.exporterMenuVisibleData},order:e.options.exporterMenuItemOrder+4},{title:r.getSafeText("gridMenu.exporterSelectedAsPdf"),action:function(){e.api.exporter.pdfExport(x.SELECTED,x.VISIBLE)},shown:function(){return e.options.exporterMenuPdf&&e.options.exporterMenuSelectedData&&e.api.selection&&0<e.api.selection.getSelectedRows().length},order:e.options.exporterMenuItemOrder+5},{title:r.getSafeText("gridMenu.exporterAllAsExcel"),action:function(){e.api.exporter.excelExport(x.ALL,x.ALL)},shown:function(){return e.options.exporterMenuExcel&&e.options.exporterMenuAllData},order:e.options.exporterMenuItemOrder+6},{title:r.getSafeText("gridMenu.exporterVisibleAsExcel"),action:function(){e.api.exporter.excelExport(x.VISIBLE,x.VISIBLE)},shown:function(){return e.options.exporterMenuExcel&&e.options.exporterMenuVisibleData},order:e.options.exporterMenuItemOrder+7},{title:r.getSafeText("gridMenu.exporterSelectedAsExcel"),action:function(){e.api.exporter.excelExport(x.SELECTED,x.VISIBLE)},shown:function(){return e.options.exporterMenuExcel&&e.options.exporterMenuSelectedData&&e.api.selection&&0<e.api.selection.getSelectedRows().length},order:e.options.exporterMenuItemOrder+8}])},csvExport:function(n,i,a){var l=this;this.loadAllDataIfNeeded(n,i,a).then(function(){var e=n.options.showHeader?l.getColumnHeaders(n,a):[],t=l.getData(n,i,a),r=l.formatAsCsv(e,t,n.options.exporterCsvColumnSeparator),o=angular.isFunction(n.options.exporterCsvFilename)?n.options.exporterCsvFilename(n,i,a):n.options.exporterCsvFilename;l.downloadFile(o,r,n.options.exporterCsvColumnSeparator,n.options.exporterOlderExcelCompatibility,n.options.exporterIsExcelCompatible)})},loadAllDataIfNeeded:function(t,e,r){if(e===x.ALL&&t.rows.length!==t.options.totalItems&&t.options.exporterAllDataFn)return t.options.exporterAllDataFn().then(function(e){t.modifyRows(e)});var o=n.defer();return o.resolve(),o.promise},getColumnHeaders:function(r,e){var t,o=[];if(e===x.ALL)t=r.columns;else{var n=r.renderContainers.left?r.renderContainers.left.visibleColumnCache.filter(function(e){return e.visible}):[],i=r.renderContainers.body?r.renderContainers.body.visibleColumnCache.filter(function(e){return e.visible}):[],a=r.renderContainers.right?r.renderContainers.right.visibleColumnCache.filter(function(e){return e.visible}):[];t=n.concat(i,a)}return t.forEach(function(e){if(!0!==e.colDef.exporterSuppressExport&&"$$hashKey"!==e.field&&-1===r.options.exporterSuppressColumns.indexOf(e.name)){var t={name:e.field,displayName:function(e,t){if(e.options.exporterHeaderFilter)return e.options.exporterHeaderFilterUseName?e.options.exporterHeaderFilter(t.name):e.options.exporterHeaderFilter(t.displayName);return t.headerCellFilter?p(t.headerCellFilter)(t.displayName):t.displayName}(r,e),width:e.drawnWidth?e.drawnWidth:e.width,align:e.colDef.align?e.colDef.align:"number"===e.colDef.type?"right":"left"};o.push(t)}}),o},getRowsFromNode:function(e){var t=[],r=e?Object.keys(e):["children"];if((1<r.length||"children"!=r[0])&&t.push(e),e&&e.children&&0<e.children.length)for(var o=0;o<e.children.length;o++)t=t.concat(this.getRowsFromNode(e.children[o]));return t},getDataSorted:function(e){if(!e.treeBase||0===e.treeBase.numberLevels)return e.rows;for(var t=[],r=0;r<e.treeBase.tree.length;r++)for(var o=this.getRowsFromNode(e.treeBase.tree[r]),n=0;n<o.length;n++)t.push(o[n].row);return t},getData:function(a,e,l,p){var t,r,o=[];switch(e){case x.ALL:t=this.getDataSorted(a,e,l,p);break;case x.VISIBLE:t=a.getVisibleRows();break;case x.SELECTED:a.api.selection?t=a.api.selection.getSelectedGridRows():d.logError("selection feature must be enabled to allow selected rows to be exported")}if(l===x.ALL)r=a.columns;else{var n=a.renderContainers.left?a.renderContainers.left.visibleColumnCache.filter(function(e){return e.visible}):[],i=a.renderContainers.body?a.renderContainers.body.visibleColumnCache.filter(function(e){return e.visible}):[],s=a.renderContainers.right?a.renderContainers.right.visibleColumnCache.filter(function(e){return e.visible}):[];r=n.concat(i,s)}return t.forEach(function(n){if(!1!==n.exporterEnableExporting){var i=[];r.forEach(function(e){if((e.visible||l===x.ALL)&&!0!==e.colDef.exporterSuppressExport&&"$$hashKey"!==e.field&&-1===a.options.exporterSuppressColumns.indexOf(e.name)){var t=p?a.getCellDisplayValue(n,e):a.getCellValue(n,e),r={value:a.options.exporterFieldCallback(a,n,e,t)},o=a.options.exporterFieldFormatCallback(a,n,e,t);o&&Object.assign(r,o),e.colDef.exporterPdfAlign&&(r.alignment=e.colDef.exporterPdfAlign),i.push(r)}}),o.push(i)}}),o},formatAsCsv:function(e,t,r){var o=e.map(function(e){return{value:e.displayName}}),n=0<o.length?this.formatRowAsCsv(this,r)(o)+"\n":"";return n+=t.map(this.formatRowAsCsv(this,r)).join("\n")},formatRowAsCsv:function(t,r){return function(e){return e.map(t.formatFieldAsCsv).join(r)}},formatFieldAsCsv:function(e){return null==e.value?"":"number"==typeof e.value?e.value:"boolean"==typeof e.value?e.value?"TRUE":"FALSE":"string"==typeof e.value?'"'+e.value.replace(/"/g,'""')+'"':"object"!=typeof e.value||e.value instanceof Date?JSON.stringify(e.value):'"'+JSON.stringify(e.value).replace(/"/g,'""')+'"'},isIE:function(){var e=!1;return-1!==navigator.userAgent.search(/(?:Edge|MSIE|Trident\/.*; rv:)/)&&(e=!0),e},downloadFile:function(e,t,r,o,n){var i,a=document,l=a.createElement("a"),p="application/octet-stream;charset=utf-8",s=this.isIE();if(n&&(t="sep="+r+"\r\n"+t),navigator.msSaveBlob)return navigator.msSaveOrOpenBlob(new Blob([o?"\ufeff":"",t],{type:p}),e);if(s){var d=a.createElement("iframe");return document.body.appendChild(d),d.contentWindow.document.open("text/html","replace"),d.contentWindow.document.write(t),d.contentWindow.document.close(),d.contentWindow.focus(),d.contentWindow.document.execCommand("SaveAs",!0,e),document.body.removeChild(d),!0}if("download"in l){var u=new Blob([o?"\ufeff":"",t],{type:p});i=URL.createObjectURL(u),l.setAttribute("download",e)}else i="data: "+p+","+encodeURIComponent(t),l.setAttribute("target","_blank");l.href=i,l.setAttribute("style","display:none;"),a.body.appendChild(l),setTimeout(function(){if(l.click)l.click();else if(document.createEvent){var e=document.createEvent("MouseEvents");e.initEvent("click",!0,!0),l.dispatchEvent(e)}a.body.removeChild(l)},this.delay)},pdfExport:function(n,i,a){var l=this;this.loadAllDataIfNeeded(n,i,a).then(function(){var e=l.getColumnHeaders(n,a),t=l.getData(n,i,a),r=l.prepareAsPdf(n,e,t);if(l.isIE()||-1!==navigator.appVersion.indexOf("Edge")){var o=angular.isFunction(n.options.exporterPdfFilename)?n.options.exporterPdfFilename(n,i,a):n.options.exporterPdfFilename;l.downloadPDF(o,r)}else pdfMake.createPdf(r).open()})},downloadPDF:function(r,e){var o,n,i=document;i.createElement("a");o=this.isIE(),pdfMake.createPdf(e).getBuffer(function(e){if(n=new Blob([e]),navigator.msSaveBlob)return navigator.msSaveBlob(n,r);if(o){var t=i.createElement("iframe");return document.body.appendChild(t),t.contentWindow.document.open("text/html","replace"),t.contentWindow.document.write(n),t.contentWindow.document.close(),t.contentWindow.focus(),t.contentWindow.document.execCommand("SaveAs",!0,r),document.body.removeChild(t),!0}})},prepareAsPdf:function(e,t,r){var o=this.calculatePdfHeaderWidths(e,t),n=t.map(function(e){return{text:e.displayName,style:"tableHeader"}}),i=r.map(this.formatRowAsPdf(this)),a=[n].concat(i),l={pageOrientation:e.options.exporterPdfOrientation,pageSize:e.options.exporterPdfPageSize,content:[{style:"tableStyle",table:{headerRows:1,widths:o,body:a}}],styles:{tableStyle:e.options.exporterPdfTableStyle,tableHeader:e.options.exporterPdfTableHeaderStyle},defaultStyle:e.options.exporterPdfDefaultStyle};return e.options.exporterPdfLayout&&(l.layout=e.options.exporterPdfLayout),e.options.exporterPdfHeader&&(l.header=e.options.exporterPdfHeader),e.options.exporterPdfFooter&&(l.footer=e.options.exporterPdfFooter),e.options.exporterPdfCustomFormatter&&(l=e.options.exporterPdfCustomFormatter(l)),l},calculatePdfHeaderWidths:function(t,e){var r=0;e.forEach(function(e){"number"==typeof e.width&&(r+=e.width)});var o=0;e.forEach(function(e){if("*"===e.width&&(o+=100),"string"==typeof e.width&&e.width.match(/(\d)*%/)){var t=parseInt(e.width.match(/(\d)*%/)[0]);e.width=r*t/100,o+=e.width}});var n=r+o;return e.map(function(e){return"*"===e.width?e.width:e.width*t.options.exporterPdfMaxGridWidth/n})},formatRowAsPdf:function(t){return function(e){return e.map(t.formatFieldAsPdfString)}},formatFieldAsPdfString:function(e){var t;return t=null==e.value?"":"number"==typeof e.value?e.value.toString():"boolean"==typeof e.value?e.value?"TRUE":"FALSE":"string"==typeof e.value?e.value.replace(/"/g,'""'):e.value instanceof Date?JSON.stringify(e.value).replace(/^"/,"").replace(/"$/,""):"object"==typeof e.value?e.value:JSON.stringify(e.value).replace(/^"/,"").replace(/"$/,""),e.alignment&&"string"==typeof e.alignment&&(t={text:t,alignment:e.alignment}),t},formatAsExcel:function(e,t,r,o,n){for(var i=e.map(function(e){return{value:e.displayName}}),a=[],l=[],p=0;p<i.length;p++){var s="header";switch(e[p].align){case"center":s="headerCenter";break;case"right":s="headerRight"}var d=n.styles&&n.styles[s]?{style:n.styles[s].id}:null;l.push({value:i[p].value,metadata:d})}a.push(l);for(var u=t.map(this.formatRowAsExcel(this,r,o)),c=0;c<u.length;c++)a.push(u[c]);return a},formatRowAsExcel:function(n,i,a){return function(e){for(var t=[],r=0;r<e.length;r++){var o=n.formatFieldAsExcel(e[r],i,a);t.push({value:o,metadata:e[r].metadata})}return t}},formatFieldAsExcel:function(e,t,r,o){return null==e.value?"":"number"==typeof e.value||"string"==typeof e.value?e.value:"boolean"==typeof e.value?e.value?"TRUE":"FALSE":JSON.stringify(e.value)},prepareAsExcel:function(e,t,r){var o={styles:{}};if(e.options.exporterExcelCustomFormatters&&(o=e.options.exporterExcelCustomFormatters(e,t,o)),e.options.exporterExcelHeader)if(angular.isFunction(e.options.exporterExcelHeader))e.options.exporterExcelHeader(e,t,r,o);else{var n=e.options.exporterExcelHeader.text,i=e.options.exporterExcelHeader.style;r.data.push([{value:n,metadata:{style:o.styles[i].id}}])}return o},excelExport:function(s,d,u){var c=this;this.loadAllDataIfNeeded(s,d,u).then(function(){var e=s.options.showHeader?c.getColumnHeaders(s,u):[],t="Sheet1";s.options.exporterExcelSheetName&&(t=angular.isFunction(s.options.exporterExcelSheetName)?s.options.exporterExcelSheetName(s,d,u):s.options.exporterExcelSheetName);var r=new ExcelBuilder.Worksheet({name:t}),o=new ExcelBuilder.Workbook;o.addWorksheet(r);for(var n=c.prepareAsExcel(s,o,r),i=[],a=s.treeBase?s.treeBase.numberLevels:s.enableRowSelection?1:0;a<s.columns.length;a++)s.columns[a].field!==x.rowHeaderColName&&s.columns[a].field!==x.selectionRowHeaderColName&&i.push({width:s.columns[a].drawnWidth/s.options.exporterColumnScaleFactor});r.setColumns(i);var l=c.getData(s,d,u,s.options.exporterFieldApplyFilters),p=c.formatAsExcel(e,l,o,r,n);r.setData(r.data.concat(p)),ExcelBuilder.Builder.createFile(o,{type:"blob"}).then(function(e){var t=angular.isFunction(s.options.exporterExcelFilename)?s.options.exporterExcelFilename(s,d,u):s.options.exporterExcelFilename;c.downloadFile(t,e,s.options.exporterCsvColumnSeparator,s.options.exporterOlderExcelCompatibility)})})}};function i(e,t,r,o){var n,i,a,l;return r.cellFilter?(i=(n=r.cellFilter.match(/(?:[^:"]+|"[^"]*")+/g))[0]?n[0].replace(/[\'\"\s]/g,""):null,a=n[1]?n[1].replace(/[\'\"]/g,"").trim():null,l=n[2]?n[2].replace(/[\'\"\s]/g,""):null,p(i)(o,a,l)):o}return o}]),e.directive("uiGridExporter",["uiGridExporterConstants","uiGridExporterService","gridUtil","$compile",function(e,n,t,r){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,link:function(e,t,r,o){n.initializeGrid(o.grid),o.grid.exporter.$scope=e}}}])}(),angular.module("ui.grid.exporter").run(["$templateCache",function(e){"use strict";e.put("ui-grid/csvLink",'<span class="ui-grid-exporter-csv-link-span"><a href="data:text/csv;charset=UTF-8,CSV_CONTENT" download="FILE_NAME">LINK_LABEL</a></span>')}]); |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -961,3 +961,3 @@ | ||
// look for change of value - and insert a header | ||
if ( !groupFieldState.initialised || rowSorter.getSortFn(grid, groupFieldState.col, renderableRows)(fieldValue, groupFieldState.currentValue) !== 0 ) { | ||
if ( !groupFieldState.initialised || rowSorter.getSortFn(groupFieldState.col)(fieldValue, groupFieldState.currentValue) !== 0 ) { | ||
service.insertGroupHeader( grid, renderableRows, i, processingState, stateIndex ); | ||
@@ -964,0 +964,0 @@ i++; |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
!function(){"use strict";var r=angular.module("ui.grid.grouping",["ui.grid","ui.grid.treeBase"]);r.constant("uiGridGroupingConstants",{featureName:"grouping",rowHeaderColName:"treeBaseRowHeaderCol",EXPANDED:"expanded",COLLAPSED:"collapsed",aggregation:{COUNT:"count",SUM:"sum",MAX:"max",MIN:"min",AVG:"avg"}}),r.service("uiGridGroupingService",["$q","uiGridGroupingConstants","gridUtil","rowSorter","GridRow","gridClassFactory","i18nService","uiGridConstants","uiGridTreeBaseService",function(r,u,a,p,s,d,l,e,c){var f={initializeGrid:function(n,r){c.initializeGrid(n,r),n.grouping={},n.grouping.groupHeaderCache={},f.defaultGridOptions(n.options),n.registerRowsProcessor(f.groupRows,400),n.registerColumnBuilder(f.groupingColumnBuilder),n.registerColumnsProcessor(f.groupingColumnProcessor,400);var o={events:{grouping:{aggregationChanged:{},groupingChanged:{}}},methods:{grouping:{getGrouping:function(r){var o=f.getGrouping(n);return o.grouping.forEach(function(r){r.colName=r.col.name,delete r.col}),o.aggregations.forEach(function(r){r.colName=r.col.name,delete r.col}),o.aggregations=o.aggregations.filter(function(r){return!r.aggregation.source||"grouping"!==r.aggregation.source}),r&&(o.rowExpandedStates=f.getRowExpandedStates(n.grouping.groupingHeaderCache)),o},setGrouping:function(r){f.setGrouping(n,r)},groupColumn:function(r){var o=n.getColumn(r);f.groupColumn(n,o)},ungroupColumn:function(r){var o=n.getColumn(r);f.ungroupColumn(n,o)},clearGrouping:function(){f.clearGrouping(n)},aggregateColumn:function(r,o,i){var e=n.getColumn(r);f.aggregateColumn(n,e,o,i)}}}};n.api.registerEventsFromObject(o.events),n.api.registerMethodsFromObject(o.methods),n.api.core.on.sortChanged(r,f.tidyPriorities)},defaultGridOptions:function(r){r.enableGrouping=!1!==r.enableGrouping,r.groupingShowCounts=!1!==r.groupingShowCounts,r.groupingNullLabel=void 0===r.groupingNullLabel?"Null":r.groupingNullLabel,r.enableGroupHeaderSelection=!0===r.enableGroupHeaderSelection},groupingColumnBuilder:function(r,e,o){if(!1!==r.enableGrouping){void 0===e.grouping&&void 0!==r.grouping?(e.grouping=angular.copy(r.grouping),void 0!==e.grouping.groupPriority&&-1<e.grouping.groupPriority&&(e.treeAggregationFn=c.nativeAggregations()[u.aggregation.COUNT].aggregationFn,e.treeAggregationFinalizerFn=f.groupedFinalizerFn)):void 0===e.grouping&&(e.grouping={}),void 0!==e.grouping&&void 0!==e.grouping.groupPriority&&0<=e.grouping.groupPriority&&(e.suppressRemoveSort=!0);var i={name:"ui.grid.grouping.group",title:l.get().grouping.group,icon:"ui-grid-icon-indent-right",shown:function(){return void 0===this.context.col.grouping||void 0===this.context.col.grouping.groupPriority||this.context.col.grouping.groupPriority<0},action:function(){f.groupColumn(this.context.col.grid,this.context.col)}},n={name:"ui.grid.grouping.ungroup",title:l.get().grouping.ungroup,icon:"ui-grid-icon-indent-left",shown:function(){return void 0!==this.context.col.grouping&&void 0!==this.context.col.grouping.groupPriority&&0<=this.context.col.grouping.groupPriority},action:function(){f.ungroupColumn(this.context.col.grid,this.context.col)}},g={name:"ui.grid.grouping.aggregateRemove",title:l.get().grouping.aggregate_remove,shown:function(){return void 0!==this.context.col.treeAggregationFn},action:function(){f.aggregateColumn(this.context.col.grid,this.context.col,null)}},t=function(r,o){o=o||l.get().grouping["aggregate_"+r]||r;var i={name:"ui.grid.grouping.aggregate"+r,title:o,shown:function(){return void 0===this.context.col.treeAggregation||void 0===this.context.col.treeAggregation.type||this.context.col.treeAggregation.type!==r},action:function(){f.aggregateColumn(this.context.col.grid,this.context.col,r)}};a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.aggregate"+r)||e.menuItems.push(i)};!1!==e.colDef.groupingShowGroupingMenu&&(a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.group")||e.menuItems.push(i),a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.ungroup")||e.menuItems.push(n)),!1!==e.colDef.groupingShowAggregationMenu&&(angular.forEach(c.nativeAggregations(),function(r,o){t(o)}),angular.forEach(o.treeCustomAggregations,function(r,o){t(o,r.menuTitle)}),a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.aggregateRemove")||e.menuItems.push(g))}},groupingColumnProcessor:function(r,o){return r=f.moveGroupColumns(this,r,o)},groupedFinalizerFn:function(r){var o=this;void 0!==r.groupVal?(r.rendered=r.groupVal,o.grid.options.groupingShowCounts&&"date"!==o.colDef.type&&"object"!==o.colDef.type&&(r.rendered+=" ("+r.value+")")):r.rendered=null},moveGroupColumns:function(r,o){return!1===r.options.moveGroupColumns||(o.forEach(function(r,o){r.groupingPosition=o}),o.sort(function(r,o){var i,e;return i=r.isRowHeader?r.headerPriority:void 0===r.grouping||void 0===r.grouping.groupPriority||r.grouping.groupPriority<0?null:r.grouping.groupPriority,e=o.isRowHeader?o.headerPriority:void 0===o.grouping||void 0===o.grouping.groupPriority||o.grouping.groupPriority<0?null:o.grouping.groupPriority,null!==i&&null===e?-1:null!==e&&null===i?1:null!==i&&null!==e?i-e:r.groupingPosition-o.groupingPosition}),o.forEach(function(r){delete r.groupingPosition})),o},groupColumn:function(r,o){void 0===o.grouping&&(o.grouping={});var i=f.getGrouping(r);o.grouping.groupPriority=i.grouping.length,o.previousSort=angular.copy(o.sort),o.sort?void 0!==o.sort.direction&&null!==o.sort.direction||(o.sort.direction=e.ASC):o.sort={direction:e.ASC},o.treeAggregation={type:u.aggregation.COUNT,source:"grouping"},o.colDef&&angular.isFunction(o.colDef.customTreeAggregationFn)?o.treeAggregationFn=o.colDef.customTreeAggregationFn:o.treeAggregationFn=c.nativeAggregations()[u.aggregation.COUNT].aggregationFn,o.treeAggregationFinalizerFn=f.groupedFinalizerFn,r.api.grouping.raise.groupingChanged(o),r.api.core.raise.sortChanged(r,r.getColumnSorting()),r.queueGridRefresh()},ungroupColumn:function(r,o){void 0!==o.grouping&&(delete o.grouping.groupPriority,delete o.treeAggregation,delete o.customTreeAggregationFinalizer,o.previousSort&&(o.sort=o.previousSort,delete o.previousSort),f.tidyPriorities(r),r.api.grouping.raise.groupingChanged(o),r.api.core.raise.sortChanged(r,r.getColumnSorting()),r.queueGridRefresh())},aggregateColumn:function(r,o,i,e){void 0!==o.grouping&&void 0!==o.grouping.groupPriority&&0<=o.grouping.groupPriority&&f.ungroupColumn(r,o);var n={};void 0!==r.options.treeCustomAggregations[i]?n=r.options.treeCustomAggregations[i]:void 0!==c.nativeAggregations()[i]&&(n=c.nativeAggregations()[i]),o.treeAggregation={type:i,label:"string"==typeof e?e:l.get().aggregation[n.label]||n.label},o.treeAggregationFn=n.aggregationFn,o.treeAggregationFinalizerFn=n.finalizerFn,r.api.grouping.raise.aggregationChanged(o),r.queueGridRefresh()},setGrouping:function(i,r){void 0!==r&&(f.clearGrouping(i),r.grouping&&r.grouping.length&&0<r.grouping.length&&r.grouping.forEach(function(r){var o=i.getColumn(r.colName);o&&f.groupColumn(i,o)}),r.aggregations&&r.aggregations.length&&r.aggregations.forEach(function(r){var o=i.getColumn(r.colName);o&&f.aggregateColumn(i,o,r.aggregation.type)}),r.rowExpandedStates&&f.applyRowExpandedStates(i.grouping.groupingHeaderCache,r.rowExpandedStates))},clearGrouping:function(o){var r=f.getGrouping(o);0<r.grouping.length&&r.grouping.forEach(function(r){r.col||(r.col=o.getColumn(r.colName)),f.ungroupColumn(o,r.col)}),0<r.aggregations.length&&r.aggregations.forEach(function(r){r.col||(r.col=o.getColumn(r.colName)),f.aggregateColumn(o,r.col,null)})},tidyPriorities:function(r){void 0!==r&&void 0===r.grid||void 0===this.grid||(r=this.grid);var i=[],e=[];r.columns.forEach(function(r,o){void 0!==r.grouping&&void 0!==r.grouping.groupPriority&&0<=r.grouping.groupPriority?i.push(r):void 0!==r.sort&&void 0!==r.sort.priority&&0<=r.sort.priority&&e.push(r)}),i.sort(function(r,o){return r.grouping.groupPriority-o.grouping.groupPriority}),i.forEach(function(r,o){r.grouping.groupPriority=o,r.suppressRemoveSort=!0,void 0===r.sort&&(r.sort={}),r.sort.priority=o});var o=i.length;e.sort(function(r,o){return r.sort.priority-o.sort.priority}),e.forEach(function(r){r.sort.priority=o,r.suppressRemoveSort=r.colDef.suppressRemoveSort,o++})},groupRows:function(e){if(0===e.length)return e;var n=this;n.grouping.oldGroupingHeaderCache=n.grouping.groupingHeaderCache||{},n.grouping.groupingHeaderCache={};for(var g=f.initialiseProcessingState(n),r=function(r,o){var i=n.getCellValue(u,r.col);r.initialised&&0===p.getSortFn(n,r.col,e)(i,r.currentValue)||(f.insertGroupHeader(n,e,t,g,o),t++)},t=0;t<e.length;t++){var u=e[t];u.visible&&g.forEach(r)}return delete n.grouping.oldGroupingHeaderCache,e},initialiseProcessingState:function(r){var i=[];return f.getGrouping(r).grouping.forEach(function(r,o){i.push({fieldName:r.field,col:r.col,initialised:!1,currentValue:null,currentRow:null})}),i},getGrouping:function(r){var o=[],i=[];return r.columns.forEach(function(r){r.grouping&&void 0!==r.grouping.groupPriority&&0<=r.grouping.groupPriority&&o.push({field:r.field,col:r,groupPriority:r.grouping.groupPriority,grouping:r.grouping}),r.treeAggregation&&r.treeAggregation.type&&i.push({field:r.field,col:r,aggregation:r.treeAggregation})}),o.sort(function(r,o){return r.groupPriority-o.groupPriority}),o.forEach(function(r,o){r.grouping.groupPriority=o,r.groupPriority=o,delete r.grouping}),{grouping:o,aggregations:i}},insertGroupHeader:function(r,o,i,e,n){var g=e[n].col,t=r.getCellValue(o[i],g),u=t;function a(r){return angular.isObject(r)?JSON.stringify(r):r}null==t&&(u=r.options.groupingNullLabel);for(var p,l=r.grouping.oldGroupingHeaderCache,c=0;c<n;c++)l&&l[a(e[c].currentValue)]&&(l=l[a(e[c].currentValue)].children);for(l&&l[a(t)]?(p=l[a(t)].row).entity={}:(p=new s({},null,r),d.rowTemplateAssigner.call(r,p)),p.entity["$$"+e[n].col.uid]={groupVal:u},p.treeLevel=n,p.groupHeader=!0,p.internalRow=!0,p.enableCellEdit=!1,p.enableSelection=r.options.enableGroupHeaderSelection,e[n].initialised=!0,e[n].currentValue=t,e[n].currentRow=p,f.finaliseProcessingState(e,n+1),o.splice(i,0,p),l=r.grouping.groupingHeaderCache,c=0;c<n;c++)l=l[a(e[c].currentValue)].children;l[a(t)]={row:p,children:{}}},finaliseProcessingState:function(r,o){for(var i=o;i<r.length;i++)r[i].initialised=!1,r[i].currentRow=null,r[i].currentValue=null},getRowExpandedStates:function(r){if(void 0===r)return{};var i={};return angular.forEach(r,function(r,o){i[o]={state:r.row.treeNode.state},r.children?i[o].children=f.getRowExpandedStates(r.children):i[o].children={}}),i},applyRowExpandedStates:function(i,r){void 0!==r&&angular.forEach(r,function(r,o){i[o]&&(i[o].row.treeNode.state=r.state,r.children&&i[o].children&&f.applyRowExpandedStates(i[o].children,r.children))})}};return f}]),r.directive("uiGridGrouping",["uiGridGroupingConstants","uiGridGroupingService",function(r,n){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,compile:function(){return{pre:function(r,o,i,e){!1!==e.grid.options.enableGrouping&&n.initializeGrid(e.grid,r)},post:function(r,o,i,e){}}}}}])}(); | ||
!function(){"use strict";var r=angular.module("ui.grid.grouping",["ui.grid","ui.grid.treeBase"]);r.constant("uiGridGroupingConstants",{featureName:"grouping",rowHeaderColName:"treeBaseRowHeaderCol",EXPANDED:"expanded",COLLAPSED:"collapsed",aggregation:{COUNT:"count",SUM:"sum",MAX:"max",MIN:"min",AVG:"avg"}}),r.service("uiGridGroupingService",["$q","uiGridGroupingConstants","gridUtil","rowSorter","GridRow","gridClassFactory","i18nService","uiGridConstants","uiGridTreeBaseService",function(r,u,a,p,s,d,l,e,c){var f={initializeGrid:function(n,r){c.initializeGrid(n,r),n.grouping={},n.grouping.groupHeaderCache={},f.defaultGridOptions(n.options),n.registerRowsProcessor(f.groupRows,400),n.registerColumnBuilder(f.groupingColumnBuilder),n.registerColumnsProcessor(f.groupingColumnProcessor,400);var o={events:{grouping:{aggregationChanged:{},groupingChanged:{}}},methods:{grouping:{getGrouping:function(r){var o=f.getGrouping(n);return o.grouping.forEach(function(r){r.colName=r.col.name,delete r.col}),o.aggregations.forEach(function(r){r.colName=r.col.name,delete r.col}),o.aggregations=o.aggregations.filter(function(r){return!r.aggregation.source||"grouping"!==r.aggregation.source}),r&&(o.rowExpandedStates=f.getRowExpandedStates(n.grouping.groupingHeaderCache)),o},setGrouping:function(r){f.setGrouping(n,r)},groupColumn:function(r){var o=n.getColumn(r);f.groupColumn(n,o)},ungroupColumn:function(r){var o=n.getColumn(r);f.ungroupColumn(n,o)},clearGrouping:function(){f.clearGrouping(n)},aggregateColumn:function(r,o,i){var e=n.getColumn(r);f.aggregateColumn(n,e,o,i)}}}};n.api.registerEventsFromObject(o.events),n.api.registerMethodsFromObject(o.methods),n.api.core.on.sortChanged(r,f.tidyPriorities)},defaultGridOptions:function(r){r.enableGrouping=!1!==r.enableGrouping,r.groupingShowCounts=!1!==r.groupingShowCounts,r.groupingNullLabel=void 0===r.groupingNullLabel?"Null":r.groupingNullLabel,r.enableGroupHeaderSelection=!0===r.enableGroupHeaderSelection},groupingColumnBuilder:function(r,e,o){if(!1!==r.enableGrouping){void 0===e.grouping&&void 0!==r.grouping?(e.grouping=angular.copy(r.grouping),void 0!==e.grouping.groupPriority&&-1<e.grouping.groupPriority&&(e.treeAggregationFn=c.nativeAggregations()[u.aggregation.COUNT].aggregationFn,e.treeAggregationFinalizerFn=f.groupedFinalizerFn)):void 0===e.grouping&&(e.grouping={}),void 0!==e.grouping&&void 0!==e.grouping.groupPriority&&0<=e.grouping.groupPriority&&(e.suppressRemoveSort=!0);var i={name:"ui.grid.grouping.group",title:l.get().grouping.group,icon:"ui-grid-icon-indent-right",shown:function(){return void 0===this.context.col.grouping||void 0===this.context.col.grouping.groupPriority||this.context.col.grouping.groupPriority<0},action:function(){f.groupColumn(this.context.col.grid,this.context.col)}},n={name:"ui.grid.grouping.ungroup",title:l.get().grouping.ungroup,icon:"ui-grid-icon-indent-left",shown:function(){return void 0!==this.context.col.grouping&&void 0!==this.context.col.grouping.groupPriority&&0<=this.context.col.grouping.groupPriority},action:function(){f.ungroupColumn(this.context.col.grid,this.context.col)}},g={name:"ui.grid.grouping.aggregateRemove",title:l.get().grouping.aggregate_remove,shown:function(){return void 0!==this.context.col.treeAggregationFn},action:function(){f.aggregateColumn(this.context.col.grid,this.context.col,null)}},t=function(r,o){o=o||l.get().grouping["aggregate_"+r]||r;var i={name:"ui.grid.grouping.aggregate"+r,title:o,shown:function(){return void 0===this.context.col.treeAggregation||void 0===this.context.col.treeAggregation.type||this.context.col.treeAggregation.type!==r},action:function(){f.aggregateColumn(this.context.col.grid,this.context.col,r)}};a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.aggregate"+r)||e.menuItems.push(i)};!1!==e.colDef.groupingShowGroupingMenu&&(a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.group")||e.menuItems.push(i),a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.ungroup")||e.menuItems.push(n)),!1!==e.colDef.groupingShowAggregationMenu&&(angular.forEach(c.nativeAggregations(),function(r,o){t(o)}),angular.forEach(o.treeCustomAggregations,function(r,o){t(o,r.menuTitle)}),a.arrayContainsObjectWithProperty(e.menuItems,"name","ui.grid.grouping.aggregateRemove")||e.menuItems.push(g))}},groupingColumnProcessor:function(r,o){return r=f.moveGroupColumns(this,r,o)},groupedFinalizerFn:function(r){var o=this;void 0!==r.groupVal?(r.rendered=r.groupVal,o.grid.options.groupingShowCounts&&"date"!==o.colDef.type&&"object"!==o.colDef.type&&(r.rendered+=" ("+r.value+")")):r.rendered=null},moveGroupColumns:function(r,o){return!1===r.options.moveGroupColumns||(o.forEach(function(r,o){r.groupingPosition=o}),o.sort(function(r,o){var i,e;return i=r.isRowHeader?r.headerPriority:void 0===r.grouping||void 0===r.grouping.groupPriority||r.grouping.groupPriority<0?null:r.grouping.groupPriority,e=o.isRowHeader?o.headerPriority:void 0===o.grouping||void 0===o.grouping.groupPriority||o.grouping.groupPriority<0?null:o.grouping.groupPriority,null!==i&&null===e?-1:null!==e&&null===i?1:null!==i&&null!==e?i-e:r.groupingPosition-o.groupingPosition}),o.forEach(function(r){delete r.groupingPosition})),o},groupColumn:function(r,o){void 0===o.grouping&&(o.grouping={});var i=f.getGrouping(r);o.grouping.groupPriority=i.grouping.length,o.previousSort=angular.copy(o.sort),o.sort?void 0!==o.sort.direction&&null!==o.sort.direction||(o.sort.direction=e.ASC):o.sort={direction:e.ASC},o.treeAggregation={type:u.aggregation.COUNT,source:"grouping"},o.colDef&&angular.isFunction(o.colDef.customTreeAggregationFn)?o.treeAggregationFn=o.colDef.customTreeAggregationFn:o.treeAggregationFn=c.nativeAggregations()[u.aggregation.COUNT].aggregationFn,o.treeAggregationFinalizerFn=f.groupedFinalizerFn,r.api.grouping.raise.groupingChanged(o),r.api.core.raise.sortChanged(r,r.getColumnSorting()),r.queueGridRefresh()},ungroupColumn:function(r,o){void 0!==o.grouping&&(delete o.grouping.groupPriority,delete o.treeAggregation,delete o.customTreeAggregationFinalizer,o.previousSort&&(o.sort=o.previousSort,delete o.previousSort),f.tidyPriorities(r),r.api.grouping.raise.groupingChanged(o),r.api.core.raise.sortChanged(r,r.getColumnSorting()),r.queueGridRefresh())},aggregateColumn:function(r,o,i,e){void 0!==o.grouping&&void 0!==o.grouping.groupPriority&&0<=o.grouping.groupPriority&&f.ungroupColumn(r,o);var n={};void 0!==r.options.treeCustomAggregations[i]?n=r.options.treeCustomAggregations[i]:void 0!==c.nativeAggregations()[i]&&(n=c.nativeAggregations()[i]),o.treeAggregation={type:i,label:"string"==typeof e?e:l.get().aggregation[n.label]||n.label},o.treeAggregationFn=n.aggregationFn,o.treeAggregationFinalizerFn=n.finalizerFn,r.api.grouping.raise.aggregationChanged(o),r.queueGridRefresh()},setGrouping:function(i,r){void 0!==r&&(f.clearGrouping(i),r.grouping&&r.grouping.length&&0<r.grouping.length&&r.grouping.forEach(function(r){var o=i.getColumn(r.colName);o&&f.groupColumn(i,o)}),r.aggregations&&r.aggregations.length&&r.aggregations.forEach(function(r){var o=i.getColumn(r.colName);o&&f.aggregateColumn(i,o,r.aggregation.type)}),r.rowExpandedStates&&f.applyRowExpandedStates(i.grouping.groupingHeaderCache,r.rowExpandedStates))},clearGrouping:function(o){var r=f.getGrouping(o);0<r.grouping.length&&r.grouping.forEach(function(r){r.col||(r.col=o.getColumn(r.colName)),f.ungroupColumn(o,r.col)}),0<r.aggregations.length&&r.aggregations.forEach(function(r){r.col||(r.col=o.getColumn(r.colName)),f.aggregateColumn(o,r.col,null)})},tidyPriorities:function(r){void 0!==r&&void 0===r.grid||void 0===this.grid||(r=this.grid);var i=[],e=[];r.columns.forEach(function(r,o){void 0!==r.grouping&&void 0!==r.grouping.groupPriority&&0<=r.grouping.groupPriority?i.push(r):void 0!==r.sort&&void 0!==r.sort.priority&&0<=r.sort.priority&&e.push(r)}),i.sort(function(r,o){return r.grouping.groupPriority-o.grouping.groupPriority}),i.forEach(function(r,o){r.grouping.groupPriority=o,r.suppressRemoveSort=!0,void 0===r.sort&&(r.sort={}),r.sort.priority=o});var o=i.length;e.sort(function(r,o){return r.sort.priority-o.sort.priority}),e.forEach(function(r){r.sort.priority=o,r.suppressRemoveSort=r.colDef.suppressRemoveSort,o++})},groupRows:function(e){if(0===e.length)return e;var n=this;n.grouping.oldGroupingHeaderCache=n.grouping.groupingHeaderCache||{},n.grouping.groupingHeaderCache={};for(var g=f.initialiseProcessingState(n),r=function(r,o){var i=n.getCellValue(u,r.col);r.initialised&&0===p.getSortFn(r.col)(i,r.currentValue)||(f.insertGroupHeader(n,e,t,g,o),t++)},t=0;t<e.length;t++){var u=e[t];u.visible&&g.forEach(r)}return delete n.grouping.oldGroupingHeaderCache,e},initialiseProcessingState:function(r){var i=[];return f.getGrouping(r).grouping.forEach(function(r,o){i.push({fieldName:r.field,col:r.col,initialised:!1,currentValue:null,currentRow:null})}),i},getGrouping:function(r){var o=[],i=[];return r.columns.forEach(function(r){r.grouping&&void 0!==r.grouping.groupPriority&&0<=r.grouping.groupPriority&&o.push({field:r.field,col:r,groupPriority:r.grouping.groupPriority,grouping:r.grouping}),r.treeAggregation&&r.treeAggregation.type&&i.push({field:r.field,col:r,aggregation:r.treeAggregation})}),o.sort(function(r,o){return r.groupPriority-o.groupPriority}),o.forEach(function(r,o){r.grouping.groupPriority=o,r.groupPriority=o,delete r.grouping}),{grouping:o,aggregations:i}},insertGroupHeader:function(r,o,i,e,n){var g=e[n].col,t=r.getCellValue(o[i],g),u=t;function a(r){return angular.isObject(r)?JSON.stringify(r):r}null==t&&(u=r.options.groupingNullLabel);for(var p,l=r.grouping.oldGroupingHeaderCache,c=0;c<n;c++)l&&l[a(e[c].currentValue)]&&(l=l[a(e[c].currentValue)].children);for(l&&l[a(t)]?(p=l[a(t)].row).entity={}:(p=new s({},null,r),d.rowTemplateAssigner.call(r,p)),p.entity["$$"+e[n].col.uid]={groupVal:u},p.treeLevel=n,p.groupHeader=!0,p.internalRow=!0,p.enableCellEdit=!1,p.enableSelection=r.options.enableGroupHeaderSelection,e[n].initialised=!0,e[n].currentValue=t,e[n].currentRow=p,f.finaliseProcessingState(e,n+1),o.splice(i,0,p),l=r.grouping.groupingHeaderCache,c=0;c<n;c++)l=l[a(e[c].currentValue)].children;l[a(t)]={row:p,children:{}}},finaliseProcessingState:function(r,o){for(var i=o;i<r.length;i++)r[i].initialised=!1,r[i].currentRow=null,r[i].currentValue=null},getRowExpandedStates:function(r){if(void 0===r)return{};var i={};return angular.forEach(r,function(r,o){i[o]={state:r.row.treeNode.state},r.children?i[o].children=f.getRowExpandedStates(r.children):i[o].children={}}),i},applyRowExpandedStates:function(i,r){void 0!==r&&angular.forEach(r,function(r,o){i[o]&&(i[o].row.treeNode.state=r.state,r.children&&i[o].children&&f.applyRowExpandedStates(i[o].children,r.children))})}};return f}]),r.directive("uiGridGrouping",["uiGridGroupingConstants","uiGridGroupingService",function(r,n){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,compile:function(){return{pre:function(r,o,i,e){!1!==e.grid.options.enableGrouping&&n.initializeGrid(e.grid,r)},post:function(r,o,i,e){}}}}}])}(); |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -533,3 +533,3 @@ | ||
var width = gridUtil.elementWidth(e); | ||
var width = gridUtil.elementWidth(e) + 2; | ||
@@ -536,0 +536,0 @@ if (menuButton) { |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
!function(){"use strict";var e=angular.module("ui.grid.resizeColumns",["ui.grid"]);e.service("uiGridResizeColumnsService",["gridUtil","$q","$rootScope",function(r,o,t){return{defaultGridOptions:function(e){e.enableColumnResizing=!1!==e.enableColumnResizing,!1===e.enableColumnResize&&(e.enableColumnResizing=!1)},colResizerColumnBuilder:function(e,i,n){return e.enableColumnResizing=void 0===e.enableColumnResizing?n.enableColumnResizing:e.enableColumnResizing,!1===e.enableColumnResize&&(e.enableColumnResizing=!1),o.all([])},registerPublicApi:function(e){e.api.registerEventsFromObject({colResizable:{columnSizeChanged:function(e,i){}}})},fireColumnSizeChanged:function(e,i,n){t.$applyAsync(function(){e.api.colResizable?e.api.colResizable.raise.columnSizeChanged(i,n):r.logError("The resizeable api is not registered, this may indicate that you've included the module but not added the 'ui-grid-resize-columns' directive to your grid definition. Cannot raise any events.")})},findTargetCol:function(e,i,n){var r=e.getRenderContainer();if("left"!==i)return e;var o=r.visibleColumnCache.indexOf(e);return 0===o?r.visibleColumnCache[0]:r.visibleColumnCache[o-1*n]}}}]),e.directive("uiGridResizeColumns",["gridUtil","uiGridResizeColumnsService",function(e,o){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,compile:function(){return{pre:function(e,i,n,r){o.defaultGridOptions(r.grid.options),r.grid.registerColumnBuilder(o.colResizerColumnBuilder),o.registerPublicApi(r.grid)},post:function(e,i,n,r){}}}}}]),e.directive("uiGridHeaderCell",["gridUtil","$templateCache","$compile","$q","uiGridResizeColumnsService","uiGridConstants",function(e,t,d,i,c,g){return{priority:-10,require:"^uiGrid",compile:function(){return{post:function(l,u,e,i){var n=i.grid;if(n.options.enableColumnResizing){var a=t.get("ui-grid/columnResizer"),s=1;n.isRTL()&&(l.position="left",s=-1);var r=function(){for(var e=u[0].getElementsByClassName("ui-grid-column-resizer"),i=0;i<e.length;i++)angular.element(e[i]).remove();var n=c.findTargetCol(l.col,"left",s),r=l.col.getRenderContainer();if(n&&0!==r.visibleColumnCache.indexOf(l.col)&&!1!==n.colDef.enableColumnResizing){var o=angular.element(a).clone();o.attr("position","left"),u.prepend(o),d(o)(l)}if(!1!==l.col.colDef.enableColumnResizing){var t=angular.element(a).clone();t.attr("position","right"),u.append(t),d(t)(l)}};r();var o=n.registerDataChangeCallback(function(){l.$applyAsync(r)},[g.dataChange.COLUMN]);l.$on("$destroy",o)}}}}}}]),e.directive("uiGridColumnResizer",["$document","gridUtil","uiGridConstants","uiGridResizeColumnsService",function(v,h,p,z){var R=angular.element('<div class="ui-grid-resize-overlay"></div>');return{priority:0,scope:{col:"=",position:"@",renderIndex:"="},require:"?^uiGrid",link:function(u,a,e,s){var t=0,l=0,d=0,c=1;function g(e){s.grid.refreshCanvas(!0).then(function(){s.grid.queueGridRefresh()})}function f(e,i){var n=i;return e.minWidth&&n<e.minWidth?n=e.minWidth:e.maxWidth&&n>e.maxWidth&&(n=e.maxWidth),n}function n(e,i){e.originalEvent&&(e=e.originalEvent),e.preventDefault(),(l=(e.targetTouches?e.targetTouches[0]:e).clientX-d)<0?l=0:l>s.grid.gridWidth&&(l=s.grid.gridWidth);var n=z.findTargetCol(u.col,u.position,c);if(!1!==n.colDef.enableColumnResizing){s.grid.element.hasClass("column-resizing")||s.grid.element.addClass("column-resizing");var r=l-t,o=parseInt(n.drawnWidth+r*c,10);l+=(f(n,o)-o)*c,R.css({left:l+"px"}),s.fireEvent(p.events.ITEM_DRAGGING)}}function r(e){e.originalEvent&&(e=e.originalEvent),e.preventDefault(),s.grid.element.removeClass("column-resizing"),R.remove();var i=(l=(e.changedTouches?e.changedTouches[0]:e).clientX-d)-t;if(0===i)return C(),void m();var n=z.findTargetCol(u.col,u.position,c);if(!1!==n.colDef.enableColumnResizing){var r=parseInt(n.drawnWidth+i*c,10);n.width=f(n,r),n.hasCustomWidth=!0,g(),z.fireColumnSizeChanged(s.grid,n.colDef,i),C(),m()}}s.grid.isRTL()&&(u.position="left",c=-1),"left"===u.position?a.addClass("left"):"right"===u.position&&a.addClass("right");var o=function(e,i){e.originalEvent&&(e=e.originalEvent),e.stopPropagation(),d=s.grid.element[0].getBoundingClientRect().left,t=(e.targetTouches?e.targetTouches[0]:e).clientX-d,s.grid.element.append(R),R.css({left:t}),"touchstart"===e.type?(v.on("touchend",r),v.on("touchmove",n),a.off("mousedown",o)):(v.on("mouseup",r),v.on("mousemove",n),a.off("touchstart",o))},m=function(){a.on("mousedown",o),a.on("touchstart",o)},C=function(){v.off("mouseup",r),v.off("touchend",r),v.off("mousemove",n),v.off("touchmove",n),a.off("mousedown",o),a.off("touchstart",o)};m();var i=function(e,i){e.stopPropagation();var n=z.findTargetCol(u.col,u.position,c);if(!1!==n.colDef.enableColumnResizing){var o=0,r=h.closestElm(a,".ui-grid-render-container").querySelectorAll("."+p.COL_CLASS_PREFIX+n.uid+" .ui-grid-cell-contents");Array.prototype.forEach.call(r,function(e){var r;angular.element(e).parent().hasClass("ui-grid-header-cell")&&(r=angular.element(e).parent()[0].querySelectorAll(".ui-grid-column-menu-button")),h.fakeElement(e,{},function(e){var i=angular.element(e);i.attr("style","float: left");var n=h.elementWidth(i);r&&(n+=h.elementWidth(r));o<n&&(o=n)})});var t=f(n,o),l=t-n.drawnWidth;n.width=t,n.hasCustomWidth=!0,g(),z.fireColumnSizeChanged(s.grid,n.colDef,l)}};a.on("dblclick",i),a.on("$destroy",function(){a.off("dblclick",i),C()})}}}])}(),angular.module("ui.grid.resizeColumns").run(["$templateCache",function(e){"use strict";e.put("ui-grid/columnResizer",'<div ui-grid-column-resizer ng-if="grid.options.enableColumnResizing" class="ui-grid-column-resizer" col="col" position="right" render-index="renderIndex" unselectable="on"></div>')}]); | ||
!function(){"use strict";var e=angular.module("ui.grid.resizeColumns",["ui.grid"]);e.service("uiGridResizeColumnsService",["gridUtil","$q","$rootScope",function(r,o,t){return{defaultGridOptions:function(e){e.enableColumnResizing=!1!==e.enableColumnResizing,!1===e.enableColumnResize&&(e.enableColumnResizing=!1)},colResizerColumnBuilder:function(e,i,n){return e.enableColumnResizing=void 0===e.enableColumnResizing?n.enableColumnResizing:e.enableColumnResizing,!1===e.enableColumnResize&&(e.enableColumnResizing=!1),o.all([])},registerPublicApi:function(e){e.api.registerEventsFromObject({colResizable:{columnSizeChanged:function(e,i){}}})},fireColumnSizeChanged:function(e,i,n){t.$applyAsync(function(){e.api.colResizable?e.api.colResizable.raise.columnSizeChanged(i,n):r.logError("The resizeable api is not registered, this may indicate that you've included the module but not added the 'ui-grid-resize-columns' directive to your grid definition. Cannot raise any events.")})},findTargetCol:function(e,i,n){var r=e.getRenderContainer();if("left"!==i)return e;var o=r.visibleColumnCache.indexOf(e);return 0===o?r.visibleColumnCache[0]:r.visibleColumnCache[o-1*n]}}}]),e.directive("uiGridResizeColumns",["gridUtil","uiGridResizeColumnsService",function(e,o){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,compile:function(){return{pre:function(e,i,n,r){o.defaultGridOptions(r.grid.options),r.grid.registerColumnBuilder(o.colResizerColumnBuilder),o.registerPublicApi(r.grid)},post:function(e,i,n,r){}}}}}]),e.directive("uiGridHeaderCell",["gridUtil","$templateCache","$compile","$q","uiGridResizeColumnsService","uiGridConstants",function(e,t,d,i,c,g){return{priority:-10,require:"^uiGrid",compile:function(){return{post:function(l,u,e,i){var n=i.grid;if(n.options.enableColumnResizing){var a=t.get("ui-grid/columnResizer"),s=1;n.isRTL()&&(l.position="left",s=-1);var r=function(){for(var e=u[0].getElementsByClassName("ui-grid-column-resizer"),i=0;i<e.length;i++)angular.element(e[i]).remove();var n=c.findTargetCol(l.col,"left",s),r=l.col.getRenderContainer();if(n&&0!==r.visibleColumnCache.indexOf(l.col)&&!1!==n.colDef.enableColumnResizing){var o=angular.element(a).clone();o.attr("position","left"),u.prepend(o),d(o)(l)}if(!1!==l.col.colDef.enableColumnResizing){var t=angular.element(a).clone();t.attr("position","right"),u.append(t),d(t)(l)}};r();var o=n.registerDataChangeCallback(function(){l.$applyAsync(r)},[g.dataChange.COLUMN]);l.$on("$destroy",o)}}}}}}]),e.directive("uiGridColumnResizer",["$document","gridUtil","uiGridConstants","uiGridResizeColumnsService",function(v,h,p,z){var R=angular.element('<div class="ui-grid-resize-overlay"></div>');return{priority:0,scope:{col:"=",position:"@",renderIndex:"="},require:"?^uiGrid",link:function(u,a,e,s){var t=0,l=0,d=0,c=1;function g(e){s.grid.refreshCanvas(!0).then(function(){s.grid.queueGridRefresh()})}function f(e,i){var n=i;return e.minWidth&&n<e.minWidth?n=e.minWidth:e.maxWidth&&n>e.maxWidth&&(n=e.maxWidth),n}function n(e,i){e.originalEvent&&(e=e.originalEvent),e.preventDefault(),(l=(e.targetTouches?e.targetTouches[0]:e).clientX-d)<0?l=0:l>s.grid.gridWidth&&(l=s.grid.gridWidth);var n=z.findTargetCol(u.col,u.position,c);if(!1!==n.colDef.enableColumnResizing){s.grid.element.hasClass("column-resizing")||s.grid.element.addClass("column-resizing");var r=l-t,o=parseInt(n.drawnWidth+r*c,10);l+=(f(n,o)-o)*c,R.css({left:l+"px"}),s.fireEvent(p.events.ITEM_DRAGGING)}}function r(e){e.originalEvent&&(e=e.originalEvent),e.preventDefault(),s.grid.element.removeClass("column-resizing"),R.remove();var i=(l=(e.changedTouches?e.changedTouches[0]:e).clientX-d)-t;if(0===i)return C(),void m();var n=z.findTargetCol(u.col,u.position,c);if(!1!==n.colDef.enableColumnResizing){var r=parseInt(n.drawnWidth+i*c,10);n.width=f(n,r),n.hasCustomWidth=!0,g(),z.fireColumnSizeChanged(s.grid,n.colDef,i),C(),m()}}s.grid.isRTL()&&(u.position="left",c=-1),"left"===u.position?a.addClass("left"):"right"===u.position&&a.addClass("right");var o=function(e,i){e.originalEvent&&(e=e.originalEvent),e.stopPropagation(),d=s.grid.element[0].getBoundingClientRect().left,t=(e.targetTouches?e.targetTouches[0]:e).clientX-d,s.grid.element.append(R),R.css({left:t}),"touchstart"===e.type?(v.on("touchend",r),v.on("touchmove",n),a.off("mousedown",o)):(v.on("mouseup",r),v.on("mousemove",n),a.off("touchstart",o))},m=function(){a.on("mousedown",o),a.on("touchstart",o)},C=function(){v.off("mouseup",r),v.off("touchend",r),v.off("mousemove",n),v.off("touchmove",n),a.off("mousedown",o),a.off("touchstart",o)};m();var i=function(e,i){e.stopPropagation();var n=z.findTargetCol(u.col,u.position,c);if(!1!==n.colDef.enableColumnResizing){var o=0,r=h.closestElm(a,".ui-grid-render-container").querySelectorAll("."+p.COL_CLASS_PREFIX+n.uid+" .ui-grid-cell-contents");Array.prototype.forEach.call(r,function(e){var r;angular.element(e).parent().hasClass("ui-grid-header-cell")&&(r=angular.element(e).parent()[0].querySelectorAll(".ui-grid-column-menu-button")),h.fakeElement(e,{},function(e){var i=angular.element(e);i.attr("style","float: left");var n=h.elementWidth(i)+2;r&&(n+=h.elementWidth(r));o<n&&(o=n)})});var t=f(n,o),l=t-n.drawnWidth;n.width=t,n.hasCustomWidth=!0,g(),z.fireColumnSizeChanged(s.grid,n.colDef,l)}};a.on("dblclick",i),a.on("$destroy",function(){a.off("dblclick",i),C()})}}}])}(),angular.module("ui.grid.resizeColumns").run(["$templateCache",function(e){"use strict";e.put("ui-grid/columnResizer",'<div ui-grid-column-resizer ng-if="grid.options.enableColumnResizing" class="ui-grid-column-resizer" col="col" position="right" render-index="renderIndex" unselectable="on"></div>')}]); |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -209,4 +209,4 @@ | ||
var row = grid.getRow(rowEntity); | ||
if (row !== null) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect); | ||
if (row != void 0 && row !== null) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect, true); | ||
} | ||
@@ -224,4 +224,4 @@ }, | ||
var row = grid.getRow(rowEntity); | ||
if (row !== null && !row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect); | ||
if (row != void 0 && row !== null && !row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect, true); | ||
} | ||
@@ -242,4 +242,4 @@ }, | ||
var row = grid.renderContainers.body.visibleRowCache[rowNum]; | ||
if (row !== null && typeof (row) !== 'undefined' && !row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect); | ||
if (row != void 0 && row !== null && typeof (row) !== 'undefined' && !row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect, false); | ||
} | ||
@@ -249,2 +249,19 @@ }, | ||
* @ngdoc function | ||
* @name selectRowByKey | ||
* @methodOf ui.grid.selection.api:PublicApi | ||
* @description Select the data row | ||
* @param {boolean} isInEntity if true then key is in entity else it's directly in row | ||
* @param {Symbol} key the key to look for | ||
* @param {any} comparator the value that key should have | ||
* @param {Event} evt object if raised from an event | ||
* @param {array} lookInRows [optional] the rows to look in - if not provided then looks in grid.rows | ||
*/ | ||
selectRowByKey: function (isInEntity, key, comparator, evt, lookInRows) { | ||
var row = grid.findRowByKey(isInEntity, key, comparator, lookInRows); | ||
if (row != void 0 && row !== null && typeof (row) !== 'undefined' && !row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect, false); | ||
} | ||
}, | ||
/** | ||
* @ngdoc function | ||
* @name unSelectRow | ||
@@ -258,4 +275,4 @@ * @methodOf ui.grid.selection.api:PublicApi | ||
var row = grid.getRow(rowEntity); | ||
if (row !== null && row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect); | ||
if (row != void 0 && row !== null && row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect, true); | ||
} | ||
@@ -276,4 +293,4 @@ }, | ||
var row = grid.renderContainers.body.visibleRowCache[rowNum]; | ||
if (row !== null && typeof (row) !== 'undefined' && row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect); | ||
if (row != void 0 && row !== null && typeof (row) !== 'undefined' && row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect, false); | ||
} | ||
@@ -283,2 +300,19 @@ }, | ||
* @ngdoc function | ||
* @name unSelectRowByKey | ||
* @methodOf ui.grid.selection.api:PublicApi | ||
* @description Select the data row | ||
* @param {boolean} isInEntity if true then key is in entity else it's directly in row | ||
* @param {(string|number)} key the key to look for | ||
* @param {any} comparator the value that key should have | ||
* @param {Event} evt object if raised from an event | ||
* @param {array} lookInRows [optional] the rows to look in - if not provided then looks in grid.rows | ||
*/ | ||
unSelectRowByKey: function (isInEntity, key, comparator, evt, lookInRows) { | ||
var row = grid.findRowByKey(isInEntity, key, comparator, lookInRows); | ||
if (row != void 0 && row !== null && typeof (row) !== 'undefined' && row.isSelected) { | ||
service.toggleRowSelection(grid, row, evt, grid.options.multiSelect, grid.options.noUnselect, false); | ||
} | ||
}, | ||
/** | ||
* @ngdoc function | ||
* @name selectAllRows | ||
@@ -341,13 +375,18 @@ * @methodOf ui.grid.selection.api:PublicApi | ||
* @methodOf ui.grid.selection.api:PublicApi | ||
* @description returns all selectedRow's entity references | ||
* @description returns all selected Row's entity references | ||
*/ | ||
getSelectedRows: function () { | ||
return service.getSelectedRows(grid).map(function (gridRow) { | ||
return gridRow.entity; | ||
}).filter(function (entity) { | ||
return entity.hasOwnProperty('$$hashKey') || !angular.isObject(entity); | ||
}); | ||
return service.mapAndFilterRowsByEntity(service.getSelectedRows(grid)); | ||
}, | ||
/** | ||
* @ngdoc function | ||
* @name getUnSelectedRows | ||
* @methodOf ui.grid.selection.api:PublicApi | ||
* @description returns all unselected Row's entity references | ||
*/ | ||
getUnSelectedRows: function () { | ||
return service.mapAndFilterRowsByEntity(service.getUnSelectedRows(grid)); | ||
}, | ||
/** | ||
* @ngdoc function | ||
* @name getSelectedGridRows | ||
@@ -362,2 +401,11 @@ * @methodOf ui.grid.selection.api:PublicApi | ||
* @ngdoc function | ||
* @name getSelectedGridRows | ||
* @methodOf ui.grid.selection.api:PublicApi | ||
* @description returns all unselected Row's as gridRows | ||
*/ | ||
getUnSelectedGridRows: function () { | ||
return service.getUnSelectedRows(grid); | ||
}, | ||
/** | ||
* @ngdoc function | ||
* @name getSelectedCount | ||
@@ -548,4 +596,5 @@ * @methodOf ui.grid.selection.api:PublicApi | ||
* @param {bool} noUnselect if true then rows cannot be unselected | ||
* @param {bool} [canBeInvisible=true] if false, row can only be selected when it's (theoretically) visible | ||
*/ | ||
toggleRowSelection: function (grid, row, evt, multiSelect, noUnselect) { | ||
toggleRowSelection: function (grid, row, evt, multiSelect, noUnselect, canBeInvisible) { | ||
if ( row.enableSelection === false ) { | ||
@@ -555,5 +604,8 @@ return; | ||
var selected = row.isSelected, | ||
selectedRows; | ||
if (canBeInvisible === void 0) { | ||
canBeInvisible = true; | ||
} | ||
var selected = row.isSelected; | ||
if (!multiSelect) { | ||
@@ -563,8 +615,5 @@ if (!selected) { | ||
} | ||
else { | ||
selectedRows = service.getSelectedRows(grid); | ||
if (selectedRows.length > 1) { | ||
selected = false; // Enable reselect of the row | ||
service.clearSelectedRows(grid, evt); | ||
} | ||
else if (service.getSelectedRows(grid).length > 1) { | ||
selected = false; // Enable reselect of the row | ||
service.clearSelectedRows(grid, evt); | ||
} | ||
@@ -574,3 +623,3 @@ } | ||
// only select row in this case | ||
if (!(selected && noUnselect)) { | ||
if (!(selected && noUnselect) && (canBeInvisible || row.visible)) { | ||
row.setSelected(!selected); | ||
@@ -581,5 +630,3 @@ if (row.isSelected === true) { | ||
selectedRows = service.getSelectedRows(grid); | ||
grid.selection.selectAll = grid.rows.length === selectedRows.length; | ||
grid.selection.selectAll = grid.rows.length === service.getSelectedRows(grid).length; | ||
grid.api.selection.raise.rowSelectionChanged(row, evt); | ||
@@ -637,3 +684,37 @@ } | ||
}, | ||
/** | ||
* @ngdoc function | ||
* @name getUnSelectedRows | ||
* @methodOf ui.grid.selection.service:uiGridSelectionService | ||
* @description Returns all the unselected rows | ||
* @param {Grid} grid grid object | ||
*/ | ||
getUnSelectedRows: function (grid) { | ||
return grid.rows.filter(function (row) { | ||
return !row.isSelected; | ||
}); | ||
}, | ||
/** | ||
* @ngdoc function | ||
* @name mapAndFilterRowsByEntity | ||
* @methodOf ui.grid.selection.service:uiGridSelectionService | ||
* @description Filters all rows by entity and then maps them to Array. | ||
*/ | ||
mapAndFilterRowsByEntity: function(gridRows) { | ||
if (typeof gridRows.reduce === 'function') { // If reduce is available it will be taken, due to better performance | ||
return gridRows.reduce(function (previousVal, currentRow) { | ||
if (currentRow.entity.hasOwnProperty('$$hashKey') || !angular.isObject(currentRow.entity)) { | ||
previousVal.push(currentRow.entity); | ||
} | ||
return previousVal; | ||
}, []); | ||
} | ||
return gridRows.filter(function (gridRow) { // stays as polyfill | ||
return gridRow.entity.hasOwnProperty('$$hashKey') || !angular.isObject(gridRow.entity); | ||
}).map(function (gridRow) { | ||
return gridRow.entity; | ||
}); | ||
}, | ||
/** | ||
@@ -650,3 +731,3 @@ * @ngdoc function | ||
service.getSelectedRows(grid).forEach(function (row) { | ||
if (row.isSelected && row.enableSelection !== false && grid.options.isRowSelectable(row) !== false) { | ||
if (row.isSelected && row.enableSelection !== false) { | ||
row.setSelected(false); | ||
@@ -826,8 +907,8 @@ service.decideRaiseSelectionEvent(grid, row, changedRows, evt); | ||
uiGridSelectionService.toggleRowSelection(self, row, evt, | ||
self.options.multiSelect, self.options.noUnselect); | ||
self.options.multiSelect, self.options.noUnselect, false); | ||
} | ||
else if (row.groupHeader) { | ||
uiGridSelectionService.toggleRowSelection(self, row, evt, self.options.multiSelect, self.options.noUnselect); | ||
uiGridSelectionService.toggleRowSelection(self, row, evt, self.options.multiSelect, self.options.noUnselect, false); | ||
for (var i = 0; i < row.treeNode.children.length; i++) { | ||
uiGridSelectionService.toggleRowSelection(self, row.treeNode.children[i].row, evt, self.options.multiSelect, self.options.noUnselect); | ||
uiGridSelectionService.toggleRowSelection(self, row.treeNode.children[i].row, evt, self.options.multiSelect, self.options.noUnselect, false); | ||
} | ||
@@ -837,3 +918,3 @@ } | ||
uiGridSelectionService.toggleRowSelection(self, row, evt, | ||
(self.options.multiSelect && !self.options.modifierKeysToMultiSelect), self.options.noUnselect); | ||
(self.options.multiSelect && !self.options.modifierKeysToMultiSelect), self.options.noUnselect, false); | ||
} | ||
@@ -959,3 +1040,3 @@ self.options.enableFocusRowOnRowHeaderClick && row.setFocused(!row.isFocused) && self.api.selection.raise.rowFocusChanged(row, evt); | ||
($scope.grid.options.multiSelect && !$scope.grid.options.modifierKeysToMultiSelect), | ||
$scope.grid.options.noUnselect); | ||
$scope.grid.options.noUnselect, false); | ||
$scope.$apply(); | ||
@@ -980,3 +1061,3 @@ } | ||
uiGridSelectionService.toggleRowSelection($scope.grid, $scope.row, evt, | ||
$scope.grid.options.multiSelect, $scope.grid.options.noUnselect); | ||
$scope.grid.options.multiSelect, $scope.grid.options.noUnselect, false); | ||
} | ||
@@ -986,3 +1067,3 @@ else if ($scope.grid.options.enableSelectRowOnFocus) { | ||
($scope.grid.options.multiSelect && !$scope.grid.options.modifierKeysToMultiSelect), | ||
$scope.grid.options.noUnselect); | ||
$scope.grid.options.noUnselect, false); | ||
} | ||
@@ -989,0 +1070,0 @@ $scope.row.setFocused(!$scope.row.isFocused); |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
!function(){"use strict";var e=angular.module("ui.grid.selection",["ui.grid"]);e.constant("uiGridSelectionConstants",{featureName:"selection",selectionRowHeaderColName:"selectionRowHeaderCol"}),angular.module("ui.grid").config(["$provide",function(e){e.decorator("GridRow",["$delegate",function(e){return e.prototype.setSelected=function(e){e!==this.isSelected&&(this.isSelected=e,this.grid.selection.selectedCount+=e?1:-1)},e.prototype.setFocused=function(e){e!==this.isFocused&&(this.grid.selection.focusedRow&&(this.grid.selection.focusedRow.isFocused=!1),this.grid.selection.focusedRow=e?this:null,this.isFocused=e)},e}])}]),e.service("uiGridSelectionService",function(){var a={initializeGrid:function(o){o.selection={lastSelectedRow:null,focusedRow:null,selectAll:!1},o.selection.selectedCount=0,a.defaultGridOptions(o.options);var e={events:{selection:{rowFocusChanged:function(e,t,i){},rowSelectionChanged:function(e,t,i){},rowSelectionChangedBatch:function(e,t,i){}}},methods:{selection:{toggleRowSelection:function(e,t){var i=o.getRow(e);null!==i&&a.toggleRowSelection(o,i,t,o.options.multiSelect,o.options.noUnselect)},selectRow:function(e,t){var i=o.getRow(e);null===i||i.isSelected||a.toggleRowSelection(o,i,t,o.options.multiSelect,o.options.noUnselect)},selectRowByVisibleIndex:function(e,t){var i=o.renderContainers.body.visibleRowCache[e];null==i||i.isSelected||a.toggleRowSelection(o,i,t,o.options.multiSelect,o.options.noUnselect)},unSelectRow:function(e,t){var i=o.getRow(e);null!==i&&i.isSelected&&a.toggleRowSelection(o,i,t,o.options.multiSelect,o.options.noUnselect)},unSelectRowByVisibleIndex:function(e,t){var i=o.renderContainers.body.visibleRowCache[e];null!=i&&i.isSelected&&a.toggleRowSelection(o,i,t,o.options.multiSelect,o.options.noUnselect)},selectAllRows:function(t){if(!1!==o.options.multiSelect){var i=[];o.rows.forEach(function(e){e.isSelected||!1===e.enableSelection||!1===o.options.isRowSelectable(e)||(e.setSelected(!0),a.decideRaiseSelectionEvent(o,e,i,t))}),o.selection.selectAll=!0,a.decideRaiseSelectionBatchEvent(o,i,t)}},selectAllVisibleRows:function(t){if(!1!==o.options.multiSelect){var i=[];o.rows.forEach(function(e){e.visible?e.isSelected||!1===e.enableSelection||!1===o.options.isRowSelectable(e)||(e.setSelected(!0),a.decideRaiseSelectionEvent(o,e,i,t)):e.isSelected&&(e.setSelected(!1),a.decideRaiseSelectionEvent(o,e,i,t))}),o.selection.selectAll=!0,a.decideRaiseSelectionBatchEvent(o,i,t)}},clearSelectedRows:function(e){a.clearSelectedRows(o,e)},getSelectedRows:function(){return a.getSelectedRows(o).map(function(e){return e.entity}).filter(function(e){return e.hasOwnProperty("$$hashKey")||!angular.isObject(e)})},getSelectedGridRows:function(){return a.getSelectedRows(o)},getSelectedCount:function(){return o.selection.selectedCount},setMultiSelect:function(e){o.options.multiSelect=e},setModifierKeysToMultiSelect:function(e){o.options.modifierKeysToMultiSelect=e},getSelectAllState:function(){return o.selection.selectAll}}}};o.api.registerEventsFromObject(e.events),o.api.registerMethodsFromObject(e.methods)},defaultGridOptions:function(e){e.enableRowSelection=!1!==e.enableRowSelection,e.multiSelect=!1!==e.multiSelect,e.noUnselect=!0===e.noUnselect,e.modifierKeysToMultiSelect=!0===e.modifierKeysToMultiSelect,e.enableRowHeaderSelection=!1!==e.enableRowHeaderSelection,void 0===e.enableFullRowSelection&&(e.enableFullRowSelection=!e.enableRowHeaderSelection),e.enableFocusRowOnRowHeaderClick=!1!==e.enableFocusRowOnRowHeaderClick||!e.enableRowHeaderSelection,e.enableSelectRowOnFocus=!1!==e.enableSelectRowOnFocus,e.enableSelectAll=!1!==e.enableSelectAll,e.enableSelectionBatchEvent=!1!==e.enableSelectionBatchEvent,e.selectionRowHeaderWidth=angular.isDefined(e.selectionRowHeaderWidth)?e.selectionRowHeaderWidth:30,e.enableFooterTotalSelected=!1!==e.enableFooterTotalSelected,e.isRowSelectable=angular.isDefined(e.isRowSelectable)?e.isRowSelectable:angular.noop},toggleRowSelection:function(e,t,i,o,n){if(!1!==t.enableSelection){var l,c=t.isSelected;o||(c?1<(l=a.getSelectedRows(e)).length&&(c=!1,a.clearSelectedRows(e,i)):a.clearSelectedRows(e,i)),c&&n||(t.setSelected(!c),!0===t.isSelected&&(e.selection.lastSelectedRow=t),l=a.getSelectedRows(e),e.selection.selectAll=e.rows.length===l.length,e.api.selection.raise.rowSelectionChanged(t,i))}},shiftSelect:function(e,t,i,o){if(o){var n=0<a.getSelectedRows(e).length?e.renderContainers.body.visibleRowCache.indexOf(e.selection.lastSelectedRow):0,l=e.renderContainers.body.visibleRowCache.indexOf(t);if(l<n){var c=n;n=l,l=c}for(var s=[],r=n;r<=l;r++){var d=e.renderContainers.body.visibleRowCache[r];d&&(d.isSelected||!1===d.enableSelection||(d.setSelected(!0),e.selection.lastSelectedRow=d,a.decideRaiseSelectionEvent(e,d,s,i)))}a.decideRaiseSelectionBatchEvent(e,s,i)}},getSelectedRows:function(e){return e.rows.filter(function(e){return e.isSelected})},clearSelectedRows:function(t,i){var o=[];a.getSelectedRows(t).forEach(function(e){e.isSelected&&!1!==e.enableSelection&&!1!==t.options.isRowSelectable(e)&&(e.setSelected(!1),a.decideRaiseSelectionEvent(t,e,o,i))}),t.selection.selectAll=!1,t.selection.selectedCount=0,a.decideRaiseSelectionBatchEvent(t,o,i)},decideRaiseSelectionEvent:function(e,t,i,o){e.options.enableSelectionBatchEvent?i.push(t):e.api.selection.raise.rowSelectionChanged(t,o)},decideRaiseSelectionBatchEvent:function(e,t,i){0<t.length&&e.api.selection.raise.rowSelectionChangedBatch(t,i)}};return a}),e.directive("uiGridSelection",["i18nService","uiGridSelectionConstants","uiGridSelectionService","uiGridConstants",function(d,a,u,g){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,compile:function(){return{pre:function(e,t,i,o){if(u.initializeGrid(o.grid),o.grid.options.enableRowHeaderSelection){var n={name:a.selectionRowHeaderColName,displayName:d.getSafeText("selection.displayName"),width:o.grid.options.selectionRowHeaderWidth,minWidth:10,cellTemplate:"ui-grid/selectionRowHeader",headerCellTemplate:"ui-grid/selectionHeaderCell",enableColumnResizing:!1,enableColumnMenu:!1,exporterSuppressExport:!0,allowCellFocus:!0};o.grid.addRowHeaderColumn(n,0)}var l=!1,c=function(e){return e.forEach(function(e){e.enableSelection=o.grid.options.isRowSelectable(e)}),e},s=function(){o.grid.options.isRowSelectable!==angular.noop&&!0!==l&&(o.grid.registerRowsProcessor(c,500),l=!0)};s();var r=o.grid.registerDataChangeCallback(s,[g.dataChange.OPTIONS]);e.$on("$destroy",r)},post:function(e,t,i,o){}}}}}]),e.directive("uiGridSelectionRowHeaderButtons",["$templateCache","uiGridSelectionService","gridUtil",function(e,c,s){return{replace:!0,restrict:"E",template:e.get("ui-grid/selectionRowHeaderButtons"),scope:!0,require:"^uiGrid",link:function(e,t,i,o){var n=o.grid;function l(e,t){if(t.stopPropagation(),t.shiftKey)c.shiftSelect(n,e,t,n.options.multiSelect);else if(t.ctrlKey||t.metaKey)c.toggleRowSelection(n,e,t,n.options.multiSelect,n.options.noUnselect);else if(e.groupHeader){c.toggleRowSelection(n,e,t,n.options.multiSelect,n.options.noUnselect);for(var i=0;i<e.treeNode.children.length;i++)c.toggleRowSelection(n,e.treeNode.children[i].row,t,n.options.multiSelect,n.options.noUnselect)}else c.toggleRowSelection(n,e,t,n.options.multiSelect&&!n.options.modifierKeysToMultiSelect,n.options.noUnselect);n.options.enableFocusRowOnRowHeaderClick&&e.setFocused(!e.isFocused)&&n.api.selection.raise.rowFocusChanged(e,t)}e.selectButtonClick=l,e.selectButtonKeyDown=function(e,t){32!==t.keyCode&&13!==t.keyCode||(t.preventDefault(),l(e,t))},"ie"===s.detectBrowser()&&t.on("mousedown",function(e){(e.ctrlKey||e.shiftKey)&&(e.target.onselectstart=function(){return!1},window.setTimeout(function(){e.target.onselectstart=null},0))}),e.$on("$destroy",function(){t.off()})}}}]),e.directive("uiGridSelectionSelectAllButtons",["$templateCache","uiGridSelectionService",function(e,o){return{replace:!0,restrict:"E",template:e.get("ui-grid/selectionSelectAllButtons"),scope:!1,link:function(t){var i=t.col.grid;t.headerButtonKeyDown=function(e){32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),t.headerButtonClick(e))},t.headerButtonClick=function(e){i.selection.selectAll?(o.clearSelectedRows(i,e),i.options.noUnselect&&i.api.selection.selectRowByVisibleIndex(0,e),i.selection.selectAll=!1):i.options.multiSelect&&(i.api.selection.selectAllVisibleRows(e),i.selection.selectAll=!0)}}}}]),e.directive("uiGridViewport",function(){return{priority:-200,scope:!1,compile:function(e){var t=angular.element(e[0].querySelector(".ui-grid-canvas:not(.ui-grid-empty-base-layer-container)").children[0]),i="'ui-grid-row-selected': row.isSelected, 'ui-grid-row-focused': row.isFocused}",o=t.attr("ng-class");return i=o?o.slice(0,-1)+","+i:"{"+i,t.attr("ng-class",i),{pre:function(e,t,i,o){},post:function(e,t,i,o){}}}}}),e.directive("uiGridCell",["uiGridConstants","uiGridSelectionService",function(u,g){return{priority:-200,restrict:"A",require:"?^uiGrid",scope:!1,link:function(i,c,e,t){var s=0,r={};t.grid.api.cellNav&&t.grid.api.cellNav.on.viewPortKeyDown(i,function(e,t){null!==t&&t.row===i.row&&t.col===i.col&&e.keyCode===u.keymap.SPACE&&"selectionRowHeaderCol"===i.col.colDef.name&&(e.preventDefault(),g.toggleRowSelection(i.grid,i.row,e,i.grid.options.multiSelect&&!i.grid.options.modifierKeysToMultiSelect,i.grid.options.noUnselect),i.$apply())});var d=function(e){"ui-grid-icon-minus-squared"!==e.target.className&&"ui-grid-icon-plus-squared"!==e.target.className&&(c.off("touchend",n),e.shiftKey?g.shiftSelect(i.grid,i.row,e,i.grid.options.multiSelect):e.ctrlKey||e.metaKey?g.toggleRowSelection(i.grid,i.row,e,i.grid.options.multiSelect,i.grid.options.noUnselect):i.grid.options.enableSelectRowOnFocus&&g.toggleRowSelection(i.grid,i.row,e,i.grid.options.multiSelect&&!i.grid.options.modifierKeysToMultiSelect,i.grid.options.noUnselect),i.row.setFocused(!i.row.isFocused),i.grid.api.selection.raise.rowFocusChanged(i.row,e),i.$apply(),window.setTimeout(function(){c.on("touchend",n)},300))},o=function(e){s=(new Date).getTime(),r=e.changedTouches[0],c.off("click",d)},n=function(e){var t=(new Date).getTime(),i=e.changedTouches[0],o=t-s,n=Math.abs(r.clientX-i.clientX),l=Math.abs(r.clientY-i.clientY);n<100&&l<100&&o<300&&d(e),window.setTimeout(function(){c.on("click",d)},300)};function l(){i.grid.options.enableRowSelection&&i.grid.options.enableFullRowSelection&&"selectionRowHeaderCol"!==i.col.colDef.name&&(c.addClass("ui-grid-disable-selection"),c.on("touchstart",o),c.on("touchend",n),c.on("click",d),i.registered=!0)}l();var a=i.grid.registerDataChangeCallback(function(){i.grid.options.enableRowSelection&&i.grid.options.enableFullRowSelection&&!i.registered?l():i.grid.options.enableRowSelection&&i.grid.options.enableFullRowSelection||!i.registered||i.registered&&(c.removeClass("ui-grid-disable-selection"),c.off("touchstart",o),c.off("touchend",n),c.off("click",d),i.registered=!1)},[u.dataChange.OPTIONS]);c.on("$destroy",a)}}}]),e.directive("uiGridGridFooter",["$compile","gridUtil",function(l,i){return{restrict:"EA",replace:!0,priority:-1e3,require:"^uiGrid",scope:!0,compile:function(){return{pre:function(o,n,e,t){t.grid.options.showGridFooter&&i.getTemplate("ui-grid/gridFooterSelectedItems").then(function(e){var t=angular.element(e),i=l(t)(o);angular.element(n[0].getElementsByClassName("ui-grid-grid-footer")[0]).append(i)})},post:function(e,t,i,o){}}}}}])}(),angular.module("ui.grid.selection").run(["$templateCache",function(e){"use strict";e.put("ui-grid/gridFooterSelectedItems",'<span ng-if="grid.selection.selectedCount !== 0 && grid.options.enableFooterTotalSelected">({{"search.selectedItems" | t}} {{grid.selection.selectedCount}})</span>'),e.put("ui-grid/selectionHeaderCell",'<div>\x3c!-- <div class="ui-grid-vertical-bar"> </div> --\x3e<div class="ui-grid-cell-contents" col-index="renderIndex"><ui-grid-selection-select-all-buttons ng-if="grid.options.enableSelectAll" role="checkbox" ng-model="grid.selection.selectAll"></ui-grid-selection-select-all-buttons></div></div>'),e.put("ui-grid/selectionRowHeader",'<div class="ui-grid-cell-contents ui-grid-disable-selection clickable"><ui-grid-selection-row-header-buttons></ui-grid-selection-row-header-buttons></div>'),e.put("ui-grid/selectionRowHeaderButtons",'<div class="ui-grid-selection-row-header-buttons ui-grid-icon-ok clickable" ng-class="{\'ui-grid-row-selected\': row.isSelected}" tabindex="0" ng-click="selectButtonClick(row, $event)" ng-keydown="selectButtonKeyDown(row, $event)" ng-attr-aria-label="{{(\'selection.aria.row\' | t) + \' \' + (row.index + 1) + \', \' + col.displayName}}" aria-checked="{{row.isSelected}}" role="checkbox" ng-model="row.isSelected"> </div>'),e.put("ui-grid/selectionSelectAllButtons",'<div role="checkbox" tabindex="0" class="ui-grid-selection-row-header-buttons ui-grid-icon-ok" ui-grid-one-bind-aria-label="\'selection.selectAll\' | t" aria-checked="{{grid.selection.selectAll}}" ng-class="{\'ui-grid-all-selected\': grid.selection.selectAll}" ng-click="headerButtonClick($event)" ng-keydown="headerButtonKeyDown($event)"></div>')}]); | ||
!function(){"use strict";var e=angular.module("ui.grid.selection",["ui.grid"]);e.constant("uiGridSelectionConstants",{featureName:"selection",selectionRowHeaderColName:"selectionRowHeaderCol"}),angular.module("ui.grid").config(["$provide",function(e){e.decorator("GridRow",["$delegate",function(e){return e.prototype.setSelected=function(e){e!==this.isSelected&&(this.isSelected=e,this.grid.selection.selectedCount+=e?1:-1)},e.prototype.setFocused=function(e){e!==this.isFocused&&(this.grid.selection.focusedRow&&(this.grid.selection.focusedRow.isFocused=!1),this.grid.selection.focusedRow=e?this:null,this.isFocused=e)},e}])}]),e.service("uiGridSelectionService",function(){var a={initializeGrid:function(c){c.selection={lastSelectedRow:null,focusedRow:null,selectAll:!1},c.selection.selectedCount=0,a.defaultGridOptions(c.options);var e={events:{selection:{rowFocusChanged:function(e,t,i){},rowSelectionChanged:function(e,t,i){},rowSelectionChangedBatch:function(e,t,i){}}},methods:{selection:{toggleRowSelection:function(e,t){var i=c.getRow(e);null!=i&&null!==i&&a.toggleRowSelection(c,i,t,c.options.multiSelect,c.options.noUnselect,!0)},selectRow:function(e,t){var i=c.getRow(e);null==i||null===i||i.isSelected||a.toggleRowSelection(c,i,t,c.options.multiSelect,c.options.noUnselect,!0)},selectRowByVisibleIndex:function(e,t){var i=c.renderContainers.body.visibleRowCache[e];null==i||null==i||i.isSelected||a.toggleRowSelection(c,i,t,c.options.multiSelect,c.options.noUnselect,!1)},selectRowByKey:function(e,t,i,o,n){var l=c.findRowByKey(e,t,i,n);null==l||null==l||l.isSelected||a.toggleRowSelection(c,l,o,c.options.multiSelect,c.options.noUnselect,!1)},unSelectRow:function(e,t){var i=c.getRow(e);null!=i&&null!==i&&i.isSelected&&a.toggleRowSelection(c,i,t,c.options.multiSelect,c.options.noUnselect,!0)},unSelectRowByVisibleIndex:function(e,t){var i=c.renderContainers.body.visibleRowCache[e];null!=i&&null!=i&&i.isSelected&&a.toggleRowSelection(c,i,t,c.options.multiSelect,c.options.noUnselect,!1)},unSelectRowByKey:function(e,t,i,o,n){var l=c.findRowByKey(e,t,i,n);null!=l&&null!=l&&l.isSelected&&a.toggleRowSelection(c,l,o,c.options.multiSelect,c.options.noUnselect,!1)},selectAllRows:function(t){if(!1!==c.options.multiSelect){var i=[];c.rows.forEach(function(e){e.isSelected||!1===e.enableSelection||!1===c.options.isRowSelectable(e)||(e.setSelected(!0),a.decideRaiseSelectionEvent(c,e,i,t))}),c.selection.selectAll=!0,a.decideRaiseSelectionBatchEvent(c,i,t)}},selectAllVisibleRows:function(t){if(!1!==c.options.multiSelect){var i=[];c.rows.forEach(function(e){e.visible?e.isSelected||!1===e.enableSelection||!1===c.options.isRowSelectable(e)||(e.setSelected(!0),a.decideRaiseSelectionEvent(c,e,i,t)):e.isSelected&&(e.setSelected(!1),a.decideRaiseSelectionEvent(c,e,i,t))}),c.selection.selectAll=!0,a.decideRaiseSelectionBatchEvent(c,i,t)}},clearSelectedRows:function(e){a.clearSelectedRows(c,e)},getSelectedRows:function(){return a.mapAndFilterRowsByEntity(a.getSelectedRows(c))},getUnSelectedRows:function(){return a.mapAndFilterRowsByEntity(a.getUnSelectedRows(c))},getSelectedGridRows:function(){return a.getSelectedRows(c)},getUnSelectedGridRows:function(){return a.getUnSelectedRows(c)},getSelectedCount:function(){return c.selection.selectedCount},setMultiSelect:function(e){c.options.multiSelect=e},setModifierKeysToMultiSelect:function(e){c.options.modifierKeysToMultiSelect=e},getSelectAllState:function(){return c.selection.selectAll}}}};c.api.registerEventsFromObject(e.events),c.api.registerMethodsFromObject(e.methods)},defaultGridOptions:function(e){e.enableRowSelection=!1!==e.enableRowSelection,e.multiSelect=!1!==e.multiSelect,e.noUnselect=!0===e.noUnselect,e.modifierKeysToMultiSelect=!0===e.modifierKeysToMultiSelect,e.enableRowHeaderSelection=!1!==e.enableRowHeaderSelection,void 0===e.enableFullRowSelection&&(e.enableFullRowSelection=!e.enableRowHeaderSelection),e.enableFocusRowOnRowHeaderClick=!1!==e.enableFocusRowOnRowHeaderClick||!e.enableRowHeaderSelection,e.enableSelectRowOnFocus=!1!==e.enableSelectRowOnFocus,e.enableSelectAll=!1!==e.enableSelectAll,e.enableSelectionBatchEvent=!1!==e.enableSelectionBatchEvent,e.selectionRowHeaderWidth=angular.isDefined(e.selectionRowHeaderWidth)?e.selectionRowHeaderWidth:30,e.enableFooterTotalSelected=!1!==e.enableFooterTotalSelected,e.isRowSelectable=angular.isDefined(e.isRowSelectable)?e.isRowSelectable:angular.noop},toggleRowSelection:function(e,t,i,o,n,l){if(!1!==t.enableSelection){void 0===l&&(l=!0);var c=t.isSelected;o||(c?1<a.getSelectedRows(e).length&&(c=!1,a.clearSelectedRows(e,i)):a.clearSelectedRows(e,i)),c&&n||!l&&!t.visible||(t.setSelected(!c),!0===t.isSelected&&(e.selection.lastSelectedRow=t),e.selection.selectAll=e.rows.length===a.getSelectedRows(e).length,e.api.selection.raise.rowSelectionChanged(t,i))}},shiftSelect:function(e,t,i,o){if(o){var n=0<a.getSelectedRows(e).length?e.renderContainers.body.visibleRowCache.indexOf(e.selection.lastSelectedRow):0,l=e.renderContainers.body.visibleRowCache.indexOf(t);if(l<n){var c=n;n=l,l=c}for(var s=[],r=n;r<=l;r++){var d=e.renderContainers.body.visibleRowCache[r];d&&(d.isSelected||!1===d.enableSelection||(d.setSelected(!0),e.selection.lastSelectedRow=d,a.decideRaiseSelectionEvent(e,d,s,i)))}a.decideRaiseSelectionBatchEvent(e,s,i)}},getSelectedRows:function(e){return e.rows.filter(function(e){return e.isSelected})},getUnSelectedRows:function(e){return e.rows.filter(function(e){return!e.isSelected})},mapAndFilterRowsByEntity:function(e){return"function"==typeof e.reduce?e.reduce(function(e,t){return!t.entity.hasOwnProperty("$$hashKey")&&angular.isObject(t.entity)||e.push(t.entity),e},[]):e.filter(function(e){return e.entity.hasOwnProperty("$$hashKey")||!angular.isObject(e.entity)}).map(function(e){return e.entity})},clearSelectedRows:function(t,i){var o=[];a.getSelectedRows(t).forEach(function(e){e.isSelected&&!1!==e.enableSelection&&(e.setSelected(!1),a.decideRaiseSelectionEvent(t,e,o,i))}),t.selection.selectAll=!1,t.selection.selectedCount=0,a.decideRaiseSelectionBatchEvent(t,o,i)},decideRaiseSelectionEvent:function(e,t,i,o){e.options.enableSelectionBatchEvent?i.push(t):e.api.selection.raise.rowSelectionChanged(t,o)},decideRaiseSelectionBatchEvent:function(e,t,i){0<t.length&&e.api.selection.raise.rowSelectionChangedBatch(t,i)}};return a}),e.directive("uiGridSelection",["i18nService","uiGridSelectionConstants","uiGridSelectionService","uiGridConstants",function(d,a,u,g){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,compile:function(){return{pre:function(e,t,i,o){if(u.initializeGrid(o.grid),o.grid.options.enableRowHeaderSelection){var n={name:a.selectionRowHeaderColName,displayName:d.getSafeText("selection.displayName"),width:o.grid.options.selectionRowHeaderWidth,minWidth:10,cellTemplate:"ui-grid/selectionRowHeader",headerCellTemplate:"ui-grid/selectionHeaderCell",enableColumnResizing:!1,enableColumnMenu:!1,exporterSuppressExport:!0,allowCellFocus:!0};o.grid.addRowHeaderColumn(n,0)}var l=!1,c=function(e){return e.forEach(function(e){e.enableSelection=o.grid.options.isRowSelectable(e)}),e},s=function(){o.grid.options.isRowSelectable!==angular.noop&&!0!==l&&(o.grid.registerRowsProcessor(c,500),l=!0)};s();var r=o.grid.registerDataChangeCallback(s,[g.dataChange.OPTIONS]);e.$on("$destroy",r)},post:function(e,t,i,o){}}}}}]),e.directive("uiGridSelectionRowHeaderButtons",["$templateCache","uiGridSelectionService","gridUtil",function(e,c,s){return{replace:!0,restrict:"E",template:e.get("ui-grid/selectionRowHeaderButtons"),scope:!0,require:"^uiGrid",link:function(e,t,i,o){var n=o.grid;function l(e,t){if(t.stopPropagation(),t.shiftKey)c.shiftSelect(n,e,t,n.options.multiSelect);else if(t.ctrlKey||t.metaKey)c.toggleRowSelection(n,e,t,n.options.multiSelect,n.options.noUnselect,!1);else if(e.groupHeader){c.toggleRowSelection(n,e,t,n.options.multiSelect,n.options.noUnselect,!1);for(var i=0;i<e.treeNode.children.length;i++)c.toggleRowSelection(n,e.treeNode.children[i].row,t,n.options.multiSelect,n.options.noUnselect,!1)}else c.toggleRowSelection(n,e,t,n.options.multiSelect&&!n.options.modifierKeysToMultiSelect,n.options.noUnselect,!1);n.options.enableFocusRowOnRowHeaderClick&&e.setFocused(!e.isFocused)&&n.api.selection.raise.rowFocusChanged(e,t)}e.selectButtonClick=l,e.selectButtonKeyDown=function(e,t){32!==t.keyCode&&13!==t.keyCode||(t.preventDefault(),l(e,t))},"ie"===s.detectBrowser()&&t.on("mousedown",function(e){(e.ctrlKey||e.shiftKey)&&(e.target.onselectstart=function(){return!1},window.setTimeout(function(){e.target.onselectstart=null},0))}),e.$on("$destroy",function(){t.off()})}}}]),e.directive("uiGridSelectionSelectAllButtons",["$templateCache","uiGridSelectionService",function(e,o){return{replace:!0,restrict:"E",template:e.get("ui-grid/selectionSelectAllButtons"),scope:!1,link:function(t){var i=t.col.grid;t.headerButtonKeyDown=function(e){32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),t.headerButtonClick(e))},t.headerButtonClick=function(e){i.selection.selectAll?(o.clearSelectedRows(i,e),i.options.noUnselect&&i.api.selection.selectRowByVisibleIndex(0,e),i.selection.selectAll=!1):i.options.multiSelect&&(i.api.selection.selectAllVisibleRows(e),i.selection.selectAll=!0)}}}}]),e.directive("uiGridViewport",function(){return{priority:-200,scope:!1,compile:function(e){var t=angular.element(e[0].querySelector(".ui-grid-canvas:not(.ui-grid-empty-base-layer-container)").children[0]),i="'ui-grid-row-selected': row.isSelected, 'ui-grid-row-focused': row.isFocused}",o=t.attr("ng-class");return i=o?o.slice(0,-1)+","+i:"{"+i,t.attr("ng-class",i),{pre:function(e,t,i,o){},post:function(e,t,i,o){}}}}}),e.directive("uiGridCell",["uiGridConstants","uiGridSelectionService",function(u,g){return{priority:-200,restrict:"A",require:"?^uiGrid",scope:!1,link:function(i,c,e,t){var s=0,r={};t.grid.api.cellNav&&t.grid.api.cellNav.on.viewPortKeyDown(i,function(e,t){null!==t&&t.row===i.row&&t.col===i.col&&e.keyCode===u.keymap.SPACE&&"selectionRowHeaderCol"===i.col.colDef.name&&(e.preventDefault(),g.toggleRowSelection(i.grid,i.row,e,i.grid.options.multiSelect&&!i.grid.options.modifierKeysToMultiSelect,i.grid.options.noUnselect,!1),i.$apply())});var d=function(e){"ui-grid-icon-minus-squared"!==e.target.className&&"ui-grid-icon-plus-squared"!==e.target.className&&(c.off("touchend",n),e.shiftKey?g.shiftSelect(i.grid,i.row,e,i.grid.options.multiSelect):e.ctrlKey||e.metaKey?g.toggleRowSelection(i.grid,i.row,e,i.grid.options.multiSelect,i.grid.options.noUnselect,!1):i.grid.options.enableSelectRowOnFocus&&g.toggleRowSelection(i.grid,i.row,e,i.grid.options.multiSelect&&!i.grid.options.modifierKeysToMultiSelect,i.grid.options.noUnselect,!1),i.row.setFocused(!i.row.isFocused),i.grid.api.selection.raise.rowFocusChanged(i.row,e),i.$apply(),window.setTimeout(function(){c.on("touchend",n)},300))},o=function(e){s=(new Date).getTime(),r=e.changedTouches[0],c.off("click",d)},n=function(e){var t=(new Date).getTime(),i=e.changedTouches[0],o=t-s,n=Math.abs(r.clientX-i.clientX),l=Math.abs(r.clientY-i.clientY);n<100&&l<100&&o<300&&d(e),window.setTimeout(function(){c.on("click",d)},300)};function l(){i.grid.options.enableRowSelection&&i.grid.options.enableFullRowSelection&&"selectionRowHeaderCol"!==i.col.colDef.name&&(c.addClass("ui-grid-disable-selection"),c.on("touchstart",o),c.on("touchend",n),c.on("click",d),i.registered=!0)}l();var a=i.grid.registerDataChangeCallback(function(){i.grid.options.enableRowSelection&&i.grid.options.enableFullRowSelection&&!i.registered?l():i.grid.options.enableRowSelection&&i.grid.options.enableFullRowSelection||!i.registered||i.registered&&(c.removeClass("ui-grid-disable-selection"),c.off("touchstart",o),c.off("touchend",n),c.off("click",d),i.registered=!1)},[u.dataChange.OPTIONS]);c.on("$destroy",a)}}}]),e.directive("uiGridGridFooter",["$compile","gridUtil",function(l,i){return{restrict:"EA",replace:!0,priority:-1e3,require:"^uiGrid",scope:!0,compile:function(){return{pre:function(o,n,e,t){t.grid.options.showGridFooter&&i.getTemplate("ui-grid/gridFooterSelectedItems").then(function(e){var t=angular.element(e),i=l(t)(o);angular.element(n[0].getElementsByClassName("ui-grid-grid-footer")[0]).append(i)})},post:function(e,t,i,o){}}}}}])}(),angular.module("ui.grid.selection").run(["$templateCache",function(e){"use strict";e.put("ui-grid/gridFooterSelectedItems",'<span ng-if="grid.selection.selectedCount !== 0 && grid.options.enableFooterTotalSelected">({{"search.selectedItems" | t}} {{grid.selection.selectedCount}})</span>'),e.put("ui-grid/selectionHeaderCell",'<div>\x3c!-- <div class="ui-grid-vertical-bar"> </div> --\x3e<div class="ui-grid-cell-contents" col-index="renderIndex"><ui-grid-selection-select-all-buttons ng-if="grid.options.enableSelectAll" role="checkbox" ng-model="grid.selection.selectAll"></ui-grid-selection-select-all-buttons></div></div>'),e.put("ui-grid/selectionRowHeader",'<div class="ui-grid-cell-contents ui-grid-disable-selection clickable"><ui-grid-selection-row-header-buttons></ui-grid-selection-row-header-buttons></div>'),e.put("ui-grid/selectionRowHeaderButtons",'<div class="ui-grid-selection-row-header-buttons ui-grid-icon-ok clickable" ng-class="{\'ui-grid-row-selected\': row.isSelected}" tabindex="0" ng-click="selectButtonClick(row, $event)" ng-keydown="selectButtonKeyDown(row, $event)" ng-attr-aria-label="{{(\'selection.aria.row\' | t) + \' \' + (row.index + 1) + \', \' + col.displayName}}" aria-checked="{{row.isSelected}}" role="checkbox" ng-model="row.isSelected"> </div>'),e.put("ui-grid/selectionSelectAllButtons",'<div role="checkbox" tabindex="0" class="ui-grid-selection-row-header-buttons ui-grid-icon-ok" ui-grid-one-bind-aria-label="\'selection.selectAll\' | t" aria-checked="{{grid.selection.selectAll}}" ng-class="{\'ui-grid-all-selected\': grid.selection.selectAll}" ng-click="headerButtonClick($event)" ng-keydown="headerButtonKeyDown($event)"></div>')}]); |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
/*! | ||
* ui-grid - v4.11.0 - 2021-08-12 | ||
* Copyright (c) 2021 ; License: MIT | ||
* ui-grid - v4.11.1 - 2022-02-23 | ||
* Copyright (c) 2022 ; License: MIT | ||
*/ | ||
@@ -5,0 +5,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5005035
85882