Socket
Socket
Sign inDemoInstall

@ag-grid-enterprise/clipboard

Package Overview
Dependencies
3
Maintainers
3
Versions
60
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 31.0.3 to 31.1.0

2

dist/cjs/es5/version.d.ts

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

export declare const VERSION = "31.0.3";
export declare const VERSION = "31.1.0";

@@ -5,2 +5,2 @@ "use strict";

// DO NOT UPDATE MANUALLY: Generated from script during build time
exports.VERSION = '31.0.3';
exports.VERSION = '31.1.0';

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

export declare const VERSION = "31.0.3";
export declare const VERSION = "31.1.0";

@@ -5,2 +5,2 @@ "use strict";

// DO NOT UPDATE MANUALLY: Generated from script during build time
exports.VERSION = '31.0.3';
exports.VERSION = '31.1.0';
/**
* @ag-grid-enterprise/clipboard - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.0.3
* @ag-grid-enterprise/clipboard - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.1.0
* @link https://www.ag-grid.com/

@@ -1020,3 +1020,3 @@ * @license Commercial

// DO NOT UPDATE MANUALLY: Generated from script during build time
var VERSION = '31.0.3';
var VERSION = '31.1.0';

@@ -1023,0 +1023,0 @@ var ClipboardModule = {

/**
* @ag-grid-enterprise/clipboard - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.0.3
* @ag-grid-enterprise/clipboard - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.1.0
* @link https://www.ag-grid.com/

@@ -7,6 +7,6 @@ * @license Commercial

/**
* @ag-grid-enterprise/clipboard - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.0.3
* @ag-grid-enterprise/clipboard - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v31.1.0
* @link https://www.ag-grid.com/
* @license Commercial
*/
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,o=require("@ag-grid-community/core"),r=require("@ag-grid-enterprise/core"),i=require("@ag-grid-community/csv-export"),n=(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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");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 i,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(a=(n<3?i(a):n>3?i(t,o,a):i(t,o))||a);return n>3&&a&&Object.defineProperty(t,o,a),a},l=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,i,n=o.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=n.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(i)throw i.error}}return a},s=function(e,t,o){if(o||2===arguments.length)for(var r,i=0,n=t.length;i<n;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},c=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.")};!function(e){e[e.CellRange=0]="CellRange",e[e.SelectedRows=1]="SelectedRows",e[e.FocusedCell=2]="FocusedCell"}(t||(t={}));var u=function(e){return"AG Grid: Unable to use the Clipboard API (navigator.clipboard.".concat(e,"()). ")+"The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API."},p=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.lastPasteOperationTime=0,t.navigatorApiFailed=!1,t}var i;return n(r,e),i=r,r.prototype.init=function(){var e=this;this.logger=this.loggerFactory.create("ClipboardService"),"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady((function(t){e.gridCtrl=t.gridCtrl}))},r.prototype.pasteFromClipboard=function(){var e=this;this.logger.log("pasteFromClipboard"),!this.gridOptionsService.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard&&navigator.clipboard.readText?navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch((function(t){o._.doOnce((function(){console.warn(t),console.warn(u("readText"))}),"clipboardApiError"),e.navigatorApiFailed=!0,e.pasteFromClipboardLegacy()})):this.pasteFromClipboardLegacy()},r.prototype.pasteFromClipboardLegacy=function(){var e=this,t=!1,o=function(o){var r=(new Date).getTime();r-e.lastPasteOperationTime<50&&(t=!0,o.preventDefault()),e.lastPasteOperationTime=r};this.executeOnTempElement((function(e){e.addEventListener("paste",o),e.focus({preventScroll:!0})}),(function(r){var i=r.value;t?e.refocusLastFocusedCell():e.processClipboardData(i),r.removeEventListener("paste",o)}))},r.prototype.refocusLastFocusedCell=function(){var e=this.focusService.getFocusedCell();e&&this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0})},r.prototype.getClipboardDelimiter=function(){var e=this.gridOptionsService.get("clipboardDelimiter");return o._.exists(e)?e:"\t"},r.prototype.processClipboardData=function(e){var t=this;if(null!=e){var o=i.stringToArray(e,this.getClipboardDelimiter()),r=this.gridOptionsService.getCallback("processDataFromClipboard");if(r&&(o=r({data:o})),null!=o){this.gridOptionsService.get("suppressLastEmptyLineOnPaste")&&this.removeLastLineIfBlank(o);this.doPasteOperation((function(e,r,i,n){t.rangeService&&t.rangeService.isMoreThanOneCell()&&!t.hasOnlyOneValueToPaste(o)?t.pasteIntoActiveRange(o,e,r,n):t.pasteStartingFromFocusedCell(o,e,r,i,n)}))}}},r.stringToArray=function(e,t){void 0===t&&(t=",");var o=[],r=function(e){return"\r"===e||"\n"===e},i=!1;if(""===e)return[[""]];for(var n,a,l,s=function(s,c,u){var p=e[u-1],d=e[u],v=e[u+1],h=function(){o[s]||(o[s]=[]),o[s][c]||(o[s][c]="")};if(h(),'"'===d&&(i?'"'===v?(o[s][c]+='"',u++):i=!1:(void 0===p||p===t||r(p))&&(i=!0)),!i&&'"'!==d){if(d===t)return c++,h(),n=s,a=c,l=u,"continue";if(r(d))return c=0,s++,h(),"\r"===d&&"\n"===v&&u++,n=s,a=c,l=u,"continue"}o[s][c]+=d,n=s,a=c,l=u},c=0,u=0,p=0;p<e.length;p++)s(c,u,p),c=n,u=a,p=l;return o},r.prototype.doPasteOperation=function(e){var t;if(this.eventService.dispatchEvent({type:o.Events.EVENT_PASTE_START,source:"clipboard"}),this.clientSideRowModel){var r=this.gridOptionsService.get("aggregateOnlyChangedColumns");t=new o.ChangedPath(r,this.clientSideRowModel.getRootNode())}var i={},n=[];e(i,n,this.focusService.getFocusedCell(),t);var a=s([],l(n),!1);t&&(this.clientSideRowModel.doAggregate(t),t.forEachChangedNodeDepthFirst((function(e){a.push(e)}))),this.rowRenderer.refreshCells({rowNodes:a}),this.dispatchFlashCells(i),this.fireRowChanged(n),this.refocusLastFocusedCell();var c={type:o.Events.EVENT_PASTE_END,source:"clipboard"};this.eventService.dispatchEvent(c)},r.prototype.pasteIntoActiveRange=function(e,t,o,r){var i=this,n=this.getRangeSize()%e.length!=0,a=0,l=0;this.iterateActiveRanges(!1,(function(s,c,u,p){if(p-a>=e.length){if(n)return;a+=l,l=0}var d=e[p-a];o.push(c);var v=i.gridOptionsService.getCallback("processCellFromClipboard");u.forEach((function(e,o){if(e.isCellEditable(c)&&!e.isSuppressPaste(c)){o>=d.length&&(o%=d.length);var n=i.processCell(c,e,d[o],"dragCopy",v,!0);c.setDataValue(e,n,"paste"),r&&r.addParentNode(c.parent,[e]);var a=s.rowIndex,l=s.rowPinned,u=i.cellPositionUtils.createIdFromValues({rowIndex:a,column:e,rowPinned:l});t[u]=!0}})),l++}))},r.prototype.pasteStartingFromFocusedCell=function(e,t,o,r,i){if(r){var n={rowIndex:r.rowIndex,rowPinned:r.rowPinned},a=this.columnModel.getDisplayedColumnsStartingAt(r.column);this.isPasteSingleValueIntoRange(e)?this.pasteSingleValueIntoRange(e,o,t,i):this.pasteMultipleValues(e,n,o,a,t,"clipboard",i)}},r.prototype.isPasteSingleValueIntoRange=function(e){return this.hasOnlyOneValueToPaste(e)&&null!=this.rangeService&&!this.rangeService.isEmpty()},r.prototype.pasteSingleValueIntoRange=function(e,t,o,r){var i=this,n=e[0][0];this.iterateActiveRanges(!1,(function(e,a,l){t.push(a),l.forEach((function(e){return i.updateCellValue(a,e,n,o,"clipboard",r)}))}))},r.prototype.hasOnlyOneValueToPaste=function(e){return 1===e.length&&1===e[0].length},r.prototype.copyRangeDown=function(){var e=this;if(this.rangeService&&!this.rangeService.isEmpty()){var t=[];this.doPasteOperation((function(o,r,i,n){var a=e.gridOptionsService.getCallback("processCellForClipboard"),l=e.gridOptionsService.getCallback("processCellFromClipboard");e.iterateActiveRanges(!0,(function(i,s,c){t.length?(r.push(s),c.forEach((function(r,a){if(r.isCellEditable(s)&&!r.isSuppressPaste(s)){var c=e.processCell(s,r,t[a],"dragCopy",l,!0);s.setDataValue(r,c,"paste"),n&&n.addParentNode(s.parent,[r]);var u=i.rowIndex,p=i.rowPinned,d=e.cellPositionUtils.createIdFromValues({rowIndex:u,column:r,rowPinned:p});o[d]=!0}}))):c.forEach((function(o){var r=e.processCell(s,o,e.valueService.getValue(o,s),"dragCopy",a,!1,!0);t.push(r)}))}))}))}},r.prototype.removeLastLineIfBlank=function(e){var t=o._.last(e);if(t&&1===t.length&&""===t[0]){if(1===e.length)return;o._.removeFromArray(e,t)}},r.prototype.fireRowChanged=function(e){var t=this;"fullRow"===this.gridOptionsService.get("editType")&&e.forEach((function(e){var r={type:o.Events.EVENT_ROW_VALUE_CHANGED,node:e,data:e.data,rowIndex:e.rowIndex,rowPinned:e.rowPinned};t.eventService.dispatchEvent(r)}))},r.prototype.pasteMultipleValues=function(e,t,o,r,i,n,a){var l=this,s=t,c=null!=this.clientSideRowModel&&!this.gridOptionsService.get("enableGroupEdit")&&!this.gridOptionsService.get("treeData");e.forEach((function(e){var t=function(){for(;;){if(!s)return null;var e=l.rowPositionUtils.getRowNode(s);if(s=l.cellNavigationService.getRowBelow({rowPinned:s.rowPinned,rowIndex:s.rowIndex}),null==e)return null;if(!(e.detail||e.footer||c&&e.group))return e}}();t&&(e.forEach((function(e,o){return l.updateCellValue(t,r[o],e,i,n,a)})),o.push(t))}))},r.prototype.updateCellValue=function(e,t,o,r,i,n){if(e&&t&&t.isCellEditable(e)&&!t.isSuppressPaste(e)&&(!e.group||!t.isValueActive())){var a=this.processCell(e,t,o,i,this.gridOptionsService.getCallback("processCellFromClipboard"),!0);e.setDataValue(t,a,"paste");var l=e.rowIndex,s=e.rowPinned;r[this.cellPositionUtils.createIdFromValues({rowIndex:l,column:t,rowPinned:s})]=!0,n&&n.addParentNode(e.parent,[t])}},r.prototype.copyToClipboard=function(e){void 0===e&&(e={}),this.copyOrCutToClipboard(e)},r.prototype.cutToClipboard=function(e,t){if(void 0===e&&(e={}),void 0===t&&(t="api"),!this.gridOptionsService.get("suppressCutToClipboard")){var r={type:o.Events.EVENT_CUT_START,source:t};this.eventService.dispatchEvent(r),this.copyOrCutToClipboard(e,!0);var i={type:o.Events.EVENT_CUT_END,source:t};this.eventService.dispatchEvent(i)}},r.prototype.copyOrCutToClipboard=function(e,o){var r=e.includeHeaders,i=e.includeGroupHeaders;this.logger.log("copyToClipboard: includeHeaders = ".concat(r)),null==r&&(r=this.gridOptionsService.get("copyHeadersToClipboard")),null==i&&(i=this.gridOptionsService.get("copyGroupHeadersToClipboard"));var n={includeHeaders:r,includeGroupHeaders:i},a=!this.gridOptionsService.get("suppressCopyRowsToClipboard"),l=null;!this.rangeService||this.rangeService.isEmpty()||this.shouldSkipSingleCellRange()?a&&!this.selectionService.isEmpty()?(this.copySelectedRowsToClipboard(n),l=t.SelectedRows):this.focusService.isAnyCellFocused()&&(this.copyFocusedCellToClipboard(n),l=t.FocusedCell):(this.copySelectedRangeToClipboard(n),l=t.CellRange),o&&null!==l&&this.clearCellsAfterCopy(l)},r.prototype.clearCellsAfterCopy=function(e){if(this.eventService.dispatchEvent({type:o.Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),e===t.CellRange)this.rangeService.clearCellRangeCellValues({cellEventSource:"clipboardService"});else if(e===t.SelectedRows)this.clearSelectedRows();else{var r=this.focusService.getFocusedCell();if(null==r)return;var i=this.rowPositionUtils.getRowNode(r);i&&this.clearCellValue(i,r.column)}this.eventService.dispatchEvent({type:o.Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END})},r.prototype.clearSelectedRows=function(){var e,t,o,r,i=this.selectionService.getSelectedNodes(),n=this.columnModel.getAllDisplayedColumns();try{for(var a=c(i),l=a.next();!l.done;l=a.next()){var s=l.value;try{for(var u=(o=void 0,c(n)),p=u.next();!p.done;p=u.next()){var d=p.value;this.clearCellValue(s,d)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(r=u.return)&&r.call(u)}finally{if(o)throw o.error}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}},r.prototype.clearCellValue=function(e,t){t.isCellEditable(e)&&e.setDataValue(t,null,"clipboardService")},r.prototype.shouldSkipSingleCellRange=function(){return this.gridOptionsService.get("suppressCopySingleCellRanges")&&!this.rangeService.isMoreThanOneCell()},r.prototype.iterateActiveRanges=function(e,t,o){var r=this;if(this.rangeService&&!this.rangeService.isEmpty()){var i=this.rangeService.getCellRanges();e?this.iterateActiveRange(i[0],t,o,!0):i.forEach((function(e,n){return r.iterateActiveRange(e,t,o,n===i.length-1)}))}},r.prototype.iterateActiveRange=function(e,t,o,r){if(this.rangeService){var i=this.rangeService.getRangeStartRow(e),n=this.rangeService.getRangeEndRow(e);o&&e.columns&&o(e.columns);for(var a=0,l=!1;!l&&null!=i;){var s=this.rowPositionUtils.getRowNode(i);l=this.rowPositionUtils.sameRow(i,n),t(i,s,e.columns,a++,l&&r),i=this.cellNavigationService.getRowBelow(i)}}},r.prototype.copySelectedRangeToClipboard=function(e){if(void 0===e&&(e={}),this.rangeService&&!this.rangeService.isEmpty()){var t=this.rangeService.areAllRangesAbleToMerge()?this.buildDataFromMergedRanges(e):this.buildDataFromRanges(e),o=t.data,r=t.cellsToFlash;this.copyDataToClipboard(o),this.dispatchFlashCells(r)}},r.prototype.buildDataFromMergedRanges=function(e){var t=this,o=new Set,r=this.rangeService.getCellRanges(),i=new Map,n=[],a={};r.forEach((function(e){e.columns.forEach((function(e){return o.add(e)}));var r=t.getRangeRowPositionsAndCellsToFlash(e),l=r.rowPositions,s=r.cellsToFlash;l.forEach((function(e){var t="".concat(e.rowIndex,"-").concat(e.rowPinned||"null");i.get(t)||(i.set(t,!0),n.push(e))})),Object.assign(a,s)}));var l=this.columnModel.getAllDisplayedColumns(),s=Array.from(o);return s.sort((function(e,t){return l.indexOf(e)-l.indexOf(t)})),{data:this.buildExportParams({columns:s,rowPositions:n,includeHeaders:e.includeHeaders,includeGroupHeaders:e.includeGroupHeaders}),cellsToFlash:a}},r.prototype.buildDataFromRanges=function(e){var t=this,o=this.rangeService.getCellRanges(),r=[],i={};return o.forEach((function(o){var n=t.getRangeRowPositionsAndCellsToFlash(o),a=n.rowPositions,l=n.cellsToFlash;Object.assign(i,l),r.push(t.buildExportParams({columns:o.columns,rowPositions:a,includeHeaders:e.includeHeaders,includeGroupHeaders:e.includeGroupHeaders}))})),{data:r.join("\n"),cellsToFlash:i}},r.prototype.getRangeRowPositionsAndCellsToFlash=function(e){for(var t=this,o=[],r={},i=this.rangeService.getRangeStartRow(e),n=this.rangeService.getRangeEndRow(e),a=i;a&&(o.push(a),e.columns.forEach((function(e){var o=a,i=o.rowIndex,n=o.rowPinned,l=t.cellPositionUtils.createIdFromValues({rowIndex:i,column:e,rowPinned:n});r[l]=!0})),!this.rowPositionUtils.sameRow(a,n));)a=this.cellNavigationService.getRowBelow(a);return{rowPositions:o,cellsToFlash:r}},r.prototype.getCellsToFlashFromRowNodes=function(e){for(var t=this.columnModel.getAllDisplayedColumns(),o={},r=0;r<e.length;r++){var i=e[r],n=i.rowIndex,a=i.rowPinned;if(null!=n)for(var l=0;l<t.length;l++){var s=t[l];o[this.cellPositionUtils.createIdFromValues({rowIndex:n,column:s,rowPinned:a})]=!0}}return o},r.prototype.copyFocusedCellToClipboard=function(e){var t;void 0===e&&(e={});var o=this.focusService.getFocusedCell();if(null!=o){var r=this.cellPositionUtils.createId(o),i={rowPinned:o.rowPinned,rowIndex:o.rowIndex},n=o.column,a=this.buildExportParams({columns:[n],rowPositions:[i],includeHeaders:e.includeHeaders,includeGroupHeaders:e.includeGroupHeaders});this.copyDataToClipboard(a),this.dispatchFlashCells(((t={})[r]=!0,t))}},r.prototype.copySelectedRowsToClipboard=function(e){void 0===e&&(e={});var t=e.columnKeys,o=e.includeHeaders,r=e.includeGroupHeaders,i=this.buildExportParams({columns:t,includeHeaders:o,includeGroupHeaders:r});this.copyDataToClipboard(i);var n=this.selectionService.getSelectedNodes()||[];this.dispatchFlashCells(this.getCellsToFlashFromRowNodes(n))},r.prototype.buildExportParams=function(e){var t=this,o=e.columns,r=e.rowPositions,i=e.includeHeaders,n=void 0!==i&&i,a=e.includeGroupHeaders,l={columnKeys:o,rowPositions:r,skipColumnHeaders:!n,skipColumnGroupHeaders:!(void 0!==a&&a),suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!r,processCellCallback:this.gridOptionsService.getCallback("processCellForClipboard"),processRowGroupCallback:function(e){return t.processRowGroupCallback(e)},processHeaderCallback:this.gridOptionsService.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:this.gridOptionsService.getCallback("processGroupHeaderForClipboard")};return this.csvCreator.getDataAsCsv(l,!0)},r.prototype.processRowGroupCallback=function(e){var t=this,o=e.node,r=e.column,i=this.gridOptionsService.get("treeData"),n=this.gridOptionsService.get("suppressGroupMaintainValueType"),a=function(){var e,a;if(i||n||!r)return o.key;var l=null===(e=o.groupData)||void 0===e?void 0:e[r.getId()];return l&&o.rowGroupColumn&&!1!==o.rowGroupColumn.getColDef().useValueFormatterForExport&&null!==(a=t.valueFormatterService.formatValue(o.rowGroupColumn,o,l))&&void 0!==a?a:l}();if(e.node.footer){var l="";a&&a.length&&(l=" ".concat(a)),a="Total".concat(l)}var s=this.gridOptionsService.getCallback("processCellForClipboard");if(s){var c=o.rowGroupColumn;return!c&&o.footer&&-1===o.level&&(c=this.columnModel.getRowGroupColumns()[0]),s({value:a,node:o,column:c,type:"clipboard",formatValue:function(e){var r;return null!==(r=t.valueFormatterService.formatValue(c,o,e))&&void 0!==r?r:e},parseValue:function(e){return t.valueParserService.parseValue(c,o,e,t.valueService.getValue(c,o))}})}return a},r.prototype.dispatchFlashCells=function(e){var t=this;window.setTimeout((function(){var r={type:o.Events.EVENT_FLASH_CELLS,cells:e};t.eventService.dispatchEvent(r)}),0)},r.prototype.processCell=function(e,t,o,r,i,n,a){var l,s=this;return i?i({column:t,node:e,value:o,type:r,formatValue:function(o){var r;return null!==(r=s.valueFormatterService.formatValue(t,null!=e?e:null,o))&&void 0!==r?r:o},parseValue:function(o){return s.valueParserService.parseValue(t,null!=e?e:null,o,s.valueService.getValue(t,e))}}):n&&!1!==t.getColDef().useValueParserForImport?this.valueParserService.parseValue(t,null!=e?e:null,o,this.valueService.getValue(t,e)):a&&!1!==t.getColDef().useValueFormatterForExport&&null!==(l=this.valueFormatterService.formatValue(t,null!=e?e:null,o))&&void 0!==l?l:o},r.prototype.copyDataToClipboard=function(e){var t=this,r=this.gridOptionsService.getCallback("sendToClipboard");r?r({data:e}):!this.gridOptionsService.get("suppressClipboardApi")&&navigator.clipboard?navigator.clipboard.writeText(e).catch((function(r){o._.doOnce((function(){console.warn(r),console.warn(u("writeText"))}),"clipboardApiError"),t.copyDataToClipboardLegacy(e)})):this.copyDataToClipboardLegacy(e)},r.prototype.copyDataToClipboardLegacy=function(e){var t=this;this.executeOnTempElement((function(o){var r=t.gridOptionsService.getDocument(),i=r.activeElement;o.value=e||" ",o.select(),o.focus({preventScroll:!0}),r.execCommand("copy")||console.warn("AG Grid: Browser did not allow document.execCommand('copy'). Ensure api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons."),null!=i&&null!=i.focus&&i.focus({preventScroll:!0})}))},r.prototype.executeOnTempElement=function(e,t){var o=this.gridOptionsService.getDocument(),r=o.createElement("textarea");r.style.width="1px",r.style.height="1px",r.style.top=o.documentElement.scrollTop+"px",r.style.left=o.documentElement.scrollLeft+"px",r.style.position="absolute",r.style.opacity="0";var i=this.gridCtrl.getGui();i.appendChild(r);try{e(r)}catch(e){console.warn("AG Grid: Browser does not support document.execCommand('copy') for clipboard operations")}t?window.setTimeout((function(){t(r),i.removeChild(r)}),100):i.removeChild(r)},r.prototype.getRangeSize=function(){var e=this.rangeService.getCellRanges(),t=0,o=0;return e.length>0&&(t=this.rangeService.getRangeStartRow(e[0]).rowIndex,o=this.rangeService.getRangeEndRow(e[0]).rowIndex),t-o+1},a([o.Autowired("csvCreator")],r.prototype,"csvCreator",void 0),a([o.Autowired("loggerFactory")],r.prototype,"loggerFactory",void 0),a([o.Autowired("selectionService")],r.prototype,"selectionService",void 0),a([o.Optional("rangeService")],r.prototype,"rangeService",void 0),a([o.Autowired("rowModel")],r.prototype,"rowModel",void 0),a([o.Autowired("ctrlsService")],r.prototype,"ctrlsService",void 0),a([o.Autowired("valueService")],r.prototype,"valueService",void 0),a([o.Autowired("focusService")],r.prototype,"focusService",void 0),a([o.Autowired("rowRenderer")],r.prototype,"rowRenderer",void 0),a([o.Autowired("columnModel")],r.prototype,"columnModel",void 0),a([o.Autowired("cellNavigationService")],r.prototype,"cellNavigationService",void 0),a([o.Autowired("cellPositionUtils")],r.prototype,"cellPositionUtils",void 0),a([o.Autowired("rowPositionUtils")],r.prototype,"rowPositionUtils",void 0),a([o.Autowired("valueFormatterService")],r.prototype,"valueFormatterService",void 0),a([o.Autowired("valueParserService")],r.prototype,"valueParserService",void 0),a([o.PostConstruct],r.prototype,"init",null),r=i=a([o.Bean("clipboardService")],r)}(o.BeanStub),d={version:"31.0.3",moduleName:o.ModuleNames.ClipboardModule,beans:[p],dependantModules:[r.EnterpriseCoreModule,i.CsvExportModule]};exports.ClipboardModule=d;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,o=require("@ag-grid-community/core"),r=require("@ag-grid-enterprise/core"),i=require("@ag-grid-community/csv-export"),n=(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)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])})(t,o)},function(t,o){if("function"!=typeof o&&null!==o)throw new TypeError("Class extends value "+String(o)+" is not a constructor or null");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 i,n=arguments.length,a=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,o,r);else for(var l=e.length-1;l>=0;l--)(i=e[l])&&(a=(n<3?i(a):n>3?i(t,o,a):i(t,o))||a);return n>3&&a&&Object.defineProperty(t,o,a),a},l=function(e,t){var o="function"==typeof Symbol&&e[Symbol.iterator];if(!o)return e;var r,i,n=o.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=n.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(o=n.return)&&o.call(n)}finally{if(i)throw i.error}}return a},s=function(e,t,o){if(o||2===arguments.length)for(var r,i=0,n=t.length;i<n;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))},c=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.")};!function(e){e[e.CellRange=0]="CellRange",e[e.SelectedRows=1]="SelectedRows",e[e.FocusedCell=2]="FocusedCell"}(t||(t={}));var u=function(e){return"AG Grid: Unable to use the Clipboard API (navigator.clipboard.".concat(e,"()). ")+"The reason why it could not be used has been logged in the previous line. For this reason the grid has defaulted to using a workaround which doesn't perform as well. Either fix why Clipboard API is blocked, OR stop this message from appearing by setting grid property suppressClipboardApi=true (which will default the grid to using the workaround rather than the API."},p=function(e){function r(){var t=null!==e&&e.apply(this,arguments)||this;return t.lastPasteOperationTime=0,t.navigatorApiFailed=!1,t}var i;return n(r,e),i=r,r.prototype.init=function(){var e=this;this.logger=this.loggerFactory.create("ClipboardService"),"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady((function(t){e.gridCtrl=t.gridCtrl}))},r.prototype.pasteFromClipboard=function(){var e=this;this.logger.log("pasteFromClipboard"),!this.gridOptionsService.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard&&navigator.clipboard.readText?navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch((function(t){o._.doOnce((function(){console.warn(t),console.warn(u("readText"))}),"clipboardApiError"),e.navigatorApiFailed=!0,e.pasteFromClipboardLegacy()})):this.pasteFromClipboardLegacy()},r.prototype.pasteFromClipboardLegacy=function(){var e=this,t=!1,o=function(o){var r=(new Date).getTime();r-e.lastPasteOperationTime<50&&(t=!0,o.preventDefault()),e.lastPasteOperationTime=r};this.executeOnTempElement((function(e){e.addEventListener("paste",o),e.focus({preventScroll:!0})}),(function(r){var i=r.value;t?e.refocusLastFocusedCell():e.processClipboardData(i),r.removeEventListener("paste",o)}))},r.prototype.refocusLastFocusedCell=function(){var e=this.focusService.getFocusedCell();e&&this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0})},r.prototype.getClipboardDelimiter=function(){var e=this.gridOptionsService.get("clipboardDelimiter");return o._.exists(e)?e:"\t"},r.prototype.processClipboardData=function(e){var t=this;if(null!=e){var o=i.stringToArray(e,this.getClipboardDelimiter()),r=this.gridOptionsService.getCallback("processDataFromClipboard");if(r&&(o=r({data:o})),null!=o){this.gridOptionsService.get("suppressLastEmptyLineOnPaste")&&this.removeLastLineIfBlank(o);this.doPasteOperation((function(e,r,i,n){t.rangeService&&t.rangeService.isMoreThanOneCell()&&!t.hasOnlyOneValueToPaste(o)?t.pasteIntoActiveRange(o,e,r,n):t.pasteStartingFromFocusedCell(o,e,r,i,n)}))}}},r.stringToArray=function(e,t){void 0===t&&(t=",");var o=[],r=function(e){return"\r"===e||"\n"===e},i=!1;if(""===e)return[[""]];for(var n,a,l,s=function(s,c,u){var p=e[u-1],d=e[u],v=e[u+1],h=function(){o[s]||(o[s]=[]),o[s][c]||(o[s][c]="")};if(h(),'"'===d&&(i?'"'===v?(o[s][c]+='"',u++):i=!1:(void 0===p||p===t||r(p))&&(i=!0)),!i&&'"'!==d){if(d===t)return c++,h(),n=s,a=c,l=u,"continue";if(r(d))return c=0,s++,h(),"\r"===d&&"\n"===v&&u++,n=s,a=c,l=u,"continue"}o[s][c]+=d,n=s,a=c,l=u},c=0,u=0,p=0;p<e.length;p++)s(c,u,p),c=n,u=a,p=l;return o},r.prototype.doPasteOperation=function(e){var t;if(this.eventService.dispatchEvent({type:o.Events.EVENT_PASTE_START,source:"clipboard"}),this.clientSideRowModel){var r=this.gridOptionsService.get("aggregateOnlyChangedColumns");t=new o.ChangedPath(r,this.clientSideRowModel.getRootNode())}var i={},n=[];e(i,n,this.focusService.getFocusedCell(),t);var a=s([],l(n),!1);t&&(this.clientSideRowModel.doAggregate(t),t.forEachChangedNodeDepthFirst((function(e){a.push(e)}))),this.rowRenderer.refreshCells({rowNodes:a}),this.dispatchFlashCells(i),this.fireRowChanged(n),this.refocusLastFocusedCell();var c={type:o.Events.EVENT_PASTE_END,source:"clipboard"};this.eventService.dispatchEvent(c)},r.prototype.pasteIntoActiveRange=function(e,t,o,r){var i=this,n=this.getRangeSize()%e.length!=0,a=0,l=0;this.iterateActiveRanges(!1,(function(s,c,u,p){if(p-a>=e.length){if(n)return;a+=l,l=0}var d=e[p-a];o.push(c);var v=i.gridOptionsService.getCallback("processCellFromClipboard");u.forEach((function(e,o){if(e.isCellEditable(c)&&!e.isSuppressPaste(c)){o>=d.length&&(o%=d.length);var n=i.processCell(c,e,d[o],"dragCopy",v,!0);c.setDataValue(e,n,"paste"),r&&r.addParentNode(c.parent,[e]);var a=s.rowIndex,l=s.rowPinned,u=i.cellPositionUtils.createIdFromValues({rowIndex:a,column:e,rowPinned:l});t[u]=!0}})),l++}))},r.prototype.pasteStartingFromFocusedCell=function(e,t,o,r,i){if(r){var n={rowIndex:r.rowIndex,rowPinned:r.rowPinned},a=this.columnModel.getDisplayedColumnsStartingAt(r.column);this.isPasteSingleValueIntoRange(e)?this.pasteSingleValueIntoRange(e,o,t,i):this.pasteMultipleValues(e,n,o,a,t,"clipboard",i)}},r.prototype.isPasteSingleValueIntoRange=function(e){return this.hasOnlyOneValueToPaste(e)&&null!=this.rangeService&&!this.rangeService.isEmpty()},r.prototype.pasteSingleValueIntoRange=function(e,t,o,r){var i=this,n=e[0][0];this.iterateActiveRanges(!1,(function(e,a,l){t.push(a),l.forEach((function(e){return i.updateCellValue(a,e,n,o,"clipboard",r)}))}))},r.prototype.hasOnlyOneValueToPaste=function(e){return 1===e.length&&1===e[0].length},r.prototype.copyRangeDown=function(){var e=this;if(this.rangeService&&!this.rangeService.isEmpty()){var t=[];this.doPasteOperation((function(o,r,i,n){var a=e.gridOptionsService.getCallback("processCellForClipboard"),l=e.gridOptionsService.getCallback("processCellFromClipboard");e.iterateActiveRanges(!0,(function(i,s,c){t.length?(r.push(s),c.forEach((function(r,a){if(r.isCellEditable(s)&&!r.isSuppressPaste(s)){var c=e.processCell(s,r,t[a],"dragCopy",l,!0);s.setDataValue(r,c,"paste"),n&&n.addParentNode(s.parent,[r]);var u=i.rowIndex,p=i.rowPinned,d=e.cellPositionUtils.createIdFromValues({rowIndex:u,column:r,rowPinned:p});o[d]=!0}}))):c.forEach((function(o){var r=e.processCell(s,o,e.valueService.getValue(o,s),"dragCopy",a,!1,!0);t.push(r)}))}))}))}},r.prototype.removeLastLineIfBlank=function(e){var t=o._.last(e);if(t&&1===t.length&&""===t[0]){if(1===e.length)return;o._.removeFromArray(e,t)}},r.prototype.fireRowChanged=function(e){var t=this;"fullRow"===this.gridOptionsService.get("editType")&&e.forEach((function(e){var r={type:o.Events.EVENT_ROW_VALUE_CHANGED,node:e,data:e.data,rowIndex:e.rowIndex,rowPinned:e.rowPinned};t.eventService.dispatchEvent(r)}))},r.prototype.pasteMultipleValues=function(e,t,o,r,i,n,a){var l=this,s=t,c=null!=this.clientSideRowModel&&!this.gridOptionsService.get("enableGroupEdit")&&!this.gridOptionsService.get("treeData");e.forEach((function(e){var t=function(){for(;;){if(!s)return null;var e=l.rowPositionUtils.getRowNode(s);if(s=l.cellNavigationService.getRowBelow({rowPinned:s.rowPinned,rowIndex:s.rowIndex}),null==e)return null;if(!(e.detail||e.footer||c&&e.group))return e}}();t&&(e.forEach((function(e,o){return l.updateCellValue(t,r[o],e,i,n,a)})),o.push(t))}))},r.prototype.updateCellValue=function(e,t,o,r,i,n){if(e&&t&&t.isCellEditable(e)&&!t.isSuppressPaste(e)&&(!e.group||!t.isValueActive())){var a=this.processCell(e,t,o,i,this.gridOptionsService.getCallback("processCellFromClipboard"),!0);e.setDataValue(t,a,"paste");var l=e.rowIndex,s=e.rowPinned;r[this.cellPositionUtils.createIdFromValues({rowIndex:l,column:t,rowPinned:s})]=!0,n&&n.addParentNode(e.parent,[t])}},r.prototype.copyToClipboard=function(e){void 0===e&&(e={}),this.copyOrCutToClipboard(e)},r.prototype.cutToClipboard=function(e,t){if(void 0===e&&(e={}),void 0===t&&(t="api"),!this.gridOptionsService.get("suppressCutToClipboard")){var r={type:o.Events.EVENT_CUT_START,source:t};this.eventService.dispatchEvent(r),this.copyOrCutToClipboard(e,!0);var i={type:o.Events.EVENT_CUT_END,source:t};this.eventService.dispatchEvent(i)}},r.prototype.copyOrCutToClipboard=function(e,o){var r=e.includeHeaders,i=e.includeGroupHeaders;this.logger.log("copyToClipboard: includeHeaders = ".concat(r)),null==r&&(r=this.gridOptionsService.get("copyHeadersToClipboard")),null==i&&(i=this.gridOptionsService.get("copyGroupHeadersToClipboard"));var n={includeHeaders:r,includeGroupHeaders:i},a=!this.gridOptionsService.get("suppressCopyRowsToClipboard"),l=null;!this.rangeService||this.rangeService.isEmpty()||this.shouldSkipSingleCellRange()?a&&!this.selectionService.isEmpty()?(this.copySelectedRowsToClipboard(n),l=t.SelectedRows):this.focusService.isAnyCellFocused()&&(this.copyFocusedCellToClipboard(n),l=t.FocusedCell):(this.copySelectedRangeToClipboard(n),l=t.CellRange),o&&null!==l&&this.clearCellsAfterCopy(l)},r.prototype.clearCellsAfterCopy=function(e){if(this.eventService.dispatchEvent({type:o.Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),e===t.CellRange)this.rangeService.clearCellRangeCellValues({cellEventSource:"clipboardService"});else if(e===t.SelectedRows)this.clearSelectedRows();else{var r=this.focusService.getFocusedCell();if(null==r)return;var i=this.rowPositionUtils.getRowNode(r);i&&this.clearCellValue(i,r.column)}this.eventService.dispatchEvent({type:o.Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END})},r.prototype.clearSelectedRows=function(){var e,t,o,r,i=this.selectionService.getSelectedNodes(),n=this.columnModel.getAllDisplayedColumns();try{for(var a=c(i),l=a.next();!l.done;l=a.next()){var s=l.value;try{for(var u=(o=void 0,c(n)),p=u.next();!p.done;p=u.next()){var d=p.value;this.clearCellValue(s,d)}}catch(e){o={error:e}}finally{try{p&&!p.done&&(r=u.return)&&r.call(u)}finally{if(o)throw o.error}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(t=a.return)&&t.call(a)}finally{if(e)throw e.error}}},r.prototype.clearCellValue=function(e,t){t.isCellEditable(e)&&e.setDataValue(t,null,"clipboardService")},r.prototype.shouldSkipSingleCellRange=function(){return this.gridOptionsService.get("suppressCopySingleCellRanges")&&!this.rangeService.isMoreThanOneCell()},r.prototype.iterateActiveRanges=function(e,t,o){var r=this;if(this.rangeService&&!this.rangeService.isEmpty()){var i=this.rangeService.getCellRanges();e?this.iterateActiveRange(i[0],t,o,!0):i.forEach((function(e,n){return r.iterateActiveRange(e,t,o,n===i.length-1)}))}},r.prototype.iterateActiveRange=function(e,t,o,r){if(this.rangeService){var i=this.rangeService.getRangeStartRow(e),n=this.rangeService.getRangeEndRow(e);o&&e.columns&&o(e.columns);for(var a=0,l=!1;!l&&null!=i;){var s=this.rowPositionUtils.getRowNode(i);l=this.rowPositionUtils.sameRow(i,n),t(i,s,e.columns,a++,l&&r),i=this.cellNavigationService.getRowBelow(i)}}},r.prototype.copySelectedRangeToClipboard=function(e){if(void 0===e&&(e={}),this.rangeService&&!this.rangeService.isEmpty()){var t=this.rangeService.areAllRangesAbleToMerge()?this.buildDataFromMergedRanges(e):this.buildDataFromRanges(e),o=t.data,r=t.cellsToFlash;this.copyDataToClipboard(o),this.dispatchFlashCells(r)}},r.prototype.buildDataFromMergedRanges=function(e){var t=this,o=new Set,r=this.rangeService.getCellRanges(),i=new Map,n=[],a={};r.forEach((function(e){e.columns.forEach((function(e){return o.add(e)}));var r=t.getRangeRowPositionsAndCellsToFlash(e),l=r.rowPositions,s=r.cellsToFlash;l.forEach((function(e){var t="".concat(e.rowIndex,"-").concat(e.rowPinned||"null");i.get(t)||(i.set(t,!0),n.push(e))})),Object.assign(a,s)}));var l=this.columnModel.getAllDisplayedColumns(),s=Array.from(o);return s.sort((function(e,t){return l.indexOf(e)-l.indexOf(t)})),{data:this.buildExportParams({columns:s,rowPositions:n,includeHeaders:e.includeHeaders,includeGroupHeaders:e.includeGroupHeaders}),cellsToFlash:a}},r.prototype.buildDataFromRanges=function(e){var t=this,o=this.rangeService.getCellRanges(),r=[],i={};return o.forEach((function(o){var n=t.getRangeRowPositionsAndCellsToFlash(o),a=n.rowPositions,l=n.cellsToFlash;Object.assign(i,l),r.push(t.buildExportParams({columns:o.columns,rowPositions:a,includeHeaders:e.includeHeaders,includeGroupHeaders:e.includeGroupHeaders}))})),{data:r.join("\n"),cellsToFlash:i}},r.prototype.getRangeRowPositionsAndCellsToFlash=function(e){for(var t=this,o=[],r={},i=this.rangeService.getRangeStartRow(e),n=this.rangeService.getRangeEndRow(e),a=i;a&&(o.push(a),e.columns.forEach((function(e){var o=a,i=o.rowIndex,n=o.rowPinned,l=t.cellPositionUtils.createIdFromValues({rowIndex:i,column:e,rowPinned:n});r[l]=!0})),!this.rowPositionUtils.sameRow(a,n));)a=this.cellNavigationService.getRowBelow(a);return{rowPositions:o,cellsToFlash:r}},r.prototype.getCellsToFlashFromRowNodes=function(e){for(var t=this.columnModel.getAllDisplayedColumns(),o={},r=0;r<e.length;r++){var i=e[r],n=i.rowIndex,a=i.rowPinned;if(null!=n)for(var l=0;l<t.length;l++){var s=t[l];o[this.cellPositionUtils.createIdFromValues({rowIndex:n,column:s,rowPinned:a})]=!0}}return o},r.prototype.copyFocusedCellToClipboard=function(e){var t;void 0===e&&(e={});var o=this.focusService.getFocusedCell();if(null!=o){var r=this.cellPositionUtils.createId(o),i={rowPinned:o.rowPinned,rowIndex:o.rowIndex},n=o.column,a=this.buildExportParams({columns:[n],rowPositions:[i],includeHeaders:e.includeHeaders,includeGroupHeaders:e.includeGroupHeaders});this.copyDataToClipboard(a),this.dispatchFlashCells(((t={})[r]=!0,t))}},r.prototype.copySelectedRowsToClipboard=function(e){void 0===e&&(e={});var t=e.columnKeys,o=e.includeHeaders,r=e.includeGroupHeaders,i=this.buildExportParams({columns:t,includeHeaders:o,includeGroupHeaders:r});this.copyDataToClipboard(i);var n=this.selectionService.getSelectedNodes()||[];this.dispatchFlashCells(this.getCellsToFlashFromRowNodes(n))},r.prototype.buildExportParams=function(e){var t=this,o=e.columns,r=e.rowPositions,i=e.includeHeaders,n=void 0!==i&&i,a=e.includeGroupHeaders,l={columnKeys:o,rowPositions:r,skipColumnHeaders:!n,skipColumnGroupHeaders:!(void 0!==a&&a),suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!r,processCellCallback:this.gridOptionsService.getCallback("processCellForClipboard"),processRowGroupCallback:function(e){return t.processRowGroupCallback(e)},processHeaderCallback:this.gridOptionsService.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:this.gridOptionsService.getCallback("processGroupHeaderForClipboard")};return this.csvCreator.getDataAsCsv(l,!0)},r.prototype.processRowGroupCallback=function(e){var t=this,o=e.node,r=e.column,i=this.gridOptionsService.get("treeData"),n=this.gridOptionsService.get("suppressGroupMaintainValueType"),a=function(){var e,a;if(i||n||!r)return o.key;var l=null===(e=o.groupData)||void 0===e?void 0:e[r.getId()];return l&&o.rowGroupColumn&&!1!==o.rowGroupColumn.getColDef().useValueFormatterForExport&&null!==(a=t.valueFormatterService.formatValue(o.rowGroupColumn,o,l))&&void 0!==a?a:l}();if(e.node.footer){var l="";a&&a.length&&(l=" ".concat(a)),a="Total".concat(l)}var s=this.gridOptionsService.getCallback("processCellForClipboard");if(s){var c=o.rowGroupColumn;return!c&&o.footer&&-1===o.level&&(c=this.columnModel.getRowGroupColumns()[0]),s({value:a,node:o,column:c,type:"clipboard",formatValue:function(e){var r;return null!==(r=t.valueFormatterService.formatValue(c,o,e))&&void 0!==r?r:e},parseValue:function(e){return t.valueParserService.parseValue(c,o,e,t.valueService.getValue(c,o))}})}return a},r.prototype.dispatchFlashCells=function(e){var t=this;window.setTimeout((function(){var r={type:o.Events.EVENT_FLASH_CELLS,cells:e};t.eventService.dispatchEvent(r)}),0)},r.prototype.processCell=function(e,t,o,r,i,n,a){var l,s=this;return i?i({column:t,node:e,value:o,type:r,formatValue:function(o){var r;return null!==(r=s.valueFormatterService.formatValue(t,null!=e?e:null,o))&&void 0!==r?r:o},parseValue:function(o){return s.valueParserService.parseValue(t,null!=e?e:null,o,s.valueService.getValue(t,e))}}):n&&!1!==t.getColDef().useValueParserForImport?this.valueParserService.parseValue(t,null!=e?e:null,o,this.valueService.getValue(t,e)):a&&!1!==t.getColDef().useValueFormatterForExport&&null!==(l=this.valueFormatterService.formatValue(t,null!=e?e:null,o))&&void 0!==l?l:o},r.prototype.copyDataToClipboard=function(e){var t=this,r=this.gridOptionsService.getCallback("sendToClipboard");r?r({data:e}):!this.gridOptionsService.get("suppressClipboardApi")&&navigator.clipboard?navigator.clipboard.writeText(e).catch((function(r){o._.doOnce((function(){console.warn(r),console.warn(u("writeText"))}),"clipboardApiError"),t.copyDataToClipboardLegacy(e)})):this.copyDataToClipboardLegacy(e)},r.prototype.copyDataToClipboardLegacy=function(e){var t=this;this.executeOnTempElement((function(o){var r=t.gridOptionsService.getDocument(),i=r.activeElement;o.value=e||" ",o.select(),o.focus({preventScroll:!0}),r.execCommand("copy")||console.warn("AG Grid: Browser did not allow document.execCommand('copy'). Ensure api.copySelectedRowsToClipboard() is invoked via a user event, i.e. button click, otherwise the browser will prevent it for security reasons."),null!=i&&null!=i.focus&&i.focus({preventScroll:!0})}))},r.prototype.executeOnTempElement=function(e,t){var o=this.gridOptionsService.getDocument(),r=o.createElement("textarea");r.style.width="1px",r.style.height="1px",r.style.top=o.documentElement.scrollTop+"px",r.style.left=o.documentElement.scrollLeft+"px",r.style.position="absolute",r.style.opacity="0";var i=this.gridCtrl.getGui();i.appendChild(r);try{e(r)}catch(e){console.warn("AG Grid: Browser does not support document.execCommand('copy') for clipboard operations")}t?window.setTimeout((function(){t(r),i.removeChild(r)}),100):i.removeChild(r)},r.prototype.getRangeSize=function(){var e=this.rangeService.getCellRanges(),t=0,o=0;return e.length>0&&(t=this.rangeService.getRangeStartRow(e[0]).rowIndex,o=this.rangeService.getRangeEndRow(e[0]).rowIndex),t-o+1},a([o.Autowired("csvCreator")],r.prototype,"csvCreator",void 0),a([o.Autowired("loggerFactory")],r.prototype,"loggerFactory",void 0),a([o.Autowired("selectionService")],r.prototype,"selectionService",void 0),a([o.Optional("rangeService")],r.prototype,"rangeService",void 0),a([o.Autowired("rowModel")],r.prototype,"rowModel",void 0),a([o.Autowired("ctrlsService")],r.prototype,"ctrlsService",void 0),a([o.Autowired("valueService")],r.prototype,"valueService",void 0),a([o.Autowired("focusService")],r.prototype,"focusService",void 0),a([o.Autowired("rowRenderer")],r.prototype,"rowRenderer",void 0),a([o.Autowired("columnModel")],r.prototype,"columnModel",void 0),a([o.Autowired("cellNavigationService")],r.prototype,"cellNavigationService",void 0),a([o.Autowired("cellPositionUtils")],r.prototype,"cellPositionUtils",void 0),a([o.Autowired("rowPositionUtils")],r.prototype,"rowPositionUtils",void 0),a([o.Autowired("valueFormatterService")],r.prototype,"valueFormatterService",void 0),a([o.Autowired("valueParserService")],r.prototype,"valueParserService",void 0),a([o.PostConstruct],r.prototype,"init",null),r=i=a([o.Bean("clipboardService")],r)}(o.BeanStub),d={version:"31.1.0",moduleName:o.ModuleNames.ClipboardModule,beans:[p],dependantModules:[r.EnterpriseCoreModule,i.CsvExportModule]};exports.ClipboardModule=d;

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

export declare const VERSION = "31.0.3";
export declare const VERSION = "31.1.0";
// DO NOT UPDATE MANUALLY: Generated from script during build time
export var VERSION = '31.0.3';
export var VERSION = '31.1.0';

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

export declare const VERSION = "31.0.3";
export declare const VERSION = "31.1.0";
{
"name": "@ag-grid-enterprise/clipboard",
"version": "31.0.3",
"version": "31.1.0",
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue",

@@ -50,5 +50,5 @@ "main": "./dist/esm/es6/main.mjs",

"dependencies": {
"@ag-grid-community/core": "~31.0.3",
"@ag-grid-community/csv-export": "~31.0.3",
"@ag-grid-enterprise/core": "~31.0.3"
"@ag-grid-community/core": "~31.1.0",
"@ag-grid-community/csv-export": "~31.1.0",
"@ag-grid-enterprise/core": "~31.1.0"
},

@@ -58,3 +58,3 @@ "devDependencies": {

"@types/jest": "^29.5.0",
"@types/node": "12.20.20",
"@types/node": "18.19.10",
"jest": "^29.5.0",

@@ -61,0 +61,0 @@ "ts-jest": "^29.1.0",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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