Socket
Socket
Sign inDemoInstall

@ag-grid-community/csv-export

Package Overview
Dependencies
Maintainers
3
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ag-grid-community/csv-export - npm Package Compare versions

Comparing version 26.2.0 to 27.0.0

dist/cjs/es5/csvExport/baseCreator.d.ts

141

dist/csv-export.cjs.js
/**
* @ag-grid-community/csv-export - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.2.0
* @ag-grid-community/csv-export - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.0.0
* @link http://www.ag-grid.com/

@@ -26,14 +26,7 @@ ' * @license MIT

};
BaseCreator.prototype.getMergedParamsAndData = function (userParams) {
var mergedParams = this.mergeDefaultParams(userParams);
var data = this.beans.gridSerializer.serialize(this.createSerializingSession(mergedParams), mergedParams);
return { mergedParams: mergedParams, data: data };
BaseCreator.prototype.getData = function (params) {
var serializingSession = this.createSerializingSession(params);
var data = this.beans.gridSerializer.serialize(serializingSession, params);
return data;
};
BaseCreator.prototype.mergeDefaultParams = function (userParams) {
var baseParams = this.getDefaultExportParams();
var params = {};
core._.assign(params, baseParams);
core._.assign(params, userParams);
return params;
};
return BaseCreator;

@@ -55,3 +48,3 @@ }());

BaseGridSerializingSession.prototype.prepare = function (columnsToExport) {
this.groupColumns = core._.filter(columnsToExport, function (col) { return !!col.getColDef().showRowGroup; });
this.groupColumns = columnsToExport.filter(function (col) { return !!col.getColDef().showRowGroup; });
};

@@ -139,28 +132,19 @@ BaseGridSerializingSession.prototype.extractHeaderValue = function (column) {

}
// Internet Explorer
var element = document.createElement('a');
// @ts-ignore
if (win.navigator.msSaveOrOpenBlob) {
var url = win.URL.createObjectURL(content);
element.setAttribute('href', url);
element.setAttribute('download', fileName);
element.style.display = 'none';
document.body.appendChild(element);
element.dispatchEvent(new MouseEvent('click', {
bubbles: false,
cancelable: true,
view: win
}));
document.body.removeChild(element);
win.setTimeout(function () {
// @ts-ignore
win.navigator.msSaveOrOpenBlob(content, fileName);
}
else {
// Other Browsers
var element = document.createElement('a');
// @ts-ignore
var url_1 = win.URL.createObjectURL(content);
element.setAttribute('href', url_1);
element.setAttribute('download', fileName);
element.style.display = 'none';
document.body.appendChild(element);
element.dispatchEvent(new MouseEvent('click', {
bubbles: false,
cancelable: true,
view: win
}));
document.body.removeChild(element);
win.setTimeout(function () {
// @ts-ignore
win.URL.revokeObjectURL(url_1);
}, 0);
}
win.URL.revokeObjectURL(url);
}, 0);
};

@@ -280,3 +264,3 @@ return Downloader;

else {
console.warn('unknown value type during csv conversion');
console.warn('AG Grid: unknown value type during csv conversion');
stringValue = '';

@@ -330,15 +314,14 @@ }

};
CsvCreator.prototype.getDefaultExportParams = function () {
return this.gridOptionsWrapper.getDefaultExportParams('csv');
CsvCreator.prototype.getMergedParams = function (params) {
var baseParams = this.gridOptionsWrapper.getDefaultExportParams('csv');
return Object.assign({}, baseParams, params);
};
CsvCreator.prototype.export = function (userParams) {
if (this.isExportSuppressed()) {
console.warn("ag-grid: Export cancelled. Export is not allowed as per your configuration.");
console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration.");
return '';
}
var _a = this.getMergedParamsAndData(userParams), mergedParams = _a.mergedParams, data = _a.data;
var packagedFile = new Blob(["\ufeff", data], {
// @ts-ignore
type: window.navigator.msSaveOrOpenBlob ? this.getMimeType() : 'octet/stream'
});
var mergedParams = this.getMergedParams(userParams);
var data = this.getData(mergedParams);
var packagedFile = new Blob(["\ufeff", data], { type: 'text/plain' });
Downloader.download(this.getFileName(mergedParams.fileName), packagedFile);

@@ -351,7 +334,5 @@ return data;

CsvCreator.prototype.getDataAsCsv = function (params) {
return this.getMergedParamsAndData(params).data;
var mergedParams = this.getMergedParams(params);
return this.getData(mergedParams);
};
CsvCreator.prototype.getMimeType = function () {
return 'text/csv;charset=utf-8;';
};
CsvCreator.prototype.getDefaultFileName = function () {

@@ -440,2 +421,3 @@ return 'export.csv';

GridSerializer.prototype.processRow = function (gridSerializingSession, params, columnsToExport, node) {
var _this = this;
var rowSkipper = params.shouldRowBeSkipped || (function () { return false; });

@@ -456,4 +438,6 @@ var gridOptionsWrapper = this.gridOptionsWrapper;

}
var rowPosition = { rowIndex: node.rowIndex, rowPinned: node.rowPinned };
if ((!isLeafNode && (params.skipRowGroups || shouldSkipCurrentGroup || hideOpenParents)) ||
(params.onlySelected && !node.isSelected()) ||
(params.rowNodes && !params.rowNodes.some(function (position) { return _this.rowPositionUtils.sameRow(position, rowPosition); })) ||
(params.skipPinnedTop && node.rowPinned === 'top') ||

@@ -654,3 +638,20 @@ (params.skipPinnedBottom && node.rowPinned === 'bottom')) {

}
gridRowIterator.onColumn(name || '', columnIndex++, columnGroup.getLeafColumns().length - 1);
var collapsibleGroupRanges = columnGroup.getLeafColumns().reduce(function (collapsibleGroups, currentColumn, currentIdx, arr) {
var lastGroup = core._.last(collapsibleGroups);
var groupShow = currentColumn.getColumnGroupShow() === 'open';
if (!groupShow) {
if (lastGroup && lastGroup[1] == null) {
lastGroup[1] = currentIdx - 1;
}
}
else if (!lastGroup || lastGroup[1] != null) {
lastGroup = [currentIdx];
collapsibleGroups.push(lastGroup);
}
if (currentIdx === arr.length - 1 && lastGroup && lastGroup[1] == null) {
lastGroup[1] = currentIdx;
}
return collapsibleGroups;
}, []);
gridRowIterator.onColumn(name || '', columnIndex++, columnGroup.getLeafColumns().length - 1, collapsibleGroupRanges);
});

@@ -673,2 +674,5 @@ };

], GridSerializer.prototype, "selectionService", void 0);
__decorate$1([
core.Autowired('rowPositionUtils')
], GridSerializer.prototype, "rowPositionUtils", void 0);
GridSerializer = __decorate$1([

@@ -753,2 +757,13 @@ core.Bean("gridSerializer")

var __values = (undefined && undefined.__values) || function(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
// table for crc calculation

@@ -835,2 +850,3 @@ // from: https://referencesource.microsoft.com/#System/sys/System/IO/compression/Crc32Helper.cs,3b31978c7d7f7246,references

ZipContainer.buildFileStream = function (fData) {
var e_1, _a;
if (fData === void 0) { fData = ''; }

@@ -842,10 +858,19 @@ var totalFiles = this.folders.concat(this.files);

var cL = 0;
for (var _i = 0, totalFiles_1 = totalFiles; _i < totalFiles_1.length; _i++) {
var currentFile = totalFiles_1[_i];
var _a = this.getHeader(currentFile, lL), fileHeader = _a.fileHeader, folderHeader = _a.folderHeader, content = _a.content;
lL += fileHeader.length + content.length;
cL += folderHeader.length;
fData += fileHeader + content;
foData += folderHeader;
try {
for (var totalFiles_1 = __values(totalFiles), totalFiles_1_1 = totalFiles_1.next(); !totalFiles_1_1.done; totalFiles_1_1 = totalFiles_1.next()) {
var currentFile = totalFiles_1_1.value;
var _b = this.getHeader(currentFile, lL), fileHeader = _b.fileHeader, folderHeader = _b.folderHeader, content = _b.content;
lL += fileHeader.length + content.length;
cL += folderHeader.length;
fData += fileHeader + content;
foData += folderHeader;
}
}
catch (e_1_1) { e_1 = { error: e_1_1 }; }
finally {
try {
if (totalFiles_1_1 && !totalFiles_1_1.done && (_a = totalFiles_1.return)) _a.call(totalFiles_1);
}
finally { if (e_1) throw e_1.error; }
}
var foEnd = this.buildFolderEnd(len, cL, lL);

@@ -852,0 +877,0 @@ return fData + foData + foEnd;

/**
* @ag-grid-community/csv-export - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.2.0
* @ag-grid-community/csv-export - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.0.0
* @link http://www.ag-grid.com/

@@ -8,6 +8,6 @@ ' * @license MIT

/**
* @ag-grid-community/csv-export - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.2.0
* @ag-grid-community/csv-export - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v27.0.0
* @link http://www.ag-grid.com/
' * @license MIT
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,o=require("@ag-grid-community/core"),r=function(){function e(){}return e.prototype.setBeans=function(e){this.beans=e},e.prototype.getFileName=function(e){var t=this.getDefaultFileExtension();return null!=e&&e.length||(e=this.getDefaultFileName()),-1===e.indexOf(".")?e+"."+t:e},e.prototype.getMergedParamsAndData=function(e){var t=this.mergeDefaultParams(e);return{mergedParams:t,data:this.beans.gridSerializer.serialize(this.createSerializingSession(t),t)}},e.prototype.mergeDefaultParams=function(e){var t=this.getDefaultExportParams(),r={};return o._.assign(r,t),o._.assign(r,e),r},e}(),n=function(){function e(e){this.groupColumns=[];var t=e.columnModel,o=e.valueService,r=e.gridOptionsWrapper,n=e.processCellCallback,i=e.processHeaderCallback,s=e.processGroupHeaderCallback,p=e.processRowGroupCallback;this.columnModel=t,this.valueService=o,this.gridOptionsWrapper=r,this.processCellCallback=n,this.processHeaderCallback=i,this.processGroupHeaderCallback=s,this.processRowGroupCallback=p}return e.prototype.prepare=function(e){this.groupColumns=o._.filter(e,(function(e){return!!e.getColDef().showRowGroup}))},e.prototype.extractHeaderValue=function(e){var t=this.getHeaderName(this.processHeaderCallback,e);return null!=t?t:""},e.prototype.extractRowCellValue=function(e,t,o,r,n){var i,s=this.gridOptionsWrapper.isGroupMultiAutoColumn()?n.rowGroupIndex:0;i=n&&n.group&&(t===s&&-1!==this.groupColumns.indexOf(e)||0===t&&this.gridOptionsWrapper.isGroupUseEntireRow(this.columnModel.isPivotMode()))?this.createValueForGroupNode(n):this.valueService.getValue(e,n);var p=this.processCell(o,n,e,i,this.processCellCallback,r);return null!=p?p:""},e.prototype.getHeaderName=function(e,t){return e?e({column:t,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()}):this.columnModel.getDisplayNameForColumn(t,"csv",!0)},e.prototype.createValueForGroupNode=function(e){if(this.processRowGroupCallback)return this.processRowGroupCallback({node:e,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()});var t=[e.key];if(!this.gridOptionsWrapper.isGroupMultiAutoColumn())for(;e.parent;)e=e.parent,t.push(e.key);return t.reverse().join(" -> ")},e.prototype.processCell=function(e,t,o,r,n,i){return n?n({accumulatedRowIndex:e,column:o,node:t,value:r,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext(),type:i}):null!=r?r:""},e}(),i=function(){function e(){}return e.download=function(e,t){var o=document.defaultView||window;if(o)if(o.navigator.msSaveOrOpenBlob)o.navigator.msSaveOrOpenBlob(t,e);else{var r=document.createElement("a"),n=o.URL.createObjectURL(t);r.setAttribute("href",n),r.setAttribute("download",e),r.style.display="none",document.body.appendChild(r),r.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:o})),document.body.removeChild(r),o.setTimeout((function(){o.URL.revokeObjectURL(n)}),0)}else console.warn("AG Grid: There is no `window` associated with the current `document`")},e}(),s=(e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)},function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}),p=function(e){function t(t){var o=e.call(this,t)||this;o.isFirstLine=!0,o.result="";var r=t.suppressQuotes,n=t.columnSeparator;return o.suppressQuotes=r,o.columnSeparator=n,o}return s(t,e),t.prototype.addCustomContent=function(e){var t=this;e&&("string"==typeof e?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,"\r\n"),this.result+=e):e.forEach((function(e){t.beginNewLine(),e.forEach((function(e,o){0!==o&&(t.result+=t.columnSeparator),t.result+=t.putInQuotes(e.data.value||""),e.mergeAcross&&t.appendEmptyCells(e.mergeAcross)}))})))},t.prototype.onNewHeaderGroupingRow=function(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}},t.prototype.onNewHeaderGroupingRowColumn=function(e,t,o){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(e),this.appendEmptyCells(o)},t.prototype.appendEmptyCells=function(e){for(var t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")},t.prototype.onNewHeaderRow=function(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}},t.prototype.onNewHeaderRowColumn=function(e,t){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))},t.prototype.onNewBodyRow=function(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}},t.prototype.onNewBodyRowColumn=function(e,t,r){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractRowCellValue(e,t,t,o.Constants.EXPORT_TYPE_CSV,r))},t.prototype.putInQuotes=function(e){return this.suppressQuotes?e:null==e?'""':("string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():(console.warn("unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"');var t},t.prototype.parse=function(){return this.result},t.prototype.beginNewLine=function(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1},t}(n),a=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),u=function(e,t,o,r){var n,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var p=e.length-1;p>=0;p--)(n=e[p])&&(s=(i<3?n(s):i>3?n(t,o,s):n(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return a(t,e),t.prototype.postConstruct=function(){this.setBeans({gridSerializer:this.gridSerializer,gridOptionsWrapper:this.gridOptionsWrapper})},t.prototype.getDefaultExportParams=function(){return this.gridOptionsWrapper.getDefaultExportParams("csv")},t.prototype.export=function(e){if(this.isExportSuppressed())return console.warn("ag-grid: Export cancelled. Export is not allowed as per your configuration."),"";var t=this.getMergedParamsAndData(e),o=t.mergedParams,r=t.data,n=new Blob(["\ufeff",r],{type:window.navigator.msSaveOrOpenBlob?this.getMimeType():"octet/stream"});return i.download(this.getFileName(o.fileName),n),r},t.prototype.exportDataAsCsv=function(e){return this.export(e)},t.prototype.getDataAsCsv=function(e){return this.getMergedParamsAndData(e).data},t.prototype.getMimeType=function(){return"text/csv;charset=utf-8;"},t.prototype.getDefaultFileName=function(){return"export.csv"},t.prototype.getDefaultFileExtension=function(){return"csv"},t.prototype.createSerializingSession=function(e){var t=this.columnModel,o=this.valueService,r=this.gridOptionsWrapper,n=e,i=n.processCellCallback,s=n.processHeaderCallback,a=n.processGroupHeaderCallback,u=n.processRowGroupCallback,l=n.suppressQuotes,c=n.columnSeparator;return new p({columnModel:t,valueService:o,gridOptionsWrapper:r,processCellCallback:i||void 0,processHeaderCallback:s||void 0,processGroupHeaderCallback:a||void 0,processRowGroupCallback:u||void 0,suppressQuotes:l||!1,columnSeparator:c||","})},t.prototype.isExportSuppressed=function(){return this.gridOptionsWrapper.isSuppressCsvExport()},u([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),u([o.Autowired("valueService")],t.prototype,"valueService",void 0),u([o.Autowired("gridSerializer")],t.prototype,"gridSerializer",void 0),u([o.Autowired("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),u([o.PostConstruct],t.prototype,"postConstruct",null),t=u([o.Bean("csvCreator")],t)}(r),c=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),d=function(e,t,o,r){var n,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var p=e.length-1;p>=0;p--)(n=e[p])&&(s=(i<3?n(s):i>3?n(t,o,s):n(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};(t=exports.RowType||(exports.RowType={}))[t.HEADER_GROUPING=0]="HEADER_GROUPING",t[t.HEADER=1]="HEADER",t[t.BODY=2]="BODY";var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t.prototype.serialize=function(e,t){void 0===t&&(t={});var r=this.getColumnsToExport(t.allColumns,t.columnKeys);return o._.compose(this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t))(e).parse()},t.prototype.processRow=function(e,t,r,n){var i=t.shouldRowBeSkipped||function(){return!1},s=this.gridOptionsWrapper,p=s.getContext(),a=s.getApi(),u=s.getColumnApi(),l=s.isGroupRemoveSingleChildren(),c=s.isGroupHideOpenParents(),d=s.isGroupRemoveLowestSingleChildren(),f=this.columnModel.isPivotMode()?n.leafGroup:!n.group,h=t.skipGroups||t.skipRowGroups,g=d&&n.leafGroup,m=1===n.allChildrenCount&&(l||g);if((h&&t.skipGroups&&o._.doOnce((function(){return console.warn("AG Grid: Since v25.2 `skipGroups` has been renamed to `skipRowGroups`.")}),"gridSerializer-skipGroups"),!(!f&&(t.skipRowGroups||m||c)||t.onlySelected&&!n.isSelected()||t.skipPinnedTop&&"top"===n.rowPinned||t.skipPinnedBottom&&"bottom"===n.rowPinned))&&((!(-1===n.level)||n.leafGroup)&&!i({node:n,api:a,context:p}))){var v=e.onNewBodyRow();if(r.forEach((function(e,t){v.onColumn(e,t,n)})),t.getCustomContentBelowRow){var C=t.getCustomContentBelowRow({node:n,api:a,columnApi:u,context:p});C&&e.addCustomContent(C)}}},t.prototype.appendContent=function(e){return function(t){var r=e.customFooter||e.appendContent;return r&&(e.customFooter&&o._.doOnce((function(){return console.warn("AG Grid: Since version 25.2.0 the `customFooter` param has been deprecated. Use `appendContent` instead.")}),"gridSerializer-customFooter"),t.addCustomContent(r)),t}},t.prototype.prependContent=function(e){return function(t){var r=e.customHeader||e.prependContent;return r&&(e.customHeader&&o._.doOnce((function(){return console.warn("AG Grid: Since version 25.2.0 the `customHeader` param has been deprecated. Use `prependContent` instead.")}),"gridSerializer-customHeader"),t.addCustomContent(r)),t}},t.prototype.prepareSession=function(e){return function(t){return t.prepare(e),t}},t.prototype.exportColumnGroups=function(e,t){var r=this;return function(n){if(e.skipColumnGroupHeaders)e.columnGroups&&o._.doOnce((function(){return console.warn("AG Grid: Since v25.2 the `columnGroups` param has deprecated, and groups are exported by default.")}),"gridSerializer-columnGroups");else{var i=new o.GroupInstanceIdCreator,s=r.displayedGroupCreator.createDisplayedGroups(t,r.columnModel.getGridBalancedTree(),i,null);r.recursivelyAddHeaderGroups(s,n,e.processGroupHeaderCallback)}return n}},t.prototype.exportHeaders=function(e,t){return function(r){if(e.skipHeader||e.skipColumnHeaders)e.skipHeader&&o._.doOnce((function(){return console.warn("AG Grid: Since v25.2 the `skipHeader` param has been renamed to `skipColumnHeaders`.")}),"gridSerializer-skipHeader");else{var n=r.onNewHeaderRow();t.forEach((function(e,t){n.onColumn(e,t,void 0)}))}return r}},t.prototype.processPinnedTopRows=function(e,t){var o=this;return function(r){var n=o.processRow.bind(o,r,e,t);return o.pinnedRowModel.forEachPinnedTopRow(n),r}},t.prototype.processRows=function(e,t){var r=this;return function(n){var i=r.rowModel,s=i.getType(),p=s===o.Constants.ROW_MODEL_TYPE_CLIENT_SIDE,a=s===o.Constants.ROW_MODEL_TYPE_SERVER_SIDE,u=!p&&e.onlySelected,l=r.processRow.bind(r,n,e,t);r.columnModel.isPivotMode()?p?i.forEachPivotNode(l):i.forEachNode(l):e.onlySelectedAllPages||u?r.selectionService.getSelectedNodes().forEach(l):p||a?i.forEachNodeAfterFilterAndSort(l):i.forEachNode(l);return n}},t.prototype.processPinnedBottomRows=function(e,t){var o=this;return function(r){var n=o.processRow.bind(o,r,e,t);return o.pinnedRowModel.forEachPinnedBottomRow(n),r}},t.prototype.getColumnsToExport=function(e,t){void 0===e&&(e=!1);var r=this.columnModel.isPivotMode();return t&&t.length?this.columnModel.getGridColumns(t):e&&!r?(this.gridOptionsWrapper.isTreeData()?this.columnModel.getGridColumns([o.Constants.GROUP_AUTO_COLUMN_ID]):[]).concat(this.columnModel.getAllPrimaryColumns()||[]):this.columnModel.getAllDisplayedColumns()},t.prototype.recursivelyAddHeaderGroups=function(e,t,r){var n=[];e.forEach((function(e){var t=e;t.getChildren&&t.getChildren().forEach((function(e){return n.push(e)}))})),e.length>0&&e[0]instanceof o.ColumnGroup&&this.doAddHeaderHeader(t,e,r),n&&n.length>0&&this.recursivelyAddHeaderGroups(n,t,r)},t.prototype.doAddHeaderHeader=function(e,t,o){var r=this,n=e.onNewHeaderGroupingRow(),i=0;t.forEach((function(e){var t,s=e;t=o?o({columnGroup:s,api:r.gridOptionsWrapper.getApi(),columnApi:r.gridOptionsWrapper.getColumnApi(),context:r.gridOptionsWrapper.getContext()}):r.columnModel.getDisplayNameForColumnGroup(s,"header"),n.onColumn(t||"",i++,s.getLeafColumns().length-1)}))},d([o.Autowired("displayedGroupCreator")],t.prototype,"displayedGroupCreator",void 0),d([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),d([o.Autowired("rowModel")],t.prototype,"rowModel",void 0),d([o.Autowired("pinnedRowModel")],t.prototype,"pinnedRowModel",void 0),d([o.Autowired("selectionService")],t.prototype,"selectionService",void 0),t=d([o.Bean("gridSerializer")],t)}(o.BeanStub),h={moduleName:o.ModuleNames.CsvExportModule,beans:[l,f]},g=function(){function e(){}return e.createHeader=function(e){void 0===e&&(e={});var t=["version"];return e.version||(e.version="1.0"),e.encoding&&t.push("encoding"),e.standalone&&t.push("standalone"),"<?xml "+t.map((function(t){return t+'="'+e[t]+'"'})).join(" ")+" ?>"},e.createXml=function(e,t){var o=this,r="";e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach((function(e){Object.keys(e.map).forEach((function(n){r+=o.returnAttributeIfPopulated(e.prefix+n,e.map[n],t)}))})),e.properties.rawMap&&Object.keys(e.properties.rawMap).forEach((function(n){r+=o.returnAttributeIfPopulated(n,e.properties.rawMap[n],t)})));var n="<"+e.name+r;return e.children||null!=e.textNode?null!=e.textNode?n+">"+e.textNode+"</"+e.name+">\r\n":(n+=">\r\n",e.children&&e.children.forEach((function(e){n+=o.createXml(e,t)})),n+"</"+e.name+">\r\n"):n+"/>\r\n"},e.returnAttributeIfPopulated=function(e,t,o){if(!t&&""!==t&&0!==t)return"";var r=t;return"boolean"==typeof t&&o&&(r=o(t))," "+e+'="'+r+'"'},e}(),m=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),v=function(){function e(){}return e.addFolders=function(e){e.forEach(this.addFolder.bind(this))},e.addFolder=function(e){this.folders.push({path:e,created:new Date,isBase64:!1})},e.addFile=function(e,t,o){void 0===o&&(o=!1),this.files.push({path:e,created:new Date,content:t,isBase64:o})},e.getContent=function(e){void 0===e&&(e="application/zip");var t=this.buildFileStream(),o=this.buildUint8Array(t);return this.clearStream(),new Blob([o],{type:e})},e.clearStream=function(){this.folders=[],this.files=[]},e.buildFileStream=function(e){void 0===e&&(e="");for(var t=this.folders.concat(this.files),o=t.length,r="",n=0,i=0,s=0,p=t;s<p.length;s++){var a=p[s],u=this.getHeader(a,n),l=u.fileHeader,c=u.folderHeader,d=u.content;n+=l.length+d.length,i+=c.length,e+=l+d,r+=c}return e+r+this.buildFolderEnd(o,i,n)},e.getHeader=function(e,t){var r=e.content,n=e.path,i=e.created,s=e.isBase64,p=o._.utf8_encode,a=o._.decToHex,u=p(n),l=u!==n,c=this.convertTime(i),d=this.convertDate(i),f="";if(l){var h=a(1,1)+a(this.getFromCrc32Table(u),4)+u;f="up"+a(h.length,2)+h}var g=r?this.getConvertedContent(r,s):{size:0,content:""},m=g.size,v=g.content,C="\n\0"+(l?"\0\b":"\0\0")+"\0\0"+a(c,2)+a(d,2)+a(m?this.getFromCrc32Table(v):0,4)+a(m,4)+a(m,4)+a(u.length,2)+a(f.length,2);return{fileHeader:"PK\x03\x04"+C+u+f,folderHeader:"PK\x01\x02\x14\0"+C+"\0\0\0\0\0\0"+(r?"\0\0\0\0":"\x10\0\0\0")+a(t,4)+u+f,content:v||""}},e.getConvertedContent=function(e,t){return void 0===t&&(t=!1),t&&(e=e.split(";base64,")[1]),{size:(e=t?atob(e):e).length,content:e}},e.buildFolderEnd=function(e,t,r){var n=o._.decToHex;return"PK\x05\x06\0\0\0\0"+n(e,2)+n(e,2)+n(t,4)+n(r,4)+"\0\0"},e.buildUint8Array=function(e){for(var t=new Uint8Array(e.length),o=0;o<t.length;o++)t[o]=e.charCodeAt(o);return t},e.getFromCrc32Table=function(e){if(!e.length)return 0;for(var t=e.length,o=new Uint8Array(t),r=0;r<t;r++)o[r]=e.charCodeAt(r);var n=-1,i=0;for(r=0;r<t;r++)i=o[r],n=n>>>8^m[255&(n^i)];return-1^n},e.convertTime=function(e){var t=e.getHours();return t<<=6,t|=e.getMinutes(),t<<=5,t|=e.getSeconds()/2},e.convertDate=function(e){var t=e.getFullYear()-1980;return t<<=4,t|=e.getMonth()+1,t<<=5,t|=e.getDate()},e.folders=[],e.files=[],e}();exports.BaseCreator=r,exports.BaseGridSerializingSession=n,exports.CsvCreator=l,exports.CsvExportModule=h,exports.Downloader=i,exports.GridSerializer=f,exports.XmlFactory=g,exports.ZipContainer=v;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,o=require("@ag-grid-community/core"),r=function(){function e(){}return e.prototype.setBeans=function(e){this.beans=e},e.prototype.getFileName=function(e){var t=this.getDefaultFileExtension();return null!=e&&e.length||(e=this.getDefaultFileName()),-1===e.indexOf(".")?e+"."+t:e},e.prototype.getData=function(e){var t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)},e}(),n=function(){function e(e){this.groupColumns=[];var t=e.columnModel,o=e.valueService,r=e.gridOptionsWrapper,n=e.processCellCallback,i=e.processHeaderCallback,s=e.processGroupHeaderCallback,p=e.processRowGroupCallback;this.columnModel=t,this.valueService=o,this.gridOptionsWrapper=r,this.processCellCallback=n,this.processHeaderCallback=i,this.processGroupHeaderCallback=s,this.processRowGroupCallback=p}return e.prototype.prepare=function(e){this.groupColumns=e.filter((function(e){return!!e.getColDef().showRowGroup}))},e.prototype.extractHeaderValue=function(e){var t=this.getHeaderName(this.processHeaderCallback,e);return null!=t?t:""},e.prototype.extractRowCellValue=function(e,t,o,r,n){var i,s=this.gridOptionsWrapper.isGroupMultiAutoColumn()?n.rowGroupIndex:0;i=n&&n.group&&(t===s&&-1!==this.groupColumns.indexOf(e)||0===t&&this.gridOptionsWrapper.isGroupUseEntireRow(this.columnModel.isPivotMode()))?this.createValueForGroupNode(n):this.valueService.getValue(e,n);var p=this.processCell(o,n,e,i,this.processCellCallback,r);return null!=p?p:""},e.prototype.getHeaderName=function(e,t){return e?e({column:t,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()}):this.columnModel.getDisplayNameForColumn(t,"csv",!0)},e.prototype.createValueForGroupNode=function(e){if(this.processRowGroupCallback)return this.processRowGroupCallback({node:e,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext()});var t=[e.key];if(!this.gridOptionsWrapper.isGroupMultiAutoColumn())for(;e.parent;)e=e.parent,t.push(e.key);return t.reverse().join(" -> ")},e.prototype.processCell=function(e,t,o,r,n,i){return n?n({accumulatedRowIndex:e,column:o,node:t,value:r,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),context:this.gridOptionsWrapper.getContext(),type:i}):null!=r?r:""},e}(),i=function(){function e(){}return e.download=function(e,t){var o=document.defaultView||window;if(o){var r=document.createElement("a"),n=o.URL.createObjectURL(t);r.setAttribute("href",n),r.setAttribute("download",e),r.style.display="none",document.body.appendChild(r),r.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:o})),document.body.removeChild(r),o.setTimeout((function(){o.URL.revokeObjectURL(n)}),0)}else console.warn("AG Grid: There is no `window` associated with the current `document`")},e}(),s=(e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)},function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}),p=function(e){function t(t){var o=e.call(this,t)||this;o.isFirstLine=!0,o.result="";var r=t.suppressQuotes,n=t.columnSeparator;return o.suppressQuotes=r,o.columnSeparator=n,o}return s(t,e),t.prototype.addCustomContent=function(e){var t=this;e&&("string"==typeof e?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,"\r\n"),this.result+=e):e.forEach((function(e){t.beginNewLine(),e.forEach((function(e,o){0!==o&&(t.result+=t.columnSeparator),t.result+=t.putInQuotes(e.data.value||""),e.mergeAcross&&t.appendEmptyCells(e.mergeAcross)}))})))},t.prototype.onNewHeaderGroupingRow=function(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}},t.prototype.onNewHeaderGroupingRowColumn=function(e,t,o){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(e),this.appendEmptyCells(o)},t.prototype.appendEmptyCells=function(e){for(var t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")},t.prototype.onNewHeaderRow=function(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}},t.prototype.onNewHeaderRowColumn=function(e,t){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))},t.prototype.onNewBodyRow=function(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}},t.prototype.onNewBodyRowColumn=function(e,t,r){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractRowCellValue(e,t,t,o.Constants.EXPORT_TYPE_CSV,r))},t.prototype.putInQuotes=function(e){return this.suppressQuotes?e:null==e?'""':("string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():(console.warn("AG Grid: unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"');var t},t.prototype.parse=function(){return this.result},t.prototype.beginNewLine=function(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1},t}(n),u=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),a=function(e,t,o,r){var n,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var p=e.length-1;p>=0;p--)(n=e[p])&&(s=(i<3?n(s):i>3?n(t,o,s):n(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s},l=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return u(t,e),t.prototype.postConstruct=function(){this.setBeans({gridSerializer:this.gridSerializer,gridOptionsWrapper:this.gridOptionsWrapper})},t.prototype.getMergedParams=function(e){var t=this.gridOptionsWrapper.getDefaultExportParams("csv");return Object.assign({},t,e)},t.prototype.export=function(e){if(this.isExportSuppressed())return console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration."),"";var t=this.getMergedParams(e),o=this.getData(t),r=new Blob(["\ufeff",o],{type:"text/plain"});return i.download(this.getFileName(t.fileName),r),o},t.prototype.exportDataAsCsv=function(e){return this.export(e)},t.prototype.getDataAsCsv=function(e){var t=this.getMergedParams(e);return this.getData(t)},t.prototype.getDefaultFileName=function(){return"export.csv"},t.prototype.getDefaultFileExtension=function(){return"csv"},t.prototype.createSerializingSession=function(e){var t=this.columnModel,o=this.valueService,r=this.gridOptionsWrapper,n=e,i=n.processCellCallback,s=n.processHeaderCallback,u=n.processGroupHeaderCallback,a=n.processRowGroupCallback,l=n.suppressQuotes,c=n.columnSeparator;return new p({columnModel:t,valueService:o,gridOptionsWrapper:r,processCellCallback:i||void 0,processHeaderCallback:s||void 0,processGroupHeaderCallback:u||void 0,processRowGroupCallback:a||void 0,suppressQuotes:l||!1,columnSeparator:c||","})},t.prototype.isExportSuppressed=function(){return this.gridOptionsWrapper.isSuppressCsvExport()},a([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),a([o.Autowired("valueService")],t.prototype,"valueService",void 0),a([o.Autowired("gridSerializer")],t.prototype,"gridSerializer",void 0),a([o.Autowired("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),a([o.PostConstruct],t.prototype,"postConstruct",null),t=a([o.Bean("csvCreator")],t)}(r),c=function(){var e=function(t,o){return(e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var o in t)t.hasOwnProperty(o)&&(e[o]=t[o])})(t,o)};return function(t,o){function r(){this.constructor=t}e(t,o),t.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),d=function(e,t,o,r){var n,i=arguments.length,s=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,o,r);else for(var p=e.length-1;p>=0;p--)(n=e[p])&&(s=(i<3?n(s):i>3?n(t,o,s):n(t,o))||s);return i>3&&s&&Object.defineProperty(t,o,s),s};(t=exports.RowType||(exports.RowType={}))[t.HEADER_GROUPING=0]="HEADER_GROUPING",t[t.HEADER=1]="HEADER",t[t.BODY=2]="BODY";var f=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return c(t,e),t.prototype.serialize=function(e,t){void 0===t&&(t={});var r=this.getColumnsToExport(t.allColumns,t.columnKeys);return o._.compose(this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t))(e).parse()},t.prototype.processRow=function(e,t,r,n){var i=this,s=t.shouldRowBeSkipped||function(){return!1},p=this.gridOptionsWrapper,u=p.getContext(),a=p.getApi(),l=p.getColumnApi(),c=p.isGroupRemoveSingleChildren(),d=p.isGroupHideOpenParents(),f=p.isGroupRemoveLowestSingleChildren(),h=this.columnModel.isPivotMode()?n.leafGroup:!n.group,g=t.skipGroups||t.skipRowGroups,m=f&&n.leafGroup,v=1===n.allChildrenCount&&(c||m);g&&t.skipGroups&&o._.doOnce((function(){return console.warn("AG Grid: Since v25.2 `skipGroups` has been renamed to `skipRowGroups`.")}),"gridSerializer-skipGroups");var y={rowIndex:n.rowIndex,rowPinned:n.rowPinned};if(!(!h&&(t.skipRowGroups||v||d)||t.onlySelected&&!n.isSelected()||t.rowNodes&&!t.rowNodes.some((function(e){return i.rowPositionUtils.sameRow(e,y)}))||t.skipPinnedTop&&"top"===n.rowPinned||t.skipPinnedBottom&&"bottom"===n.rowPinned)&&((!(-1===n.level)||n.leafGroup)&&!s({node:n,api:a,context:u}))){var w=e.onNewBodyRow();if(r.forEach((function(e,t){w.onColumn(e,t,n)})),t.getCustomContentBelowRow){var C=t.getCustomContentBelowRow({node:n,api:a,columnApi:l,context:u});C&&e.addCustomContent(C)}}},t.prototype.appendContent=function(e){return function(t){var r=e.customFooter||e.appendContent;return r&&(e.customFooter&&o._.doOnce((function(){return console.warn("AG Grid: Since version 25.2.0 the `customFooter` param has been deprecated. Use `appendContent` instead.")}),"gridSerializer-customFooter"),t.addCustomContent(r)),t}},t.prototype.prependContent=function(e){return function(t){var r=e.customHeader||e.prependContent;return r&&(e.customHeader&&o._.doOnce((function(){return console.warn("AG Grid: Since version 25.2.0 the `customHeader` param has been deprecated. Use `prependContent` instead.")}),"gridSerializer-customHeader"),t.addCustomContent(r)),t}},t.prototype.prepareSession=function(e){return function(t){return t.prepare(e),t}},t.prototype.exportColumnGroups=function(e,t){var r=this;return function(n){if(e.skipColumnGroupHeaders)e.columnGroups&&o._.doOnce((function(){return console.warn("AG Grid: Since v25.2 the `columnGroups` param has deprecated, and groups are exported by default.")}),"gridSerializer-columnGroups");else{var i=new o.GroupInstanceIdCreator,s=r.displayedGroupCreator.createDisplayedGroups(t,r.columnModel.getGridBalancedTree(),i,null);r.recursivelyAddHeaderGroups(s,n,e.processGroupHeaderCallback)}return n}},t.prototype.exportHeaders=function(e,t){return function(r){if(e.skipHeader||e.skipColumnHeaders)e.skipHeader&&o._.doOnce((function(){return console.warn("AG Grid: Since v25.2 the `skipHeader` param has been renamed to `skipColumnHeaders`.")}),"gridSerializer-skipHeader");else{var n=r.onNewHeaderRow();t.forEach((function(e,t){n.onColumn(e,t,void 0)}))}return r}},t.prototype.processPinnedTopRows=function(e,t){var o=this;return function(r){var n=o.processRow.bind(o,r,e,t);return o.pinnedRowModel.forEachPinnedTopRow(n),r}},t.prototype.processRows=function(e,t){var r=this;return function(n){var i=r.rowModel,s=i.getType(),p=s===o.Constants.ROW_MODEL_TYPE_CLIENT_SIDE,u=s===o.Constants.ROW_MODEL_TYPE_SERVER_SIDE,a=!p&&e.onlySelected,l=r.processRow.bind(r,n,e,t);r.columnModel.isPivotMode()?p?i.forEachPivotNode(l):i.forEachNode(l):e.onlySelectedAllPages||a?r.selectionService.getSelectedNodes().forEach(l):p||u?i.forEachNodeAfterFilterAndSort(l):i.forEachNode(l);return n}},t.prototype.processPinnedBottomRows=function(e,t){var o=this;return function(r){var n=o.processRow.bind(o,r,e,t);return o.pinnedRowModel.forEachPinnedBottomRow(n),r}},t.prototype.getColumnsToExport=function(e,t){void 0===e&&(e=!1);var r=this.columnModel.isPivotMode();return t&&t.length?this.columnModel.getGridColumns(t):e&&!r?(this.gridOptionsWrapper.isTreeData()?this.columnModel.getGridColumns([o.Constants.GROUP_AUTO_COLUMN_ID]):[]).concat(this.columnModel.getAllPrimaryColumns()||[]):this.columnModel.getAllDisplayedColumns()},t.prototype.recursivelyAddHeaderGroups=function(e,t,r){var n=[];e.forEach((function(e){var t=e;t.getChildren&&t.getChildren().forEach((function(e){return n.push(e)}))})),e.length>0&&e[0]instanceof o.ColumnGroup&&this.doAddHeaderHeader(t,e,r),n&&n.length>0&&this.recursivelyAddHeaderGroups(n,t,r)},t.prototype.doAddHeaderHeader=function(e,t,r){var n=this,i=e.onNewHeaderGroupingRow(),s=0;t.forEach((function(e){var t,p=e;t=r?r({columnGroup:p,api:n.gridOptionsWrapper.getApi(),columnApi:n.gridOptionsWrapper.getColumnApi(),context:n.gridOptionsWrapper.getContext()}):n.columnModel.getDisplayNameForColumnGroup(p,"header");var u=p.getLeafColumns().reduce((function(e,t,r,n){var i=o._.last(e);return"open"===t.getColumnGroupShow()?i&&null==i[1]||(i=[r],e.push(i)):i&&null==i[1]&&(i[1]=r-1),r===n.length-1&&i&&null==i[1]&&(i[1]=r),e}),[]);i.onColumn(t||"",s++,p.getLeafColumns().length-1,u)}))},d([o.Autowired("displayedGroupCreator")],t.prototype,"displayedGroupCreator",void 0),d([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),d([o.Autowired("rowModel")],t.prototype,"rowModel",void 0),d([o.Autowired("pinnedRowModel")],t.prototype,"pinnedRowModel",void 0),d([o.Autowired("selectionService")],t.prototype,"selectionService",void 0),d([o.Autowired("rowPositionUtils")],t.prototype,"rowPositionUtils",void 0),t=d([o.Bean("gridSerializer")],t)}(o.BeanStub),h={moduleName:o.ModuleNames.CsvExportModule,beans:[l,f]},g=function(){function e(){}return e.createHeader=function(e){void 0===e&&(e={});var t=["version"];return e.version||(e.version="1.0"),e.encoding&&t.push("encoding"),e.standalone&&t.push("standalone"),"<?xml "+t.map((function(t){return t+'="'+e[t]+'"'})).join(" ")+" ?>"},e.createXml=function(e,t){var o=this,r="";e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach((function(e){Object.keys(e.map).forEach((function(n){r+=o.returnAttributeIfPopulated(e.prefix+n,e.map[n],t)}))})),e.properties.rawMap&&Object.keys(e.properties.rawMap).forEach((function(n){r+=o.returnAttributeIfPopulated(n,e.properties.rawMap[n],t)})));var n="<"+e.name+r;return e.children||null!=e.textNode?null!=e.textNode?n+">"+e.textNode+"</"+e.name+">\r\n":(n+=">\r\n",e.children&&e.children.forEach((function(e){n+=o.createXml(e,t)})),n+"</"+e.name+">\r\n"):n+"/>\r\n"},e.returnAttributeIfPopulated=function(e,t,o){if(!t&&""!==t&&0!==t)return"";var r=t;return"boolean"==typeof t&&o&&(r=o(t))," "+e+'="'+r+'"'},e}(),m=function(e){var t="function"==typeof Symbol&&Symbol.iterator,o=t&&e[t],r=0;if(o)return o.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},v=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),y=function(){function e(){}return e.addFolders=function(e){e.forEach(this.addFolder.bind(this))},e.addFolder=function(e){this.folders.push({path:e,created:new Date,isBase64:!1})},e.addFile=function(e,t,o){void 0===o&&(o=!1),this.files.push({path:e,created:new Date,content:t,isBase64:o})},e.getContent=function(e){void 0===e&&(e="application/zip");var t=this.buildFileStream(),o=this.buildUint8Array(t);return this.clearStream(),new Blob([o],{type:e})},e.clearStream=function(){this.folders=[],this.files=[]},e.buildFileStream=function(e){var t,o;void 0===e&&(e="");var r=this.folders.concat(this.files),n=r.length,i="",s=0,p=0;try{for(var u=m(r),a=u.next();!a.done;a=u.next()){var l=a.value,c=this.getHeader(l,s),d=c.fileHeader,f=c.folderHeader,h=c.content;s+=d.length+h.length,p+=f.length,e+=d+h,i+=f}}catch(e){t={error:e}}finally{try{a&&!a.done&&(o=u.return)&&o.call(u)}finally{if(t)throw t.error}}return e+i+this.buildFolderEnd(n,p,s)},e.getHeader=function(e,t){var r=e.content,n=e.path,i=e.created,s=e.isBase64,p=o._.utf8_encode,u=o._.decToHex,a=p(n),l=a!==n,c=this.convertTime(i),d=this.convertDate(i),f="";if(l){var h=u(1,1)+u(this.getFromCrc32Table(a),4)+a;f="up"+u(h.length,2)+h}var g=r?this.getConvertedContent(r,s):{size:0,content:""},m=g.size,v=g.content,y="\n\0"+(l?"\0\b":"\0\0")+"\0\0"+u(c,2)+u(d,2)+u(m?this.getFromCrc32Table(v):0,4)+u(m,4)+u(m,4)+u(a.length,2)+u(f.length,2);return{fileHeader:"PK\x03\x04"+y+a+f,folderHeader:"PK\x01\x02\x14\0"+y+"\0\0\0\0\0\0"+(r?"\0\0\0\0":"\x10\0\0\0")+u(t,4)+a+f,content:v||""}},e.getConvertedContent=function(e,t){return void 0===t&&(t=!1),t&&(e=e.split(";base64,")[1]),{size:(e=t?atob(e):e).length,content:e}},e.buildFolderEnd=function(e,t,r){var n=o._.decToHex;return"PK\x05\x06\0\0\0\0"+n(e,2)+n(e,2)+n(t,4)+n(r,4)+"\0\0"},e.buildUint8Array=function(e){for(var t=new Uint8Array(e.length),o=0;o<t.length;o++)t[o]=e.charCodeAt(o);return t},e.getFromCrc32Table=function(e){if(!e.length)return 0;for(var t=e.length,o=new Uint8Array(t),r=0;r<t;r++)o[r]=e.charCodeAt(r);var n=-1,i=0;for(r=0;r<t;r++)i=o[r],n=n>>>8^v[255&(n^i)];return-1^n},e.convertTime=function(e){var t=e.getHours();return t<<=6,t|=e.getMinutes(),t<<=5,t|=e.getSeconds()/2},e.convertDate=function(e){var t=e.getFullYear()-1980;return t<<=4,t|=e.getMonth()+1,t<<=5,t|=e.getDate()},e.folders=[],e.files=[],e}();exports.BaseCreator=r,exports.BaseGridSerializingSession=n,exports.CsvCreator=l,exports.CsvExportModule=h,exports.Downloader=i,exports.GridSerializer=f,exports.XmlFactory=g,exports.ZipContainer=y;
{
"name": "@ag-grid-community/csv-export",
"version": "26.2.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components",
"main": "./dist/cjs/main.js",
"module": "./dist/es6/main.js",
"types": "./dist/cjs/main.d.ts",
"version": "27.0.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",
"main": "./dist/cjs/es5/main.js",
"module": "./dist/esm/es5/main.js",
"types": "./dist/cjs/es5/main.d.ts",
"scripts": {
"build-cjs": "npx tsc -p tsconfig.json",
"build-es6": "npx tsc -p tsconfig.es6.json",
"build-cjs": "npx tsc -p tsconfig.cjs.es5.json && npx tsc -p tsconfig.cjs.es6.json",
"build-esm": "npx tsc -p tsconfig.esm.es5.json && npx tsc -p tsconfig.esm.es6.json",
"package": "node ../../module-build/rollup/build.js",
"build": "npm run build-cjs && npm run build-es6 && npx tsc -p tsconfig.typings.json && npm run hash",
"build": "npm run build-cjs && npm run build-esm && npx tsc -p tsconfig.typings.json && npm run hash",
"hash": "sh ../../scripts/hashDirectory.sh > .hash"

@@ -28,4 +28,5 @@ },

"react-component",
"angularjs",
"reactjs"
"reactjs",
"vue",
"vuejs"
],

@@ -40,4 +41,4 @@ "author": "Sean Landsman <sean@thelandsmans.com>",

"last 2 versions",
"not ie <= 10",
"not ie_mob <= 11",
"not ie >= 0",
"not ie_mob >= 0",
"not blackberry > 0"

@@ -47,6 +48,6 @@ ],

"dependencies": {
"@ag-grid-community/core": "~26.2.0"
"@ag-grid-community/core": "~27.0.0"
},
"devDependencies": {
"typescript": "~3.6.5"
"typescript": "~3.7.7"
},

@@ -53,0 +54,0 @@ "publishConfig": {

{
"extends": "./tsconfig.json",
"extends": "./tsconfig.cjs.es5.json",
"compilerOptions": {

@@ -4,0 +4,0 @@ "declaration": true,

@@ -7,11 +7,6 @@ import { ExportParams } from "@ag-grid-community/core";

abstract export(userParams?: P): string;
protected abstract getDefaultExportParams(): P | undefined;
protected abstract getMergedParams(params?: P): P;
protected getFileName(fileName?: string): string;
protected getMergedParamsAndData(userParams?: P): {
mergedParams: P;
data: string;
};
private mergeDefaultParams;
protected getData(params: P): string;
abstract createSerializingSession(params?: P): S;
abstract getMimeType(): string;
abstract getDefaultFileName(): string;

@@ -18,0 +13,0 @@ abstract getDefaultFileExtension(): string;

@@ -10,7 +10,6 @@ import { CsvCustomContent, CsvExportParams, GridOptionsWrapper, ICsvCreator } from "@ag-grid-community/core";

postConstruct(): void;
protected getDefaultExportParams(): CsvExportParams | undefined;
protected getMergedParams(params?: CsvExportParams): CsvExportParams;
export(userParams?: CsvExportParams): string;
exportDataAsCsv(params?: CsvExportParams): string;
getDataAsCsv(params?: CsvExportParams): string;
getMimeType(): string;
getDefaultFileName(): string;

@@ -17,0 +16,0 @@ getDefaultFileExtension(): string;

@@ -14,2 +14,3 @@ import { BeanStub, ExportParams } from "@ag-grid-community/core";

private selectionService;
private rowPositionUtils;
serialize<T>(gridSerializingSession: GridSerializingSession<T>, params?: ExportParams<T>): string;

@@ -16,0 +17,0 @@ private processRow;

@@ -11,3 +11,3 @@ import { Column, ColumnModel, GridOptionsWrapper, ProcessCellForExportParams, ProcessGroupHeaderForExportParams, ProcessHeaderForExportParams, ProcessRowGroupForExportParams, RowNode, ValueService } from "@ag-grid-community/core";

export interface RowSpanningAccumulator {
onColumn(header: string, index: number, span: number): void;
onColumn(header: string, index: number, span: number, collapsibleGroupRanges: number[][]): void;
}

@@ -14,0 +14,0 @@ export interface GridSerializingParams {

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc