@ag-grid-enterprise/clipboard
Advanced tools
Comparing version 32.0.1 to 32.0.2
@@ -877,3 +877,3 @@ var __defProp = Object.defineProperty; | ||
// enterprise-modules/clipboard/src/version.ts | ||
var VERSION = "32.0.1"; | ||
var VERSION = "32.0.2"; | ||
@@ -880,0 +880,0 @@ // enterprise-modules/clipboard/src/clipboardModule.ts |
@@ -6,2 +6,2 @@ var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(p,e)=>{for(var t in e)__defProp(p,t,{get:e[t],enumerable:!0})},__copyProps=(p,e,t,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of __getOwnPropNames(e))!__hasOwnProp.call(p,o)&&o!==t&&__defProp(p,o,{get:()=>e[o],enumerable:!(s=__getOwnPropDesc(e,o))||s.enumerable});return p},__toCommonJS=p=>__copyProps(__defProp({},"__esModule",{value:!0}),p),main_exports={};__export(main_exports,{ClipboardModule:()=>ClipboardModule}),module.exports=__toCommonJS(main_exports);var import_core2=require("@ag-grid-community/core"),import_csv_export=require("@ag-grid-community/csv-export"),import_core3=require("@ag-grid-enterprise/core");function copyToClipboard(p,e){p.clipboardService?.copyToClipboard(e)}function cutToClipboard(p,e){p.clipboardService?.cutToClipboard(e)}function copySelectedRowsToClipboard(p,e){p.clipboardService?.copySelectedRowsToClipboard(e)}function copySelectedRangeToClipboard(p,e){p.clipboardService?.copySelectedRangeToClipboard(e)}function copySelectedRangeDown(p){p.clipboardService?.copyRangeDown()}function pasteFromClipboard(p){p.clipboardService?.pasteFromClipboard()}var import_core=require("@ag-grid-community/core"),SOURCE_PASTE="paste",EXPORT_TYPE_DRAG_COPY="dragCopy",EXPORT_TYPE_CLIPBOARD="clipboard",apiError=p=>`AG Grid: Unable to use the Clipboard API (navigator.clipboard.${p}()). 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.`,ClipboardService=class S extends import_core.BeanStub{constructor(){super(...arguments),this.beanName="clipboardService",this.lastPasteOperationTime=0,this.navigatorApiFailed=!1}wireBeans(e){this.csvCreator=e.csvCreator,this.selectionService=e.selectionService,this.rowModel=e.rowModel,this.ctrlsService=e.ctrlsService,this.valueService=e.valueService,this.focusService=e.focusService,this.rowRenderer=e.rowRenderer,this.visibleColsService=e.visibleColsService,this.funcColsService=e.funcColsService,this.cellNavigationService=e.cellNavigationService,this.cellPositionUtils=e.cellPositionUtils,this.rowPositionUtils=e.rowPositionUtils,this.rangeService=e.rangeService}postConstruct(){this.rowModel.getType()==="clientSide"&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl})}pasteFromClipboard(){!this.gos.get("suppressClipboardApi")&&!this.navigatorApiFailed&&navigator.clipboard&&navigator.clipboard.readText?navigator.clipboard.readText().then(this.processClipboardData.bind(this)).catch(t=>{(0,import_core._warnOnce)(`${t} | ||
`),cellsToFlash:i}}getRangeRowPositionsAndCellsToFlash(e,t){const s=[],o={},i=e.getRangeStartRow(t),l=e.getRangeEndRow(t);let r=i;for(;r&&(s.push(r),t.columns.forEach(n=>{const{rowIndex:a,rowPinned:u}=r,c=this.cellPositionUtils.createIdFromValues({rowIndex:a,column:n,rowPinned:u});o[c]=!0}),!this.rowPositionUtils.sameRow(r,l));)r=this.cellNavigationService.getRowBelow(r);return{rowPositions:s,cellsToFlash:o}}getCellsToFlashFromRowNodes(e){const t=this.visibleColsService.getAllCols(),s={};for(let o=0;o<e.length;o++){const{rowIndex:i,rowPinned:l}=e[o];if(i!=null)for(let r=0;r<t.length;r++){const n=t[r],a=this.cellPositionUtils.createIdFromValues({rowIndex:i,column:n,rowPinned:l});s[a]=!0}}return s}copyFocusedCellToClipboard(e={}){const t=this.focusService.getFocusedCell();if(t==null)return;const s=this.cellPositionUtils.createId(t),o={rowPinned:t.rowPinned,rowIndex:t.rowIndex},i=t.column,l=this.buildExportParams({columns:[i],rowPositions:[o],includeHeaders:e.includeHeaders,includeGroupHeaders:e.includeGroupHeaders});this.copyDataToClipboard(l),this.dispatchFlashCells({[s]:!0})}copySelectedRowsToClipboard(e={}){const{columnKeys:t,includeHeaders:s,includeGroupHeaders:o}=e,i=this.buildExportParams({columns:t,includeHeaders:s,includeGroupHeaders:o});this.copyDataToClipboard(i);const l=this.selectionService.getSelectedNodes()||[];this.dispatchFlashCells(this.getCellsToFlashFromRowNodes(l))}buildExportParams(e){const{columns:t,rowPositions:s,includeHeaders:o=!1,includeGroupHeaders:i=!1}=e,l={columnKeys:t,rowPositions:s,skipColumnHeaders:!o,skipColumnGroupHeaders:!i,suppressQuotes:!0,columnSeparator:this.getClipboardDelimiter(),onlySelected:!s,processCellCallback:this.gos.getCallback("processCellForClipboard"),processRowGroupCallback:r=>this.processRowGroupCallback(r),processHeaderCallback:this.gos.getCallback("processHeaderForClipboard"),processGroupHeaderCallback:this.gos.getCallback("processGroupHeaderForClipboard")};return this.csvCreator.getDataAsCsv(l,!0)}processRowGroupCallback(e){const{node:t,column:s}=e,o=this.gos.get("treeData"),i=this.gos.get("suppressGroupMaintainValueType");let r=(()=>{if(o||i||!s)return t.key;const a=t.groupData?.[s.getId()];return!a||!t.rowGroupColumn||t.rowGroupColumn.getColDef().useValueFormatterForExport===!1?a:this.valueService.formatValue(t.rowGroupColumn,t,a)??a})();if(e.node.footer){let a="";r&&r.length&&(a=` ${r}`),r=`Total${a}`}const n=this.gos.getCallback("processCellForClipboard");if(n){let a=t.rowGroupColumn;return!a&&t.footer&&t.level===-1&&(a=this.funcColsService.getRowGroupColumns()[0]),n({value:r,node:t,column:a,type:"clipboard",formatValue:u=>this.valueService.formatValue(a,t,u)??u,parseValue:u=>this.valueService.parseValue(a,t,u,this.valueService.getValue(a,t))})}return r}dispatchFlashCells(e){window.setTimeout(()=>{const t={type:"flashCells",cells:e};this.eventService.dispatchEvent(t)},0)}processCell(e,t,s,o,i,l,r){return i?i({column:t,node:e,value:s,type:o,formatValue:a=>this.valueService.formatValue(t,e??null,a)??a,parseValue:a=>this.valueService.parseValue(t,e??null,a,this.valueService.getValue(t,e))}):l&&t.getColDef().useValueParserForImport!==!1?this.valueService.parseValue(t,e??null,s,this.valueService.getValue(t,e)):r&&t.getColDef().useValueFormatterForExport!==!1?this.valueService.formatValue(t,e??null,s)??s:s}copyDataToClipboard(e){const t=this.gos.getCallback("sendToClipboard");if(t){t({data:e});return}if(!this.gos.get("suppressClipboardApi")&&navigator.clipboard){navigator.clipboard.writeText(e).catch(o=>{(0,import_core._warnOnce)(`${o} | ||
${apiError("writeText")}`),this.copyDataToClipboardLegacy(e)});return}this.copyDataToClipboardLegacy(e)}copyDataToClipboardLegacy(e){this.executeOnTempElement(t=>{const s=this.gos.getDocument(),o=this.gos.getActiveDomElement();t.value=e||" ",t.select(),t.focus({preventScroll:!0}),s.execCommand("copy")||(0,import_core._warnOnce)("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."),o!=null&&o.focus!=null&&o.focus({preventScroll:!0})})}executeOnTempElement(e,t){const s=this.gos.getDocument(),o=s.createElement("textarea");o.style.width="1px",o.style.height="1px",o.style.top=s.documentElement.scrollTop+"px",o.style.left=s.documentElement.scrollLeft+"px",o.style.position="absolute",o.style.opacity="0";const i=this.gridCtrl.getGui();i.appendChild(o);try{e(o)}catch{(0,import_core._warnOnce)("Browser does not support document.execCommand('copy') for clipboard operations")}t?window.setTimeout(()=>{t(o),i.removeChild(o)},100):i.removeChild(o)}getRangeSize(e){const t=e.getCellRanges();let s=0,o=0;return t.length>0&&(s=e.getRangeStartRow(t[0]).rowIndex,o=e.getRangeEndRow(t[0]).rowIndex),s-o+1}},VERSION="32.0.1",ClipboardCoreModule={version:VERSION,moduleName:`${import_core2.ModuleNames.ClipboardModule}-core`,beans:[ClipboardService],dependantModules:[import_core3.EnterpriseCoreModule,import_csv_export.CsvExportModule]},ClipboardApiModule={version:VERSION,moduleName:`${import_core2.ModuleNames.ClipboardModule}-api`,apiFunctions:{copyToClipboard,cutToClipboard,copySelectedRowsToClipboard,copySelectedRangeToClipboard,copySelectedRangeDown,pasteFromClipboard},dependantModules:[ClipboardCoreModule]},ClipboardModule={version:VERSION,moduleName:import_core2.ModuleNames.ClipboardModule,dependantModules:[ClipboardCoreModule,ClipboardApiModule]}; | ||
${apiError("writeText")}`),this.copyDataToClipboardLegacy(e)});return}this.copyDataToClipboardLegacy(e)}copyDataToClipboardLegacy(e){this.executeOnTempElement(t=>{const s=this.gos.getDocument(),o=this.gos.getActiveDomElement();t.value=e||" ",t.select(),t.focus({preventScroll:!0}),s.execCommand("copy")||(0,import_core._warnOnce)("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."),o!=null&&o.focus!=null&&o.focus({preventScroll:!0})})}executeOnTempElement(e,t){const s=this.gos.getDocument(),o=s.createElement("textarea");o.style.width="1px",o.style.height="1px",o.style.top=s.documentElement.scrollTop+"px",o.style.left=s.documentElement.scrollLeft+"px",o.style.position="absolute",o.style.opacity="0";const i=this.gridCtrl.getGui();i.appendChild(o);try{e(o)}catch{(0,import_core._warnOnce)("Browser does not support document.execCommand('copy') for clipboard operations")}t?window.setTimeout(()=>{t(o),i.removeChild(o)},100):i.removeChild(o)}getRangeSize(e){const t=e.getCellRanges();let s=0,o=0;return t.length>0&&(s=e.getRangeStartRow(t[0]).rowIndex,o=e.getRangeEndRow(t[0]).rowIndex),s-o+1}},VERSION="32.0.2",ClipboardCoreModule={version:VERSION,moduleName:`${import_core2.ModuleNames.ClipboardModule}-core`,beans:[ClipboardService],dependantModules:[import_core3.EnterpriseCoreModule,import_csv_export.CsvExportModule]},ClipboardApiModule={version:VERSION,moduleName:`${import_core2.ModuleNames.ClipboardModule}-api`,apiFunctions:{copyToClipboard,cutToClipboard,copySelectedRowsToClipboard,copySelectedRangeToClipboard,copySelectedRangeDown,pasteFromClipboard},dependantModules:[ClipboardCoreModule]},ClipboardModule={version:VERSION,moduleName:import_core2.ModuleNames.ClipboardModule,dependantModules:[ClipboardCoreModule,ClipboardApiModule]}; |
{ | ||
"name": "@ag-grid-enterprise/clipboard", | ||
"version": "32.0.1", | ||
"version": "32.0.2", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -16,5 +16,5 @@ "main": "./dist/package/main.cjs.js", | ||
"dependencies": { | ||
"@ag-grid-community/core": "32.0.1", | ||
"@ag-grid-community/csv-export": "32.0.1", | ||
"@ag-grid-enterprise/core": "32.0.1" | ||
"@ag-grid-community/core": "32.0.2", | ||
"@ag-grid-community/csv-export": "32.0.2", | ||
"@ag-grid-enterprise/core": "32.0.2" | ||
}, | ||
@@ -21,0 +21,0 @@ "devDependencies": { |
{ | ||
"name": "@ag-grid-enterprise/clipboard", | ||
"version": "32.0.1", | ||
"version": "32.0.2", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -16,5 +16,5 @@ "main": "./src/main.js", | ||
"dependencies": { | ||
"@ag-grid-community/core": "32.0.1", | ||
"@ag-grid-community/csv-export": "32.0.1", | ||
"@ag-grid-enterprise/core": "32.0.1" | ||
"@ag-grid-community/core": "32.0.2", | ||
"@ag-grid-community/csv-export": "32.0.2", | ||
"@ag-grid-enterprise/core": "32.0.2" | ||
}, | ||
@@ -21,0 +21,0 @@ "devDependencies": { |
@@ -1,1 +0,1 @@ | ||
export declare const VERSION = "32.0.1"; | ||
export declare const VERSION = "32.0.2"; |
{ | ||
"name": "@ag-grid-enterprise/clipboard", | ||
"version": "32.0.1", | ||
"version": "32.0.2", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue", | ||
@@ -16,5 +16,5 @@ "main": "./dist/package/main.cjs.js", | ||
"dependencies": { | ||
"@ag-grid-community/core": "32.0.1", | ||
"@ag-grid-community/csv-export": "32.0.1", | ||
"@ag-grid-enterprise/core": "32.0.1" | ||
"@ag-grid-community/core": "32.0.2", | ||
"@ag-grid-community/csv-export": "32.0.2", | ||
"@ag-grid-enterprise/core": "32.0.2" | ||
}, | ||
@@ -21,0 +21,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
+ Added@ag-grid-community/core@32.0.2(transitive)
+ Added@ag-grid-community/csv-export@32.0.2(transitive)
+ Added@ag-grid-enterprise/core@32.0.2(transitive)
+ Addedag-charts-types@10.0.2(transitive)
- Removed@ag-grid-community/core@32.0.1(transitive)
- Removed@ag-grid-community/csv-export@32.0.1(transitive)
- Removed@ag-grid-enterprise/core@32.0.1(transitive)
- Removedag-charts-types@10.0.1(transitive)