Socket
Socket
Sign inDemoInstall

@ag-grid-community/csv-export

Package Overview
Dependencies
2
Maintainers
3
Versions
61
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 31.2.1 to 31.3.0

72

dist/package/main.cjs.js

@@ -108,5 +108,3 @@ var __defProp = Object.defineProperty;

valueService,
gridOptionsService,
valueFormatterService,
valueParserService,
gos,
processCellCallback,

@@ -119,5 +117,3 @@ processHeaderCallback,

this.valueService = valueService;
this.gridOptionsService = gridOptionsService;
this.valueFormatterService = valueFormatterService;
this.valueParserService = valueParserService;
this.gos = gos;
this.processCellCallback = processCellCallback;

@@ -136,3 +132,3 @@ this.processHeaderCallback = processHeaderCallback;

extractRowCellValue(column, index, accumulatedRowIndex, type, node) {
const hideOpenParents = this.gridOptionsService.get("groupHideOpenParents");
const hideOpenParents = this.gos.get("groupHideOpenParents");
const value = (!hideOpenParents || node.footer) && this.shouldRenderGroupSummaryCell(node, column, index) ? this.createValueForGroupNode(column, node) : this.valueService.getValue(column, node);

@@ -160,3 +156,3 @@ const processedValue = this.processCell({

}
if (this.gridOptionsService.isRowModelType("serverSide") && node.group) {
if (this.gos.isRowModelType("serverSide") && node.group) {
return true;

@@ -170,3 +166,3 @@ }

}
const isGroupUseEntireRow = this.gridOptionsService.isGroupUseEntireRow(this.columnModel.isPivotMode());
const isGroupUseEntireRow = this.gos.isGroupUseEntireRow(this.columnModel.isPivotMode());
return currentColumnIndex === 0 && isGroupUseEntireRow;

@@ -176,3 +172,3 @@ }

if (callback) {
return callback(this.gridOptionsService.addGridCommonParams({ column }));
return callback(this.gos.addGridCommonParams({ column }));
}

@@ -183,6 +179,6 @@ return this.columnModel.getDisplayNameForColumn(column, "csv", true);

if (this.processRowGroupCallback) {
return this.processRowGroupCallback(this.gridOptionsService.addGridCommonParams({ column, node }));
return this.processRowGroupCallback(this.gos.addGridCommonParams({ column, node }));
}
const isTreeData = this.gridOptionsService.get("treeData");
const isSuppressGroupMaintainValueType = this.gridOptionsService.get("suppressGroupMaintainValueType");
const isTreeData = this.gos.get("treeData");
const isSuppressGroupMaintainValueType = this.gos.get("suppressGroupMaintainValueType");
const getValueFromNode = (node2) => {

@@ -197,7 +193,7 @@ var _a, _b;

}
return (_b = this.valueFormatterService.formatValue(node2.rowGroupColumn, node2, value)) != null ? _b : value;
return (_b = this.valueService.formatValue(node2.rowGroupColumn, node2, value)) != null ? _b : value;
};
const isFooter = node.footer;
const keys = [getValueFromNode(node)];
if (!this.gridOptionsService.isGroupMultiAutoColumn()) {
if (!this.gos.isGroupMultiAutoColumn()) {
while (node.parent) {

@@ -216,3 +212,3 @@ node = node.parent;

return {
value: (_a = processCellCallback(this.gridOptionsService.addGridCommonParams({
value: (_a = processCellCallback(this.gos.addGridCommonParams({
accumulatedRowIndex,

@@ -223,6 +219,6 @@ column,

type,
parseValue: (valueToParse) => this.valueParserService.parseValue(column, rowNode, valueToParse, this.valueService.getValue(column, rowNode)),
parseValue: (valueToParse) => this.valueService.parseValue(column, rowNode, valueToParse, this.valueService.getValue(column, rowNode)),
formatValue: (valueToFormat) => {
var _a2;
return (_a2 = this.valueFormatterService.formatValue(column, rowNode, valueToFormat)) != null ? _a2 : valueToFormat;
return (_a2 = this.valueService.formatValue(column, rowNode, valueToFormat)) != null ? _a2 : valueToFormat;
}

@@ -235,3 +231,3 @@ }))) != null ? _a : ""

value: value != null ? value : "",
valueFormatted: this.valueFormatterService.formatValue(column, rowNode, value)
valueFormatted: this.valueService.formatValue(column, rowNode, value)
};

@@ -387,7 +383,7 @@ }

gridSerializer: this.gridSerializer,
gridOptionsService: this.gridOptionsService
gos: this.gos
});
}
getMergedParams(params) {
const baseParams = this.gridOptionsService.get("defaultCsvExportParams");
const baseParams = this.gos.get("defaultCsvExportParams");
return Object.assign({}, baseParams, params);

@@ -403,3 +399,3 @@ }

const packagedFile = new Blob(["\uFEFF", data], { type: "text/plain" });
const fileName = typeof mergedParams.fileName === "function" ? mergedParams.fileName(this.gridOptionsService.getGridCommonParams()) : mergedParams.fileName;
const fileName = typeof mergedParams.fileName === "function" ? mergedParams.fileName(this.gos.getGridCommonParams()) : mergedParams.fileName;
Downloader.download(this.getFileName(fileName), packagedFile);

@@ -418,3 +414,3 @@ }

createSerializingSession(params) {
const { columnModel, valueService, gridOptionsService, valueFormatterService, valueParserService } = this;
const { columnModel, valueService, gos } = this;
const {

@@ -431,5 +427,3 @@ processCellCallback,

valueService,
gridOptionsService,
valueFormatterService,
valueParserService,
gos,
processCellCallback: processCellCallback || void 0,

@@ -444,3 +438,3 @@ processHeaderCallback: processHeaderCallback || void 0,

isExportSuppressed() {
return this.gridOptionsService.get("suppressCsvExport");
return this.gos.get("suppressCsvExport");
}

@@ -459,10 +453,4 @@ };

(0, import_core.Autowired)("gridOptionsService")
], CsvCreator.prototype, "gridOptionsService", 2);
], CsvCreator.prototype, "gos", 2);
__decorateClass([
(0, import_core.Autowired)("valueFormatterService")
], CsvCreator.prototype, "valueFormatterService", 2);
__decorateClass([
(0, import_core.Autowired)("valueParserService")
], CsvCreator.prototype, "valueParserService", 2);
__decorateClass([
import_core.PostConstruct

@@ -504,7 +492,7 @@ ], CsvCreator.prototype, "postConstruct", 1);

const rowSkipper = params.shouldRowBeSkipped || (() => false);
const skipSingleChildrenGroup = this.gridOptionsService.get("groupRemoveSingleChildren");
const skipLowestSingleChildrenGroup = this.gridOptionsService.get("groupRemoveLowestSingleChildren");
const skipSingleChildrenGroup = this.gos.get("groupRemoveSingleChildren");
const skipLowestSingleChildrenGroup = this.gos.get("groupRemoveLowestSingleChildren");
const isClipboardExport = params.rowPositions != null;
const isExplicitExportSelection = isClipboardExport || !!params.onlySelected;
const hideOpenParents = this.gridOptionsService.get("groupHideOpenParents") && !isExplicitExportSelection;
const hideOpenParents = this.gos.get("groupHideOpenParents") && !isExplicitExportSelection;
const isLeafNode = this.columnModel.isPivotMode() ? node.leafGroup : !node.group;

