@ag-grid-enterprise/clipboard
Advanced tools
Comparing version 25.3.0 to 26.0.0
@@ -1,12 +0,13 @@ | ||
import { BeanStub, CellPositionUtils, Column, GridCompController, IClipboardService, RowPositionUtils } from "@ag-grid-community/core"; | ||
import { BeanStub, CellPositionUtils, Column, IClipboardService, RowPositionUtils, CtrlsService } from "@ag-grid-community/core"; | ||
export declare class ClipboardService extends BeanStub implements IClipboardService { | ||
private csvCreator; | ||
private loggerFactory; | ||
private selectionController; | ||
private rangeController; | ||
private selectionService; | ||
private rangeService; | ||
private rowModel; | ||
ctrlsService: CtrlsService; | ||
private valueService; | ||
private focusController; | ||
private focusService; | ||
private rowRenderer; | ||
private columnController; | ||
private columnModel; | ||
private cellNavigationService; | ||
@@ -19,5 +20,4 @@ private columnApi; | ||
private logger; | ||
private gridCompController; | ||
private gridCtrl; | ||
private navigatorApiFailed; | ||
registerGridCompController(gridCompController: GridCompController): void; | ||
private init; | ||
@@ -24,0 +24,0 @@ pasteFromClipboard(): void; |
@@ -30,6 +30,4 @@ "use strict"; | ||
} | ||
ClipboardService.prototype.registerGridCompController = function (gridCompController) { | ||
this.gridCompController = gridCompController; | ||
}; | ||
ClipboardService.prototype.init = function () { | ||
var _this = this; | ||
this.logger = this.loggerFactory.create('ClipboardService'); | ||
@@ -39,2 +37,5 @@ if (this.rowModel.getType() === core_1.Constants.ROW_MODEL_TYPE_CLIENT_SIDE) { | ||
} | ||
this.ctrlsService.whenReady(function (p) { | ||
_this.gridCtrl = p.gridCtrl; | ||
}); | ||
}; | ||
@@ -94,3 +95,3 @@ ClipboardService.prototype.pasteFromClipboard = function () { | ||
var pasteOperation = function (cellsToFlash, updatedRowNodes, focusedCell, changedPath) { | ||
var rangeActive = _this.rangeController && _this.rangeController.isMoreThanOneCell(); | ||
var rangeActive = _this.rangeService && _this.rangeService.isMoreThanOneCell(); | ||
var pasteIntoRange = rangeActive && !_this.hasOnlyOneValueToPaste(parsedData); | ||
@@ -124,3 +125,3 @@ if (pasteIntoRange) { | ||
var updatedRowNodes = []; | ||
var focusedCell = this.focusController.getFocusedCell(); | ||
var focusedCell = this.focusService.getFocusedCell(); | ||
pasteOperationFunc(cellsToFlash, updatedRowNodes, focusedCell, changedPath); | ||
@@ -137,3 +138,3 @@ if (changedPath) { | ||
if (focusedCell) { | ||
this.focusController.setFocusedCell(focusedCell.rowIndex, focusedCell.column, focusedCell.rowPinned, true); | ||
this.focusService.setFocusedCell(focusedCell.rowIndex, focusedCell.column, focusedCell.rowPinned, true); | ||
} | ||
@@ -192,3 +193,3 @@ this.eventService.dispatchEvent({ | ||
var currentRow = { rowIndex: focusedCell.rowIndex, rowPinned: focusedCell.rowPinned }; | ||
var columnsToPasteInto = this.columnController.getDisplayedColumnsStartingAt(focusedCell.column); | ||
var columnsToPasteInto = this.columnModel.getDisplayedColumnsStartingAt(focusedCell.column); | ||
if (this.isPasteSingleValueIntoRange(parsedData)) { | ||
@@ -204,4 +205,4 @@ this.pasteSingleValueIntoRange(parsedData, updatedRowNodes, cellsToFlash, changedPath); | ||
return this.hasOnlyOneValueToPaste(parsedData) | ||
&& this.rangeController != null | ||
&& !this.rangeController.isEmpty(); | ||
&& this.rangeService != null | ||
&& !this.rangeService.isEmpty(); | ||
}; | ||
@@ -224,3 +225,3 @@ ClipboardService.prototype.pasteSingleValueIntoRange = function (parsedData, updatedRowNodes, cellsToFlash, changedPath) { | ||
var _this = this; | ||
if (!this.rangeController || this.rangeController.isEmpty()) { | ||
if (!this.rangeService || this.rangeService.isEmpty()) { | ||
return; | ||
@@ -349,6 +350,6 @@ } | ||
} | ||
var selectedRowsToCopy = !this.selectionController.isEmpty() | ||
var selectedRowsToCopy = !this.selectionService.isEmpty() | ||
&& !this.gridOptionsWrapper.isSuppressCopyRowsToClipboard(); | ||
// default is copy range if exists, otherwise rows | ||
if (this.rangeController && this.rangeController.isMoreThanOneCell()) { | ||
if (this.rangeService && this.rangeService.isMoreThanOneCell()) { | ||
this.copySelectedRangeToClipboard(includeHeaders); | ||
@@ -360,3 +361,3 @@ } | ||
} | ||
else if (this.focusController.isAnyCellFocused()) { | ||
else if (this.focusService.isAnyCellFocused()) { | ||
// if there is a focused cell, copy this | ||
@@ -376,6 +377,6 @@ this.copyFocusedCellToClipboard(includeHeaders); | ||
var _this = this; | ||
if (!this.rangeController || this.rangeController.isEmpty()) { | ||
if (!this.rangeService || this.rangeService.isEmpty()) { | ||
return; | ||
} | ||
var cellRanges = this.rangeController.getCellRanges(); | ||
var cellRanges = this.rangeService.getCellRanges(); | ||
if (onlyFirst) { | ||
@@ -389,7 +390,7 @@ this.iterateActiveRange(cellRanges[0], rowCallback, columnCallback, true); | ||
ClipboardService.prototype.iterateActiveRange = function (range, rowCallback, columnCallback, isLastRange) { | ||
if (!this.rangeController) { | ||
if (!this.rangeService) { | ||
return; | ||
} | ||
var currentRow = this.rangeController.getRangeStartRow(range); | ||
var lastRow = this.rangeController.getRangeEndRow(range); | ||
var currentRow = this.rangeService.getRangeStartRow(range); | ||
var lastRow = this.rangeService.getRangeEndRow(range); | ||
if (columnCallback && range.columns) { | ||
@@ -412,3 +413,3 @@ columnCallback(range.columns); | ||
if (includeHeaders === void 0) { includeHeaders = false; } | ||
if (!this.rangeController || this.rangeController.isEmpty()) { | ||
if (!this.rangeService || this.rangeService.isEmpty()) { | ||
return; | ||
@@ -426,3 +427,3 @@ } | ||
var columnNames = columns.map(function (column) { | ||
var name = _this.columnController.getDisplayNameForColumn(column, 'clipboard', true); | ||
var name = _this.columnModel.getDisplayNameForColumn(column, 'clipboard', true); | ||
return _this.processHeader(column, name, processHeaderForClipboardFunc) || ''; | ||
@@ -458,3 +459,3 @@ }); | ||
if (includeHeaders === void 0) { includeHeaders = false; } | ||
var focusedCell = this.focusController.getFocusedCell(); | ||
var focusedCell = this.focusService.getFocusedCell(); | ||
if (focusedCell == null) { | ||
@@ -472,3 +473,3 @@ return; | ||
if (includeHeaders) { | ||
var headerValue = this.columnController.getDisplayNameForColumn(column, 'clipboard', true); | ||
var headerValue = this.columnModel.getDisplayNameForColumn(column, 'clipboard', true); | ||
data = this.processHeader(column, headerValue, this.gridOptionsWrapper.getProcessHeaderForClipboardFunc()) + '\r\n' + processedValue; | ||
@@ -592,3 +593,3 @@ } | ||
eTempInput.style.opacity = '0'; | ||
var guiRoot = this.gridCompController.getGui(); | ||
var guiRoot = this.gridCtrl.getGui(); | ||
guiRoot.appendChild(eTempInput); | ||
@@ -613,8 +614,8 @@ try { | ||
ClipboardService.prototype.getRangeSize = function () { | ||
var ranges = this.rangeController.getCellRanges(); | ||
var ranges = this.rangeService.getCellRanges(); | ||
var startRangeIndex = 0; | ||
var endRangeIndex = 0; | ||
if (ranges.length > 0) { | ||
startRangeIndex = this.rangeController.getRangeStartRow(ranges[0]).rowIndex; | ||
endRangeIndex = this.rangeController.getRangeEndRow(ranges[0]).rowIndex; | ||
startRangeIndex = this.rangeService.getRangeStartRow(ranges[0]).rowIndex; | ||
endRangeIndex = this.rangeService.getRangeEndRow(ranges[0]).rowIndex; | ||
} | ||
@@ -630,7 +631,7 @@ return startRangeIndex - endRangeIndex + 1; | ||
__decorate([ | ||
core_1.Autowired('selectionController') | ||
], ClipboardService.prototype, "selectionController", void 0); | ||
core_1.Autowired('selectionService') | ||
], ClipboardService.prototype, "selectionService", void 0); | ||
__decorate([ | ||
core_1.Optional('rangeController') | ||
], ClipboardService.prototype, "rangeController", void 0); | ||
core_1.Optional('rangeService') | ||
], ClipboardService.prototype, "rangeService", void 0); | ||
__decorate([ | ||
@@ -640,7 +641,10 @@ core_1.Autowired('rowModel') | ||
__decorate([ | ||
core_1.Autowired('ctrlsService') | ||
], ClipboardService.prototype, "ctrlsService", void 0); | ||
__decorate([ | ||
core_1.Autowired('valueService') | ||
], ClipboardService.prototype, "valueService", void 0); | ||
__decorate([ | ||
core_1.Autowired('focusController') | ||
], ClipboardService.prototype, "focusController", void 0); | ||
core_1.Autowired('focusService') | ||
], ClipboardService.prototype, "focusService", void 0); | ||
__decorate([ | ||
@@ -650,4 +654,4 @@ core_1.Autowired('rowRenderer') | ||
__decorate([ | ||
core_1.Autowired('columnController') | ||
], ClipboardService.prototype, "columnController", void 0); | ||
core_1.Autowired('columnModel') | ||
], ClipboardService.prototype, "columnModel", void 0); | ||
__decorate([ | ||
@@ -654,0 +658,0 @@ core_1.Autowired('cellNavigationService') |
@@ -1,12 +0,13 @@ | ||
import { BeanStub, CellPositionUtils, Column, GridCompController, IClipboardService, RowPositionUtils } from "@ag-grid-community/core"; | ||
import { BeanStub, CellPositionUtils, Column, IClipboardService, RowPositionUtils, CtrlsService } from "@ag-grid-community/core"; | ||
export declare class ClipboardService extends BeanStub implements IClipboardService { | ||
private csvCreator; | ||
private loggerFactory; | ||
private selectionController; | ||
private rangeController; | ||
private selectionService; | ||
private rangeService; | ||
private rowModel; | ||
ctrlsService: CtrlsService; | ||
private valueService; | ||
private focusController; | ||
private focusService; | ||
private rowRenderer; | ||
private columnController; | ||
private columnModel; | ||
private cellNavigationService; | ||
@@ -19,5 +20,4 @@ private columnApi; | ||
private logger; | ||
private gridCompController; | ||
private gridCtrl; | ||
private navigatorApiFailed; | ||
registerGridCompController(gridCompController: GridCompController): void; | ||
private init; | ||
@@ -24,0 +24,0 @@ pasteFromClipboard(): void; |
@@ -28,6 +28,4 @@ var __extends = (this && this.__extends) || (function () { | ||
} | ||
ClipboardService.prototype.registerGridCompController = function (gridCompController) { | ||
this.gridCompController = gridCompController; | ||
}; | ||
ClipboardService.prototype.init = function () { | ||
var _this = this; | ||
this.logger = this.loggerFactory.create('ClipboardService'); | ||
@@ -37,2 +35,5 @@ if (this.rowModel.getType() === Constants.ROW_MODEL_TYPE_CLIENT_SIDE) { | ||
} | ||
this.ctrlsService.whenReady(function (p) { | ||
_this.gridCtrl = p.gridCtrl; | ||
}); | ||
}; | ||
@@ -92,3 +93,3 @@ ClipboardService.prototype.pasteFromClipboard = function () { | ||
var pasteOperation = function (cellsToFlash, updatedRowNodes, focusedCell, changedPath) { | ||
var rangeActive = _this.rangeController && _this.rangeController.isMoreThanOneCell(); | ||
var rangeActive = _this.rangeService && _this.rangeService.isMoreThanOneCell(); | ||
var pasteIntoRange = rangeActive && !_this.hasOnlyOneValueToPaste(parsedData); | ||
@@ -122,3 +123,3 @@ if (pasteIntoRange) { | ||
var updatedRowNodes = []; | ||
var focusedCell = this.focusController.getFocusedCell(); | ||
var focusedCell = this.focusService.getFocusedCell(); | ||
pasteOperationFunc(cellsToFlash, updatedRowNodes, focusedCell, changedPath); | ||
@@ -135,3 +136,3 @@ if (changedPath) { | ||
if (focusedCell) { | ||
this.focusController.setFocusedCell(focusedCell.rowIndex, focusedCell.column, focusedCell.rowPinned, true); | ||
this.focusService.setFocusedCell(focusedCell.rowIndex, focusedCell.column, focusedCell.rowPinned, true); | ||
} | ||
@@ -190,3 +191,3 @@ this.eventService.dispatchEvent({ | ||
var currentRow = { rowIndex: focusedCell.rowIndex, rowPinned: focusedCell.rowPinned }; | ||
var columnsToPasteInto = this.columnController.getDisplayedColumnsStartingAt(focusedCell.column); | ||
var columnsToPasteInto = this.columnModel.getDisplayedColumnsStartingAt(focusedCell.column); | ||
if (this.isPasteSingleValueIntoRange(parsedData)) { | ||
@@ -202,4 +203,4 @@ this.pasteSingleValueIntoRange(parsedData, updatedRowNodes, cellsToFlash, changedPath); | ||
return this.hasOnlyOneValueToPaste(parsedData) | ||
&& this.rangeController != null | ||
&& !this.rangeController.isEmpty(); | ||
&& this.rangeService != null | ||
&& !this.rangeService.isEmpty(); | ||
}; | ||
@@ -222,3 +223,3 @@ ClipboardService.prototype.pasteSingleValueIntoRange = function (parsedData, updatedRowNodes, cellsToFlash, changedPath) { | ||
var _this = this; | ||
if (!this.rangeController || this.rangeController.isEmpty()) { | ||
if (!this.rangeService || this.rangeService.isEmpty()) { | ||
return; | ||
@@ -347,6 +348,6 @@ } | ||
} | ||
var selectedRowsToCopy = !this.selectionController.isEmpty() | ||
var selectedRowsToCopy = !this.selectionService.isEmpty() | ||
&& !this.gridOptionsWrapper.isSuppressCopyRowsToClipboard(); | ||
// default is copy range if exists, otherwise rows | ||
if (this.rangeController && this.rangeController.isMoreThanOneCell()) { | ||
if (this.rangeService && this.rangeService.isMoreThanOneCell()) { | ||
this.copySelectedRangeToClipboard(includeHeaders); | ||
@@ -358,3 +359,3 @@ } | ||
} | ||
else if (this.focusController.isAnyCellFocused()) { | ||
else if (this.focusService.isAnyCellFocused()) { | ||
// if there is a focused cell, copy this | ||
@@ -374,6 +375,6 @@ this.copyFocusedCellToClipboard(includeHeaders); | ||
var _this = this; | ||
if (!this.rangeController || this.rangeController.isEmpty()) { | ||
if (!this.rangeService || this.rangeService.isEmpty()) { | ||
return; | ||
} | ||
var cellRanges = this.rangeController.getCellRanges(); | ||
var cellRanges = this.rangeService.getCellRanges(); | ||
if (onlyFirst) { | ||
@@ -387,7 +388,7 @@ this.iterateActiveRange(cellRanges[0], rowCallback, columnCallback, true); | ||
ClipboardService.prototype.iterateActiveRange = function (range, rowCallback, columnCallback, isLastRange) { | ||
if (!this.rangeController) { | ||
if (!this.rangeService) { | ||
return; | ||
} | ||
var currentRow = this.rangeController.getRangeStartRow(range); | ||
var lastRow = this.rangeController.getRangeEndRow(range); | ||
var currentRow = this.rangeService.getRangeStartRow(range); | ||
var lastRow = this.rangeService.getRangeEndRow(range); | ||
if (columnCallback && range.columns) { | ||
@@ -410,3 +411,3 @@ columnCallback(range.columns); | ||
if (includeHeaders === void 0) { includeHeaders = false; } | ||
if (!this.rangeController || this.rangeController.isEmpty()) { | ||
if (!this.rangeService || this.rangeService.isEmpty()) { | ||
return; | ||
@@ -424,3 +425,3 @@ } | ||
var columnNames = columns.map(function (column) { | ||
var name = _this.columnController.getDisplayNameForColumn(column, 'clipboard', true); | ||
var name = _this.columnModel.getDisplayNameForColumn(column, 'clipboard', true); | ||
return _this.processHeader(column, name, processHeaderForClipboardFunc) || ''; | ||
@@ -456,3 +457,3 @@ }); | ||
if (includeHeaders === void 0) { includeHeaders = false; } | ||
var focusedCell = this.focusController.getFocusedCell(); | ||
var focusedCell = this.focusService.getFocusedCell(); | ||
if (focusedCell == null) { | ||
@@ -470,3 +471,3 @@ return; | ||
if (includeHeaders) { | ||
var headerValue = this.columnController.getDisplayNameForColumn(column, 'clipboard', true); | ||
var headerValue = this.columnModel.getDisplayNameForColumn(column, 'clipboard', true); | ||
data = this.processHeader(column, headerValue, this.gridOptionsWrapper.getProcessHeaderForClipboardFunc()) + '\r\n' + processedValue; | ||
@@ -590,3 +591,3 @@ } | ||
eTempInput.style.opacity = '0'; | ||
var guiRoot = this.gridCompController.getGui(); | ||
var guiRoot = this.gridCtrl.getGui(); | ||
guiRoot.appendChild(eTempInput); | ||
@@ -611,8 +612,8 @@ try { | ||
ClipboardService.prototype.getRangeSize = function () { | ||
var ranges = this.rangeController.getCellRanges(); | ||
var ranges = this.rangeService.getCellRanges(); | ||
var startRangeIndex = 0; | ||
var endRangeIndex = 0; | ||
if (ranges.length > 0) { | ||
startRangeIndex = this.rangeController.getRangeStartRow(ranges[0]).rowIndex; | ||
endRangeIndex = this.rangeController.getRangeEndRow(ranges[0]).rowIndex; | ||
startRangeIndex = this.rangeService.getRangeStartRow(ranges[0]).rowIndex; | ||
endRangeIndex = this.rangeService.getRangeEndRow(ranges[0]).rowIndex; | ||
} | ||
@@ -628,7 +629,7 @@ return startRangeIndex - endRangeIndex + 1; | ||
__decorate([ | ||
Autowired('selectionController') | ||
], ClipboardService.prototype, "selectionController", void 0); | ||
Autowired('selectionService') | ||
], ClipboardService.prototype, "selectionService", void 0); | ||
__decorate([ | ||
Optional('rangeController') | ||
], ClipboardService.prototype, "rangeController", void 0); | ||
Optional('rangeService') | ||
], ClipboardService.prototype, "rangeService", void 0); | ||
__decorate([ | ||
@@ -638,7 +639,10 @@ Autowired('rowModel') | ||
__decorate([ | ||
Autowired('ctrlsService') | ||
], ClipboardService.prototype, "ctrlsService", void 0); | ||
__decorate([ | ||
Autowired('valueService') | ||
], ClipboardService.prototype, "valueService", void 0); | ||
__decorate([ | ||
Autowired('focusController') | ||
], ClipboardService.prototype, "focusController", void 0); | ||
Autowired('focusService') | ||
], ClipboardService.prototype, "focusService", void 0); | ||
__decorate([ | ||
@@ -648,4 +652,4 @@ Autowired('rowRenderer') | ||
__decorate([ | ||
Autowired('columnController') | ||
], ClipboardService.prototype, "columnController", void 0); | ||
Autowired('columnModel') | ||
], ClipboardService.prototype, "columnModel", void 0); | ||
__decorate([ | ||
@@ -652,0 +656,0 @@ Autowired('cellNavigationService') |
{ | ||
"name": "@ag-grid-enterprise/clipboard", | ||
"version": "25.3.0", | ||
"version": "26.0.0", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components", | ||
@@ -9,8 +9,8 @@ "main": "./dist/cjs/main.js", | ||
"scripts": { | ||
"build-cjs": "tsc -p tsconfig.json", | ||
"build-es6": "tsc -p tsconfig.es6.json", | ||
"build-cjs": "npx tsc -p tsconfig.json", | ||
"build-es6": "npx tsc -p tsconfig.es6.json", | ||
"package": "node ../../module-build/rollup/build.js", | ||
"build": "npm run build-cjs && npm run build-es6 && npm run hash", | ||
"hash": "sh ../../scripts/hashDirectory.sh > .hash", | ||
"test": "jest --passWithNoTests" | ||
"test": "npx jest --passWithNoTests" | ||
}, | ||
@@ -47,5 +47,5 @@ "repository": { | ||
"dependencies": { | ||
"@ag-grid-community/core": "~25.3.0", | ||
"@ag-grid-community/csv-export": "~25.3.0", | ||
"@ag-grid-enterprise/core": "~25.3.0" | ||
"@ag-grid-community/core": "~26.0.0", | ||
"@ag-grid-community/csv-export": "~26.0.0", | ||
"@ag-grid-enterprise/core": "~26.0.0" | ||
}, | ||
@@ -52,0 +52,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license
Found 1 instance in 1 package
SPDX disjunction
LicenseSPDX disjunction for an artifact's license information
Found 1 instance in 1 package
304970
3
80
2852
1
1
+ Added@ag-grid-community/core@26.0.0(transitive)
+ Added@ag-grid-community/csv-export@26.0.0(transitive)
+ Added@ag-grid-enterprise/core@26.0.0(transitive)
- Removed@ag-grid-community/core@25.3.0(transitive)
- Removed@ag-grid-community/csv-export@25.3.0(transitive)
- Removed@ag-grid-enterprise/core@25.3.0(transitive)