canvas-datagrid 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ All notable changes to this project will be documented in this file.
7
7
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8
8
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
9
9
 
10
+ ## 0.4.7 - 2023-05-22
11
+
12
+ - Ensure only cells from selection get copied onto clipboard (mdebrauw, #556)
13
+ - Fix clearing of data when filter applied (mdebrauw, #560)
14
+ - Fixes 'paste into wrong cell when columns are reordered' (romanstetsyk, #518)
15
+
10
16
  ## 0.4.6 - 2023-04-03
11
17
 
12
18
  ## Added
@@ -7304,7 +7304,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
7304
7304
  var fillingColumn = colPosReal >= cells.length;
7305
7305
  var colPosition = reverseColumns ? cellsLength - colPosReal - 1 : colPosReal;
7306
7306
  var columnIndex = startColumnIndex + colPosition;
7307
- var column = schema[columnIndex];
7307
+ var column = schema[self.orders.columns[columnIndex]];
7308
7308
 
7309
7309
  if (!column) {
7310
7310
  console.warn('Paste data exceeded grid bounds. Skipping.');
@@ -12526,7 +12526,7 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12526
12526
  var bounds = self.getSelectionBounds(true);
12527
12527
  iterateSelectedCells(function (cell) {
12528
12528
  affectedCells.push(cell);
12529
- self.viewData[cell.boundRowIndex][cell.columnName] = '';
12529
+ self.viewData[cell.viewRowIndex][cell.columnName] = '';
12530
12530
  }, bounds, false);
12531
12531
  return affectedCells;
12532
12532
  };
@@ -12575,10 +12575,12 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12575
12575
 
12576
12576
  self.copySelectedCellsToClipboard = function (clipboardData) {
12577
12577
  var isNeat = (0,_util__WEBPACK_IMPORTED_MODULE_1__.areSelectionsNeat)(self.selections);
12578
- var data = self.getSelectedData();
12578
+ var selectedData = self.getSelectedData();
12579
+ var data = selectedData.filter(function (row) {
12580
+ return row != null;
12581
+ });
12579
12582
 
12580
12583
  if (data.length > 0) {
12581
- // TODO: improve these two creating string method
12582
12584
  var textString = (0,_events_util__WEBPACK_IMPORTED_MODULE_0__.createTextString)(data, isNeat);
12583
12585
  var htmlString = (0,_events_util__WEBPACK_IMPORTED_MODULE_0__.createHTMLString)(data, isNeat);
12584
12586
  var copiedData = {