@@ -522,3 +510,3 @@ const isFooter = !!node.footer;

}
const shouldRowBeSkipped = rowSkipper(this.gridOptionsService.addGridCommonParams({ node }));
const shouldRowBeSkipped = rowSkipper(this.gos.addGridCommonParams({ node }));
if (shouldRowBeSkipped) {

@@ -532,3 +520,3 @@ return;

if (params.getCustomContentBelowRow) {
const content = params.getCustomContentBelowRow(this.gridOptionsService.addGridCommonParams({ node }));
const content = params.getCustomContentBelowRow(this.gos.addGridCommonParams({ node }));
if (content) {

@@ -682,3 +670,3 @@ gridSerializingSession.addCustomContent(content);

}
const isTreeData = this.gridOptionsService.get("treeData");
const isTreeData = this.gos.get("treeData");
let columnsToExport = [];

@@ -718,3 +706,3 @@ if (allColumns && !isPivotMode) {

if (processGroupHeaderCallback) {
name = processGroupHeaderCallback(this.gridOptionsService.addGridCommonParams({
name = processGroupHeaderCallback(this.gos.addGridCommonParams({
columnGroup

@@ -771,3 +759,3 @@ }));

// community-modules/csv-export/src/version.ts
var VERSION = "31.2.1";
var VERSION = "31.3.0";

@@ -774,0 +762,0 @@ // community-modules/csv-export/src/csvExportModule.ts

@@ -1,3 +0,3 @@

var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__export=(e,t)=>{for(var r in t)__defProp(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of __getOwnPropNames(t))!__hasOwnProp.call(e,s)&&s!==r&&__defProp(e,s,{get:()=>t[s],enumerable:!(o=__getOwnPropDesc(t,s))||o.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__decorateClass=(e,t,r,o)=>{for(var s=o>1?void 0:o?__getOwnPropDesc(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(s=(o?i(t,r,s):i(s))||s);return o&&s&&__defProp(t,r,s),s},__async=(e,t,r)=>new Promise((o,s)=>{var n=l=>{try{a(r.next(l))}catch(u){s(u)}},i=l=>{try{a(r.throw(l))}catch(u){s(u)}},a=l=>l.done?o(l.value):Promise.resolve(l.value).then(n,i);a((r=r.apply(e,t)).next())}),main_exports={};__export(main_exports,{BaseCreator:()=>BaseCreator,BaseGridSerializingSession:()=>BaseGridSerializingSession,CsvCreator:()=>CsvCreator,CsvExportModule:()=>CsvExportModule,Downloader:()=>Downloader,GridSerializer:()=>GridSerializer,RowType:()=>RowType,XmlFactory:()=>XmlFactory,ZipContainer:()=>ZipContainer}),module.exports=__toCommonJS(main_exports);var BaseCreator=class{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return(e==null||!e.length)&&(e=this.getDefaultFileName()),e.indexOf(".")===-1?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},BaseGridSerializingSession=class{constructor(e){this.groupColumns=[];const{columnModel:t,valueService:r,gridOptionsService:o,valueFormatterService:s,valueParserService:n,processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:u}=e;this.columnModel=t,this.valueService=r,this.gridOptionsService=o,this.valueFormatterService=s,this.valueParserService=n,this.processCellCallback=i,this.processHeaderCallback=a,this.processGroupHeaderCallback=l,this.processRowGroupCallback=u}prepare(e){this.groupColumns=e.filter(t=>!!t.getColDef().showRowGroup)}extractHeaderValue(e){const t=this.getHeaderName(this.processHeaderCallback,e);return t??""}extractRowCellValue(e,t,r,o,s){const i=(!this.gridOptionsService.get("groupHideOpenParents")||s.footer)&&this.shouldRenderGroupSummaryCell(s,e,t)?this.createValueForGroupNode(e,s):this.valueService.getValue(e,s);return this.processCell({accumulatedRowIndex:r,rowNode:s,column:e,value:i,processCellCallback:this.processCellCallback,type:o})}shouldRenderGroupSummaryCell(e,t,r){var o;if(!(e&&e.group))return!1;if(this.groupColumns.indexOf(t)!==-1){if(((o=e.groupData)==null?void 0:o[t.getId()])!=null||this.gridOptionsService.isRowModelType("serverSide")&&e.group)return!0;if(e.footer&&e.level===-1){const a=t.getColDef();return a==null||a.showRowGroup===!0||a.showRowGroup===this.columnModel.getRowGroupColumns()[0].getId()}}const i=this.gridOptionsService.isGroupUseEntireRow(this.columnModel.isPivotMode());return r===0&&i}getHeaderName(e,t){return e?e(this.gridOptionsService.addGridCommonParams({column:t})):this.columnModel.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gridOptionsService.addGridCommonParams({column:e,node:t}));const r=this.gridOptionsService.get("treeData"),o=this.gridOptionsService.get("suppressGroupMaintainValueType"),s=l=>{var u,c;if(r||o)return l.key;const p=(u=l.groupData)==null?void 0:u[e.getId()];return!p||!l.rowGroupColumn||l.rowGroupColumn.getColDef().useValueFormatterForExport===!1?p:(c=this.valueFormatterService.formatValue(l.rowGroupColumn,l,p))!=null?c:p},n=t.footer,i=[s(t)];if(!this.gridOptionsService.isGroupMultiAutoColumn())for(;t.parent;)t=t.parent,i.push(s(t));const a=i.reverse().join(" -> ");return n?`Total ${a}`:a}processCell(e){var t;const{accumulatedRowIndex:r,rowNode:o,column:s,value:n,processCellCallback:i,type:a}=e;return i?{value:(t=i(this.gridOptionsService.addGridCommonParams({accumulatedRowIndex:r,column:s,node:o,value:n,type:a,parseValue:l=>this.valueParserService.parseValue(s,o,l,this.valueService.getValue(s,o)),formatValue:l=>{var u;return(u=this.valueFormatterService.formatValue(s,o,l))!=null?u:l}})))!=null?t:""}:s.getColDef().useValueFormatterForExport!==!1?{value:n??"",valueFormatted:this.valueFormatterService.formatValue(s,o,n)}:{value:n??""}}},import_core=require("@ag-grid-community/core"),Downloader=class{static download(e,t){const r=document.defaultView||window;if(!r){console.warn("AG Grid: There is no `window` associated with the current `document`");return}const o=document.createElement("a"),s=r.URL.createObjectURL(t);o.setAttribute("href",s),o.setAttribute("download",e),o.style.display="none",document.body.appendChild(o),o.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:r})),document.body.removeChild(o),r.setTimeout(()=>{r.URL.revokeObjectURL(s)},0)}},LINE_SEPARATOR=`\r
`,CsvSerializingSession=class extends BaseGridSerializingSession{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:r}=e;this.suppressQuotes=t,this.columnSeparator=r}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,LINE_SEPARATOR),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((r,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(r.data.value||""),r.mergeAcross&&this.appendEmptyCells(r.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,r,o){r!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,r){var o;t!=0&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",r);this.result+=this.putInQuotes((o=s.valueFormatted)!=null?o:s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(console.warn("AG Grid: unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=LINE_SEPARATOR),this.isFirstLine=!1}},CsvCreator=class extends BaseCreator{postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gridOptionsService:this.gridOptionsService})}getMergedParams(e){const t=this.gridOptionsService.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration.");return}const t=this.getMergedParams(e),r=this.getData(t),o=new Blob(["\uFEFF",r],{type:"text/plain"}),s=typeof t.fileName=="function"?t.fileName(this.gridOptionsService.getGridCommonParams()):t.fileName;Downloader.download(this.getFileName(s),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const r=t?Object.assign({},e):this.getMergedParams(e);return this.getData(r)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,valueService:r,gridOptionsService:o,valueFormatterService:s,valueParserService:n}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:u,suppressQuotes:c,columnSeparator:p}=e;return new CsvSerializingSession({columnModel:t,valueService:r,gridOptionsService:o,valueFormatterService:s,valueParserService:n,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:u||void 0,suppressQuotes:c||!1,columnSeparator:p||","})}isExportSuppressed(){return this.gridOptionsService.get("suppressCsvExport")}};__decorateClass([(0,import_core.Autowired)("columnModel")],CsvCreator.prototype,"columnModel",2),__decorateClass([(0,import_core.Autowired)("valueService")],CsvCreator.prototype,"valueService",2),__decorateClass([(0,import_core.Autowired)("gridSerializer")],CsvCreator.prototype,"gridSerializer",2),__decorateClass([(0,import_core.Autowired)("gridOptionsService")],CsvCreator.prototype,"gridOptionsService",2),__decorateClass([(0,import_core.Autowired)("valueFormatterService")],CsvCreator.prototype,"valueFormatterService",2),__decorateClass([(0,import_core.Autowired)("valueParserService")],CsvCreator.prototype,"valueParserService",2),__decorateClass([import_core.PostConstruct],CsvCreator.prototype,"postConstruct",1),CsvCreator=__decorateClass([(0,import_core.Bean)("csvCreator")],CsvCreator);var import_core3=require("@ag-grid-community/core"),import_core2=require("@ag-grid-community/core"),RowType=(e=>(e[e.HEADER_GROUPING=0]="HEADER_GROUPING",e[e.HEADER=1]="HEADER",e[e.BODY=2]="BODY",e))(RowType||{}),GridSerializer=class extends import_core2.BeanStub{serialize(e,t={}){const{allColumns:r,columnKeys:o,skipRowGroups:s}=t,n=this.getColumnsToExport(r,s,o);return import_core2._.compose(this.prepareSession(n),this.prependContent(t),this.exportColumnGroups(t,n),this.exportHeaders(t,n),this.processPinnedTopRows(t,n),this.processRows(t,n),this.processPinnedBottomRows(t,n),this.appendContent(t))(e).parse()}processRow(e,t,r,o){const s=t.shouldRowBeSkipped||(()=>!1),n=this.gridOptionsService.get("groupRemoveSingleChildren"),i=this.gridOptionsService.get("groupRemoveLowestSingleChildren"),l=t.rowPositions!=null||!!t.onlySelected,u=this.gridOptionsService.get("groupHideOpenParents")&&!l,c=this.columnModel.isPivotMode()?o.leafGroup:!o.group,p=!!o.footer,h=t.skipRowGroups,d=i&&o.leafGroup,v=o.allChildrenCount===1&&(n||d);if(!c&&!p&&(t.skipRowGroups||v||u)||t.onlySelected&&!o.isSelected()||t.skipPinnedTop&&o.rowPinned==="top"||t.skipPinnedBottom&&o.rowPinned==="bottom"||o.level===-1&&!c&&!p||s(this.gridOptionsService.addGridCommonParams({node:o})))return;const m=e.onNewBodyRow(o);if(r.forEach((g,f)=>{m.onColumn(g,f,o)}),t.getCustomContentBelowRow){const g=t.getCustomContentBelowRow(this.gridOptionsService.addGridCommonParams({node:o}));g&&e.addCustomContent(g)}}appendContent(e){return t=>{const r=e.appendContent;return r&&t.addCustomContent(r),t}}prependContent(e){return t=>{const r=e.prependContent;return r&&t.addCustomContent(r),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return r=>{if(!e.skipColumnGroupHeaders){const o=new import_core2.GroupInstanceIdCreator,s=this.displayedGroupCreator.createDisplayedGroups(t,o,null);this.recursivelyAddHeaderGroups(s,r,e.processGroupHeaderCallback)}return r}}exportHeaders(e,t){return r=>{if(!e.skipColumnHeaders){const o=r.onNewHeaderRow();t.forEach((s,n)=>{o.onColumn(s,n,void 0)})}return r}}processPinnedTopRows(e,t){return r=>{const o=this.processRow.bind(this,r,e,t);return e.rowPositions?e.rowPositions.filter(s=>s.rowPinned==="top").sort((s,n)=>s.rowIndex-n.rowIndex).map(s=>this.pinnedRowModel.getPinnedTopRow(s.rowIndex)).forEach(o):this.pinnedRowModel.forEachPinnedTopRow(o),r}}processRows(e,t){return r=>{const o=this.rowModel,s=o.getType(),n=s==="clientSide",i=s==="serverSide",a=!n&&e.onlySelected,l=this.processRow.bind(this,r,e,t),{exportedRows:u="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(c=>c.rowPinned==null).sort((c,p)=>c.rowIndex-p.rowIndex).map(c=>o.getRow(c.rowIndex)).forEach(l);else if(this.columnModel.isPivotMode())n?o.forEachPivotNode(l,!0):i?o.forEachNodeAfterFilterAndSort(l,!0):o.forEachNode(l);else if(e.onlySelectedAllPages||a){const c=this.selectionService.getSelectedNodes();this.replicateSortedOrder(c),c.forEach(l)}else u==="all"?o.forEachNode(l):n||i?o.forEachNodeAfterFilterAndSort(l,!0):o.forEachNode(l);return r}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),r=(o,s)=>{var n,i,a,l;return o.rowIndex!=null&&s.rowIndex!=null?o.rowIndex-s.rowIndex:o.level===s.level?((n=o.parent)==null?void 0:n.id)===((i=s.parent)==null?void 0:i.id)?this.rowNodeSorter.compareRowNodes(t,{rowNode:o,currentPos:(a=o.rowIndex)!=null?a:-1},{rowNode:s,currentPos:(l=s.rowIndex)!=null?l:-1}):r(o.parent,s.parent):o.level>s.level?r(o.parent,s):r(o,s.parent)};e.sort(r)}processPinnedBottomRows(e,t){return r=>{const o=this.processRow.bind(this,r,e,t);return e.rowPositions?e.rowPositions.filter(s=>s.rowPinned==="bottom").sort((s,n)=>s.rowIndex-n.rowIndex).map(s=>this.pinnedRowModel.getPinnedBottomRow(s.rowIndex)).forEach(o):this.pinnedRowModel.forEachPinnedBottomRow(o),r}}getColumnsToExport(e=!1,t=!1,r){const o=this.columnModel.isPivotMode();if(r&&r.length)return this.columnModel.getGridColumns(r);const s=this.gridOptionsService.get("treeData");let n=[];return e&&!o?n=this.columnModel.getAllGridColumns():n=this.columnModel.getAllDisplayedColumns(),t&&!s&&(n=n.filter(i=>i.getColId()!==import_core2.GROUP_AUTO_COLUMN_ID)),n}recursivelyAddHeaderGroups(e,t,r){const o=[];e.forEach(s=>{const n=s;n.getChildren&&n.getChildren().forEach(i=>o.push(i))}),e.length>0&&e[0]instanceof import_core2.ColumnGroup&&this.doAddHeaderHeader(t,e,r),o&&o.length>0&&this.recursivelyAddHeaderGroups(o,t,r)}doAddHeaderHeader(e,t,r){const o=e.onNewHeaderGroupingRow();let s=0;t.forEach(n=>{const i=n;let a;r?a=r(this.gridOptionsService.addGridCommonParams({columnGroup:i})):a=this.columnModel.getDisplayNameForColumnGroup(i,"header");const l=i.getLeafColumns().reduce((u,c,p,h)=>{let d=import_core2._.last(u);return c.getColumnGroupShow()==="open"?(!d||d[1]!=null)&&(d=[p],u.push(d)):d&&d[1]==null&&(d[1]=p-1),p===h.length-1&&d&&d[1]==null&&(d[1]=p),u},[]);o.onColumn(i,a||"",s++,i.getLeafColumns().length-1,l)})}};__decorateClass([(0,import_core2.Autowired)("displayedGroupCreator")],GridSerializer.prototype,"displayedGroupCreator",2),__decorateClass([(0,import_core2.Autowired)("columnModel")],GridSerializer.prototype,"columnModel",2),__decorateClass([(0,import_core2.Autowired)("rowModel")],GridSerializer.prototype,"rowModel",2),__decorateClass([(0,import_core2.Autowired)("pinnedRowModel")],GridSerializer.prototype,"pinnedRowModel",2),__decorateClass([(0,import_core2.Autowired)("selectionService")],GridSerializer.prototype,"selectionService",2),__decorateClass([(0,import_core2.Autowired)("rowNodeSorter")],GridSerializer.prototype,"rowNodeSorter",2),__decorateClass([(0,import_core2.Autowired)("sortController")],GridSerializer.prototype,"sortController",2),GridSerializer=__decorateClass([(0,import_core2.Bean)("gridSerializer")],GridSerializer);var VERSION="31.2.1",CsvExportModule={version:VERSION,moduleName:import_core3.ModuleNames.CsvExportModule,beans:[CsvCreator,GridSerializer]},LINE_SEPARATOR2=`\r
`,XmlFactory=class{static createHeader(e={}){const t="<?",r="?>",o=["version"];e.version||(e.version="1.0"),e.encoding&&o.push("encoding"),e.standalone&&o.push("standalone");const s=o.map(n=>`${n}="${e[n]}"`).join(" ");return`${t}xml ${s} ${r}`}static createXml(e,t){let r="";e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach(s=>{Object.keys(s.map).forEach(n=>{r+=this.returnAttributeIfPopulated(s.prefix+n,s.map[n],t)})}),e.properties.rawMap&&Object.keys(e.properties.rawMap).forEach(s=>{r+=this.returnAttributeIfPopulated(s,e.properties.rawMap[s],t)}));let o="<"+e.name+r;return!e.children&&e.textNode==null?o+"/>"+LINE_SEPARATOR2:e.textNode!=null?o+">"+e.textNode+"</"+e.name+">"+LINE_SEPARATOR2:(o+=">"+LINE_SEPARATOR2,e.children&&e.children.forEach(s=>{o+=this.createXml(s,t)}),o+"</"+e.name+">"+LINE_SEPARATOR2)}static returnAttributeIfPopulated(e,t,r){if(!t&&t!==""&&t!==0)return"";let o=t;return typeof t=="boolean"&&r&&(o=r(t)),` ${e}="${o}"`}},import_core4=require("@ag-grid-community/core"),convertTime=e=>{let t=e.getHours();return t<<=6,t=t|e.getMinutes(),t<<=5,t=t|e.getSeconds()/2,t},convertDate=e=>{let t=e.getFullYear()-1980;return t<<=4,t=t|e.getMonth()+1,t<<=5,t=t|e.getDate(),t};function convertDecToHex(e,t){let r="";for(let o=0;o<t;o++)r+=String.fromCharCode(e&255),e>>>=8;return r}var getCrcFromCrc32TableAndByteArray=e=>{if(!e.length)return 0;let t=-1,r=0,o=0,s=0;for(let n=0;n<e.length;n++)r=e[n],o=(t^r)&255,s=crcTable[o],t=t>>>8^s;return t^-1},getCrcFromCrc32Table=e=>e.length?getCrcFromCrc32TableAndByteArray(typeof e=="string"?new TextEncoder().encode(e):e):0,crcTable=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]),compressBlob=e=>__async(void 0,null,function*(){let t=0;const r=[],o=new WritableStream({write:i=>{r.push(i),t+=i.length}}),s=new ReadableStream({start:i=>{const a=new FileReader;a.onload=l=>{var u;(u=l.target)!=null&&u.result&&i.enqueue(l.target.result),i.close()},a.readAsArrayBuffer(e)}}),n=new window.CompressionStream("deflate-raw");return yield s.pipeThrough(n).pipeTo(o),{size:t,content:new Blob(r)}}),deflateLocalFile=e=>__async(void 0,null,function*(){const t=new Blob([e]),{size:r,content:o}=yield compressBlob(t),s=new Uint8Array(yield o.arrayBuffer());return{size:r,content:s}}),{utf8_encode}=import_core4._,getDeflatedHeaderAndContent=(e,t)=>__async(void 0,null,function*(){const{content:r}=e,{size:o,content:s}=r?getDecodedContent(r):{size:0,content:Uint8Array.from([])};let n,i,a=!1;if(e.type==="file"&&s&&o>0){const c=yield deflateLocalFile(s);n=c.content,i=c.size,a=!0}const u=getHeaders(e,a,t,o,s,i);return __spreadProps(__spreadValues({},u),{content:n||s,isCompressed:a})}),getHeaderAndContent=(e,t)=>{const{content:r}=e,{content:o}=r?getDecodedContent(r):{content:Uint8Array.from([])},s=getHeaders(e,!1,t,o.length,o,void 0);return __spreadProps(__spreadValues({},s),{content:o,isCompressed:!1})},getHeaders=(e,t,r,o,s,n)=>{const{content:i,path:a,created:l}=e,u=convertTime(l),c=convertDate(l),p=getCrcFromCrc32Table(s),h=n!==void 0?n:o,d=utf8_encode(a),v=d!==a;let w="";if(v){const f=convertDecToHex(1,1)+convertDecToHex(getCrcFromCrc32Table(d),4)+d;w="up"+convertDecToHex(f.length,2)+f}const C="\0"+(v?"\0\b":"\0\0")+convertDecToHex(t?8:0,2)+convertDecToHex(u,2)+convertDecToHex(c,2)+convertDecToHex(h?p:0,4)+convertDecToHex(n??o,4)+convertDecToHex(o,4)+convertDecToHex(d.length,2)+convertDecToHex(w.length,2),m="PK"+C+d+w,g="PK\0"+C+"\0\0\0\0\0\0"+(i?"\0\0\0\0":"\0\0\0")+convertDecToHex(r,4)+d+w;return{localFileHeader:Uint8Array.from(m,f=>f.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(g,f=>f.charCodeAt(0))}},buildCentralDirectoryEnd=(e,t,r)=>{const o="PK\0\0\0\0"+convertDecToHex(e,2)+convertDecToHex(e,2)+convertDecToHex(t,4)+convertDecToHex(r,4)+"\0\0";return Uint8Array.from(o,s=>s.charCodeAt(0))},convertStringToByteArray=e=>{const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t},getDecodedContent=e=>{let t;if(typeof e=="string"){const r=atob(e.split(";base64,")[1]);t=convertStringToByteArray(r)}else t=e;return{size:t.length,content:t}},ZipContainer=class{static addFolders(e){e.forEach(this.addFolder.bind(this))}static addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}static addFile(e,t,r=!1){this.files.push({path:e,created:new Date,content:r?t:new TextEncoder().encode(t),isBase64:r,type:"file"})}static getZipFile(e="application/zip"){return __async(this,null,function*(){const t=yield this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})})}static getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}static clearStream(){this.folders=[],this.files=[]}static packageFiles(e){let t=new Uint8Array(0),r=new Uint8Array(0),o=0,s=0;for(const a of e){const{localFileHeader:l,centralDirectoryHeader:u,content:c}=a,p=new Uint8Array(t.length+l.length);p.set(t),p.set(l,t.length),t=p;const h=new Uint8Array(t.length+c.length);h.set(t),h.set(c,t.length),t=h;const d=new Uint8Array(r.length+u.length);d.set(r),d.set(u,r.length),r=d,o+=l.length+c.length,s+=u.length}const n=buildCentralDirectoryEnd(e.length,s,o),i=new Uint8Array(t.length+r.length+n.length);return i.set(t),i.set(r,t.length),i.set(n,t.length+r.length),i}static buildCompressedFileStream(){return __async(this,null,function*(){const e=[...this.folders,...this.files],t=[];let r=0;for(const o of e){const s=yield getDeflatedHeaderAndContent(o,r),{localFileHeader:n,content:i}=s;t.push(s),r+=n.length+i.length}return this.packageFiles(t)})}static buildFileStream(){const e=[...this.folders,...this.files],t=[];let r=0;for(const o of e){const s=getHeaderAndContent(o,r),{localFileHeader:n,content:i}=s;t.push(s),r+=n.length+i.length}return this.packageFiles(t)}};ZipContainer.folders=[],ZipContainer.files=[];
var __defProp=Object.defineProperty,__defProps=Object.defineProperties,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropDescs=Object.getOwnPropertyDescriptors,__getOwnPropNames=Object.getOwnPropertyNames,__getOwnPropSymbols=Object.getOwnPropertySymbols,__hasOwnProp=Object.prototype.hasOwnProperty,__propIsEnum=Object.prototype.propertyIsEnumerable,__defNormalProp=(e,t,r)=>t in e?__defProp(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,__spreadValues=(e,t)=>{for(var r in t||(t={}))__hasOwnProp.call(t,r)&&__defNormalProp(e,r,t[r]);if(__getOwnPropSymbols)for(var r of __getOwnPropSymbols(t))__propIsEnum.call(t,r)&&__defNormalProp(e,r,t[r]);return e},__spreadProps=(e,t)=>__defProps(e,__getOwnPropDescs(t)),__export=(e,t)=>{for(var r in t)__defProp(e,r,{get:t[r],enumerable:!0})},__copyProps=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of __getOwnPropNames(t))!__hasOwnProp.call(e,s)&&s!==r&&__defProp(e,s,{get:()=>t[s],enumerable:!(o=__getOwnPropDesc(t,s))||o.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__decorateClass=(e,t,r,o)=>{for(var s=o>1?void 0:o?__getOwnPropDesc(t,r):t,n=e.length-1,i;n>=0;n--)(i=e[n])&&(s=(o?i(t,r,s):i(s))||s);return o&&s&&__defProp(t,r,s),s},__async=(e,t,r)=>new Promise((o,s)=>{var n=l=>{try{a(r.next(l))}catch(u){s(u)}},i=l=>{try{a(r.throw(l))}catch(u){s(u)}},a=l=>l.done?o(l.value):Promise.resolve(l.value).then(n,i);a((r=r.apply(e,t)).next())}),main_exports={};__export(main_exports,{BaseCreator:()=>BaseCreator,BaseGridSerializingSession:()=>BaseGridSerializingSession,CsvCreator:()=>CsvCreator,CsvExportModule:()=>CsvExportModule,Downloader:()=>Downloader,GridSerializer:()=>GridSerializer,RowType:()=>RowType,XmlFactory:()=>XmlFactory,ZipContainer:()=>ZipContainer}),module.exports=__toCommonJS(main_exports);var BaseCreator=class{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return(e==null||!e.length)&&(e=this.getDefaultFileName()),e.indexOf(".")===-1?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},BaseGridSerializingSession=class{constructor(e){this.groupColumns=[];const{columnModel:t,valueService:r,gos:o,processCellCallback:s,processHeaderCallback:n,processGroupHeaderCallback:i,processRowGroupCallback:a}=e;this.columnModel=t,this.valueService=r,this.gos=o,this.processCellCallback=s,this.processHeaderCallback=n,this.processGroupHeaderCallback=i,this.processRowGroupCallback=a}prepare(e){this.groupColumns=e.filter(t=>!!t.getColDef().showRowGroup)}extractHeaderValue(e){const t=this.getHeaderName(this.processHeaderCallback,e);return t??""}extractRowCellValue(e,t,r,o,s){const i=(!this.gos.get("groupHideOpenParents")||s.footer)&&this.shouldRenderGroupSummaryCell(s,e,t)?this.createValueForGroupNode(e,s):this.valueService.getValue(e,s);return this.processCell({accumulatedRowIndex:r,rowNode:s,column:e,value:i,processCellCallback:this.processCellCallback,type:o})}shouldRenderGroupSummaryCell(e,t,r){var o;if(!(e&&e.group))return!1;if(this.groupColumns.indexOf(t)!==-1){if(((o=e.groupData)==null?void 0:o[t.getId()])!=null||this.gos.isRowModelType("serverSide")&&e.group)return!0;if(e.footer&&e.level===-1){const a=t.getColDef();return a==null||a.showRowGroup===!0||a.showRowGroup===this.columnModel.getRowGroupColumns()[0].getId()}}const i=this.gos.isGroupUseEntireRow(this.columnModel.isPivotMode());return r===0&&i}getHeaderName(e,t){return e?e(this.gos.addGridCommonParams({column:t})):this.columnModel.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:e,node:t}));const r=this.gos.get("treeData"),o=this.gos.get("suppressGroupMaintainValueType"),s=l=>{var u,c;if(r||o)return l.key;const p=(u=l.groupData)==null?void 0:u[e.getId()];return!p||!l.rowGroupColumn||l.rowGroupColumn.getColDef().useValueFormatterForExport===!1?p:(c=this.valueService.formatValue(l.rowGroupColumn,l,p))!=null?c:p},n=t.footer,i=[s(t)];if(!this.gos.isGroupMultiAutoColumn())for(;t.parent;)t=t.parent,i.push(s(t));const a=i.reverse().join(" -> ");return n?`Total ${a}`:a}processCell(e){var t;const{accumulatedRowIndex:r,rowNode:o,column:s,value:n,processCellCallback:i,type:a}=e;return i?{value:(t=i(this.gos.addGridCommonParams({accumulatedRowIndex:r,column:s,node:o,value:n,type:a,parseValue:l=>this.valueService.parseValue(s,o,l,this.valueService.getValue(s,o)),formatValue:l=>{var u;return(u=this.valueService.formatValue(s,o,l))!=null?u:l}})))!=null?t:""}:s.getColDef().useValueFormatterForExport!==!1?{value:n??"",valueFormatted:this.valueService.formatValue(s,o,n)}:{value:n??""}}},import_core=require("@ag-grid-community/core"),Downloader=class{static download(e,t){const r=document.defaultView||window;if(!r){console.warn("AG Grid: There is no `window` associated with the current `document`");return}const o=document.createElement("a"),s=r.URL.createObjectURL(t);o.setAttribute("href",s),o.setAttribute("download",e),o.style.display="none",document.body.appendChild(o),o.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:r})),document.body.removeChild(o),r.setTimeout(()=>{r.URL.revokeObjectURL(s)},0)}},LINE_SEPARATOR=`\r
`,CsvSerializingSession=class extends BaseGridSerializingSession{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:r}=e;this.suppressQuotes=t,this.columnSeparator=r}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,LINE_SEPARATOR),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((r,o)=>{o!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(r.data.value||""),r.mergeAcross&&this.appendEmptyCells(r.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,r,o){r!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(o)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,r){var o;t!=0&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",r);this.result+=this.putInQuotes((o=s.valueFormatted)!=null?o:s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(console.warn("AG Grid: unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=LINE_SEPARATOR),this.isFirstLine=!1}},CsvCreator=class extends BaseCreator{postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration.");return}const t=this.getMergedParams(e),r=this.getData(t),o=new Blob(["\uFEFF",r],{type:"text/plain"}),s=typeof t.fileName=="function"?t.fileName(this.gos.getGridCommonParams()):t.fileName;Downloader.download(this.getFileName(s),o)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const r=t?Object.assign({},e):this.getMergedParams(e);return this.getData(r)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,valueService:r,gos:o}=this,{processCellCallback:s,processHeaderCallback:n,processGroupHeaderCallback:i,processRowGroupCallback:a,suppressQuotes:l,columnSeparator:u}=e;return new CsvSerializingSession({columnModel:t,valueService:r,gos:o,processCellCallback:s||void 0,processHeaderCallback:n||void 0,processGroupHeaderCallback:i||void 0,processRowGroupCallback:a||void 0,suppressQuotes:l||!1,columnSeparator:u||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};__decorateClass([(0,import_core.Autowired)("columnModel")],CsvCreator.prototype,"columnModel",2),__decorateClass([(0,import_core.Autowired)("valueService")],CsvCreator.prototype,"valueService",2),__decorateClass([(0,import_core.Autowired)("gridSerializer")],CsvCreator.prototype,"gridSerializer",2),__decorateClass([(0,import_core.Autowired)("gridOptionsService")],CsvCreator.prototype,"gos",2),__decorateClass([import_core.PostConstruct],CsvCreator.prototype,"postConstruct",1),CsvCreator=__decorateClass([(0,import_core.Bean)("csvCreator")],CsvCreator);var import_core3=require("@ag-grid-community/core"),import_core2=require("@ag-grid-community/core"),RowType=(e=>(e[e.HEADER_GROUPING=0]="HEADER_GROUPING",e[e.HEADER=1]="HEADER",e[e.BODY=2]="BODY",e))(RowType||{}),GridSerializer=class extends import_core2.BeanStub{serialize(e,t={}){const{allColumns:r,columnKeys:o,skipRowGroups:s}=t,n=this.getColumnsToExport(r,s,o);return import_core2._.compose(this.prepareSession(n),this.prependContent(t),this.exportColumnGroups(t,n),this.exportHeaders(t,n),this.processPinnedTopRows(t,n),this.processRows(t,n),this.processPinnedBottomRows(t,n),this.appendContent(t))(e).parse()}processRow(e,t,r,o){const s=t.shouldRowBeSkipped||(()=>!1),n=this.gos.get("groupRemoveSingleChildren"),i=this.gos.get("groupRemoveLowestSingleChildren"),l=t.rowPositions!=null||!!t.onlySelected,u=this.gos.get("groupHideOpenParents")&&!l,c=this.columnModel.isPivotMode()?o.leafGroup:!o.group,p=!!o.footer,h=t.skipRowGroups,d=i&&o.leafGroup,w=o.allChildrenCount===1&&(n||d);if(!c&&!p&&(t.skipRowGroups||w||u)||t.onlySelected&&!o.isSelected()||t.skipPinnedTop&&o.rowPinned==="top"||t.skipPinnedBottom&&o.rowPinned==="bottom"||o.level===-1&&!c&&!p||s(this.gos.addGridCommonParams({node:o})))return;const v=e.onNewBodyRow(o);if(r.forEach((g,f)=>{v.onColumn(g,f,o)}),t.getCustomContentBelowRow){const g=t.getCustomContentBelowRow(this.gos.addGridCommonParams({node:o}));g&&e.addCustomContent(g)}}appendContent(e){return t=>{const r=e.appendContent;return r&&t.addCustomContent(r),t}}prependContent(e){return t=>{const r=e.prependContent;return r&&t.addCustomContent(r),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return r=>{if(!e.skipColumnGroupHeaders){const o=new import_core2.GroupInstanceIdCreator,s=this.displayedGroupCreator.createDisplayedGroups(t,o,null);this.recursivelyAddHeaderGroups(s,r,e.processGroupHeaderCallback)}return r}}exportHeaders(e,t){return r=>{if(!e.skipColumnHeaders){const o=r.onNewHeaderRow();t.forEach((s,n)=>{o.onColumn(s,n,void 0)})}return r}}processPinnedTopRows(e,t){return r=>{const o=this.processRow.bind(this,r,e,t);return e.rowPositions?e.rowPositions.filter(s=>s.rowPinned==="top").sort((s,n)=>s.rowIndex-n.rowIndex).map(s=>this.pinnedRowModel.getPinnedTopRow(s.rowIndex)).forEach(o):this.pinnedRowModel.forEachPinnedTopRow(o),r}}processRows(e,t){return r=>{const o=this.rowModel,s=o.getType(),n=s==="clientSide",i=s==="serverSide",a=!n&&e.onlySelected,l=this.processRow.bind(this,r,e,t),{exportedRows:u="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(c=>c.rowPinned==null).sort((c,p)=>c.rowIndex-p.rowIndex).map(c=>o.getRow(c.rowIndex)).forEach(l);else if(this.columnModel.isPivotMode())n?o.forEachPivotNode(l,!0):i?o.forEachNodeAfterFilterAndSort(l,!0):o.forEachNode(l);else if(e.onlySelectedAllPages||a){const c=this.selectionService.getSelectedNodes();this.replicateSortedOrder(c),c.forEach(l)}else u==="all"?o.forEachNode(l):n||i?o.forEachNodeAfterFilterAndSort(l,!0):o.forEachNode(l);return r}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),r=(o,s)=>{var n,i,a,l;return o.rowIndex!=null&&s.rowIndex!=null?o.rowIndex-s.rowIndex:o.level===s.level?((n=o.parent)==null?void 0:n.id)===((i=s.parent)==null?void 0:i.id)?this.rowNodeSorter.compareRowNodes(t,{rowNode:o,currentPos:(a=o.rowIndex)!=null?a:-1},{rowNode:s,currentPos:(l=s.rowIndex)!=null?l:-1}):r(o.parent,s.parent):o.level>s.level?r(o.parent,s):r(o,s.parent)};e.sort(r)}processPinnedBottomRows(e,t){return r=>{const o=this.processRow.bind(this,r,e,t);return e.rowPositions?e.rowPositions.filter(s=>s.rowPinned==="bottom").sort((s,n)=>s.rowIndex-n.rowIndex).map(s=>this.pinnedRowModel.getPinnedBottomRow(s.rowIndex)).forEach(o):this.pinnedRowModel.forEachPinnedBottomRow(o),r}}getColumnsToExport(e=!1,t=!1,r){const o=this.columnModel.isPivotMode();if(r&&r.length)return this.columnModel.getGridColumns(r);const s=this.gos.get("treeData");let n=[];return e&&!o?n=this.columnModel.getAllGridColumns():n=this.columnModel.getAllDisplayedColumns(),t&&!s&&(n=n.filter(i=>i.getColId()!==import_core2.GROUP_AUTO_COLUMN_ID)),n}recursivelyAddHeaderGroups(e,t,r){const o=[];e.forEach(s=>{const n=s;n.getChildren&&n.getChildren().forEach(i=>o.push(i))}),e.length>0&&e[0]instanceof import_core2.ColumnGroup&&this.doAddHeaderHeader(t,e,r),o&&o.length>0&&this.recursivelyAddHeaderGroups(o,t,r)}doAddHeaderHeader(e,t,r){const o=e.onNewHeaderGroupingRow();let s=0;t.forEach(n=>{const i=n;let a;r?a=r(this.gos.addGridCommonParams({columnGroup:i})):a=this.columnModel.getDisplayNameForColumnGroup(i,"header");const l=i.getLeafColumns().reduce((u,c,p,h)=>{let d=import_core2._.last(u);return c.getColumnGroupShow()==="open"?(!d||d[1]!=null)&&(d=[p],u.push(d)):d&&d[1]==null&&(d[1]=p-1),p===h.length-1&&d&&d[1]==null&&(d[1]=p),u},[]);o.onColumn(i,a||"",s++,i.getLeafColumns().length-1,l)})}};__decorateClass([(0,import_core2.Autowired)("displayedGroupCreator")],GridSerializer.prototype,"displayedGroupCreator",2),__decorateClass([(0,import_core2.Autowired)("columnModel")],GridSerializer.prototype,"columnModel",2),__decorateClass([(0,import_core2.Autowired)("rowModel")],GridSerializer.prototype,"rowModel",2),__decorateClass([(0,import_core2.Autowired)("pinnedRowModel")],GridSerializer.prototype,"pinnedRowModel",2),__decorateClass([(0,import_core2.Autowired)("selectionService")],GridSerializer.prototype,"selectionService",2),__decorateClass([(0,import_core2.Autowired)("rowNodeSorter")],GridSerializer.prototype,"rowNodeSorter",2),__decorateClass([(0,import_core2.Autowired)("sortController")],GridSerializer.prototype,"sortController",2),GridSerializer=__decorateClass([(0,import_core2.Bean)("gridSerializer")],GridSerializer);var VERSION="31.3.0",CsvExportModule={version:VERSION,moduleName:import_core3.ModuleNames.CsvExportModule,beans:[CsvCreator,GridSerializer]},LINE_SEPARATOR2=`\r
`,XmlFactory=class{static createHeader(e={}){const t="<?",r="?>",o=["version"];e.version||(e.version="1.0"),e.encoding&&o.push("encoding"),e.standalone&&o.push("standalone");const s=o.map(n=>`${n}="${e[n]}"`).join(" ");return`${t}xml ${s} ${r}`}static createXml(e,t){let r="";e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach(s=>{Object.keys(s.map).forEach(n=>{r+=this.returnAttributeIfPopulated(s.prefix+n,s.map[n],t)})}),e.properties.rawMap&&Object.keys(e.properties.rawMap).forEach(s=>{r+=this.returnAttributeIfPopulated(s,e.properties.rawMap[s],t)}));let o="<"+e.name+r;return!e.children&&e.textNode==null?o+"/>"+LINE_SEPARATOR2:e.textNode!=null?o+">"+e.textNode+"</"+e.name+">"+LINE_SEPARATOR2:(o+=">"+LINE_SEPARATOR2,e.children&&e.children.forEach(s=>{o+=this.createXml(s,t)}),o+"</"+e.name+">"+LINE_SEPARATOR2)}static returnAttributeIfPopulated(e,t,r){if(!t&&t!==""&&t!==0)return"";let o=t;return typeof t=="boolean"&&r&&(o=r(t)),` ${e}="${o}"`}},import_core4=require("@ag-grid-community/core"),convertTime=e=>{let t=e.getHours();return t<<=6,t=t|e.getMinutes(),t<<=5,t=t|e.getSeconds()/2,t},convertDate=e=>{let t=e.getFullYear()-1980;return t<<=4,t=t|e.getMonth()+1,t<<=5,t=t|e.getDate(),t};function convertDecToHex(e,t){let r="";for(let o=0;o<t;o++)r+=String.fromCharCode(e&255),e>>>=8;return r}var getCrcFromCrc32TableAndByteArray=e=>{if(!e.length)return 0;let t=-1,r=0,o=0,s=0;for(let n=0;n<e.length;n++)r=e[n],o=(t^r)&255,s=crcTable[o],t=t>>>8^s;return t^-1},getCrcFromCrc32Table=e=>e.length?getCrcFromCrc32TableAndByteArray(typeof e=="string"?new TextEncoder().encode(e):e):0,crcTable=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]),compressBlob=e=>__async(void 0,null,function*(){let t=0;const r=[],o=new WritableStream({write:i=>{r.push(i),t+=i.length}}),s=new ReadableStream({start:i=>{const a=new FileReader;a.onload=l=>{var u;(u=l.target)!=null&&u.result&&i.enqueue(l.target.result),i.close()},a.readAsArrayBuffer(e)}}),n=new window.CompressionStream("deflate-raw");return yield s.pipeThrough(n).pipeTo(o),{size:t,content:new Blob(r)}}),deflateLocalFile=e=>__async(void 0,null,function*(){const t=new Blob([e]),{size:r,content:o}=yield compressBlob(t),s=new Uint8Array(yield o.arrayBuffer());return{size:r,content:s}}),{utf8_encode}=import_core4._,getDeflatedHeaderAndContent=(e,t)=>__async(void 0,null,function*(){const{content:r}=e,{size:o,content:s}=r?getDecodedContent(r):{size:0,content:Uint8Array.from([])};let n,i,a=!1;if(e.type==="file"&&s&&o>0){const c=yield deflateLocalFile(s);n=c.content,i=c.size,a=!0}const u=getHeaders(e,a,t,o,s,i);return __spreadProps(__spreadValues({},u),{content:n||s,isCompressed:a})}),getHeaderAndContent=(e,t)=>{const{content:r}=e,{content:o}=r?getDecodedContent(r):{content:Uint8Array.from([])},s=getHeaders(e,!1,t,o.length,o,void 0);return __spreadProps(__spreadValues({},s),{content:o,isCompressed:!1})},getHeaders=(e,t,r,o,s,n)=>{const{content:i,path:a,created:l}=e,u=convertTime(l),c=convertDate(l),p=getCrcFromCrc32Table(s),h=n!==void 0?n:o,d=utf8_encode(a),w=d!==a;let C="";if(w){const f=convertDecToHex(1,1)+convertDecToHex(getCrcFromCrc32Table(d),4)+d;C="up"+convertDecToHex(f.length,2)+f}const m="\0"+(w?"\0\b":"\0\0")+convertDecToHex(t?8:0,2)+convertDecToHex(u,2)+convertDecToHex(c,2)+convertDecToHex(h?p:0,4)+convertDecToHex(n??o,4)+convertDecToHex(o,4)+convertDecToHex(d.length,2)+convertDecToHex(C.length,2),v="PK"+m+d+C,g="PK\0"+m+"\0\0\0\0\0\0"+(i?"\0\0\0\0":"\0\0\0")+convertDecToHex(r,4)+d+C;return{localFileHeader:Uint8Array.from(v,f=>f.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(g,f=>f.charCodeAt(0))}},buildCentralDirectoryEnd=(e,t,r)=>{const o="PK\0\0\0\0"+convertDecToHex(e,2)+convertDecToHex(e,2)+convertDecToHex(t,4)+convertDecToHex(r,4)+"\0\0";return Uint8Array.from(o,s=>s.charCodeAt(0))},convertStringToByteArray=e=>{const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t},getDecodedContent=e=>{let t;if(typeof e=="string"){const r=atob(e.split(";base64,")[1]);t=convertStringToByteArray(r)}else t=e;return{size:t.length,content:t}},ZipContainer=class{static addFolders(e){e.forEach(this.addFolder.bind(this))}static addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}static addFile(e,t,r=!1){this.files.push({path:e,created:new Date,content:r?t:new TextEncoder().encode(t),isBase64:r,type:"file"})}static getZipFile(e="application/zip"){return __async(this,null,function*(){const t=yield this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})})}static getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}static clearStream(){this.folders=[],this.files=[]}static packageFiles(e){let t=new Uint8Array(0),r=new Uint8Array(0),o=0,s=0;for(const a of e){const{localFileHeader:l,centralDirectoryHeader:u,content:c}=a,p=new Uint8Array(t.length+l.length);p.set(t),p.set(l,t.length),t=p;const h=new Uint8Array(t.length+c.length);h.set(t),h.set(c,t.length),t=h;const d=new Uint8Array(r.length+u.length);d.set(r),d.set(u,r.length),r=d,o+=l.length+c.length,s+=u.length}const n=buildCentralDirectoryEnd(e.length,s,o),i=new Uint8Array(t.length+r.length+n.length);return i.set(t),i.set(r,t.length),i.set(n,t.length+r.length),i}static buildCompressedFileStream(){return __async(this,null,function*(){const e=[...this.folders,...this.files],t=[];let r=0;for(const o of e){const s=yield getDeflatedHeaderAndContent(o,r),{localFileHeader:n,content:i}=s;t.push(s),r+=n.length+i.length}return this.packageFiles(t)})}static buildFileStream(){const e=[...this.folders,...this.files],t=[];let r=0;for(const o of e){const s=getHeaderAndContent(o,r),{localFileHeader:n,content:i}=s;t.push(s),r+=n.length+i.length}return this.packageFiles(t)}};ZipContainer.folders=[],ZipContainer.files=[];
{
"name": "@ag-grid-community/csv-export",
"version": "31.2.1",
"version": "31.3.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",
"dependencies": {
"tslib": "^2.3.0",
"@ag-grid-community/core": "31.2.1"
"@ag-grid-community/core": "31.3.0"
},

@@ -9,0 +9,0 @@ "main": "./dist/package/main.cjs.js",

{
"name": "@ag-grid-community/csv-export",
"version": "31.2.1",
"version": "31.3.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",
"dependencies": {
"tslib": "^2.3.0",
"@ag-grid-community/core": "31.2.1"
"@ag-grid-community/core": "31.3.0"
},

@@ -9,0 +9,0 @@ "main": "./src/main.js",

@@ -1,2 +0,2 @@

import { CsvCustomContent, CsvExportParams, GridOptionsService, ICsvCreator, ValueFormatterService, ValueParserService } from "@ag-grid-community/core";
import { CsvCustomContent, CsvExportParams, GridOptionsService, ICsvCreator } from "@ag-grid-community/core";
import { BaseCreator } from "./baseCreator";

@@ -8,5 +8,3 @@ import { CsvSerializingSession } from "./sessions/csvSerializingSession";

private gridSerializer;
gridOptionsService: GridOptionsService;
valueFormatterService: ValueFormatterService;
valueParserService: ValueParserService;
gos: GridOptionsService;
postConstruct(): void;

@@ -13,0 +11,0 @@ protected getMergedParams(params?: CsvExportParams): CsvExportParams;

@@ -1,6 +0,6 @@

import { Column, ColumnGroup, ColumnModel, GridOptionsService, ProcessCellForExportParams, ProcessGroupHeaderForExportParams, ProcessHeaderForExportParams, ProcessRowGroupForExportParams, RowNode, ValueFormatterService, ValueService, ValueParserService } from "@ag-grid-community/core";
import { Column, ColumnGroup, ColumnModel, GridOptionsService, ProcessCellForExportParams, ProcessGroupHeaderForExportParams, ProcessHeaderForExportParams, ProcessRowGroupForExportParams, RowNode, ValueService } from "@ag-grid-community/core";
import { GridSerializer } from "../gridSerializer";
export interface BaseCreatorBeans {
gridSerializer: GridSerializer;
gridOptionsService: GridOptionsService;
gos: GridOptionsService;
}

@@ -16,5 +16,3 @@ export interface RowAccumulator {

valueService: ValueService;
gridOptionsService: GridOptionsService;
valueFormatterService: ValueFormatterService;
valueParserService: ValueParserService;
gos: GridOptionsService;
processCellCallback?: (params: ProcessCellForExportParams) => string;

@@ -21,0 +19,0 @@ processHeaderCallback?: (params: ProcessHeaderForExportParams) => string;

@@ -1,2 +0,2 @@

import { Column, ColumnModel, GridOptionsService, ProcessCellForExportParams, ProcessGroupHeaderForExportParams, ProcessHeaderForExportParams, ProcessRowGroupForExportParams, RowNode, ValueFormatterService, ValueService, ValueParserService } from "@ag-grid-community/core";
import { Column, ColumnModel, GridOptionsService, ProcessCellForExportParams, ProcessGroupHeaderForExportParams, ProcessHeaderForExportParams, ProcessRowGroupForExportParams, RowNode, ValueService } from "@ag-grid-community/core";
import { GridSerializingParams, GridSerializingSession, RowAccumulator, RowSpanningAccumulator } from "../interfaces";

@@ -6,5 +6,3 @@ export declare abstract class BaseGridSerializingSession<T> implements GridSerializingSession<T> {

valueService: ValueService;
gridOptionsService: GridOptionsService;
valueFormatterService: ValueFormatterService;
valueParserService: ValueParserService;
gos: GridOptionsService;
processCellCallback?: (params: ProcessCellForExportParams) => string;

@@ -11,0 +9,0 @@ processHeaderCallback?: (params: ProcessHeaderForExportParams) => string;

@@ -1,1 +0,1 @@

export declare const VERSION = "31.2.1";
export declare const VERSION = "31.3.0";
{
"name": "@ag-grid-community/csv-export",
"version": "31.2.1",
"version": "31.3.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",
"dependencies": {
"tslib": "^2.3.0",
"@ag-grid-community/core": "31.2.1"
"@ag-grid-community/core": "31.3.0"
},

@@ -9,0 +9,0 @@ "main": "./dist/package/main.cjs.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc