canvas-datagrid 0.3.24 → 0.3.25

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,14 @@ 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.3.25 - 2021-12-22
11
+
12
+ ### Fixed
13
+
14
+ - Fix null value bug when copying value (ndrsn)
15
+ - Fix setting property `dragOffset` of undefined (Lie Yue, #457)
16
+ - Fix cell editing in the inner grid (Liu Yue, #456)
17
+
10
18
  ## 0.3.24 - 2021-12-22
11
19
 
12
20
  ### Changed
@@ -1538,12 +1538,19 @@ __webpack_require__.r(__webpack_exports__);
1538
1538
  s = e,
1539
1539
  h,
1540
1540
  w;
1541
+ var calculatedTree = false;
1541
1542
 
1542
1543
  while (e.offsetParent && e.nodeName !== 'CANVAS-DATAGRID') {
1543
- x += e.offsetLeft;
1544
- y += e.offsetTop;
1545
- h = e.offsetHeight;
1546
- w = e.offsetWidth;
1544
+ var isTree = e.nodeType === 'canvas-datagrid-tree';
1545
+
1546
+ if (!isTree || !calculatedTree) {
1547
+ x += e.offsetLeft;
1548
+ y += e.offsetTop;
1549
+ h = e.offsetHeight;
1550
+ w = e.offsetWidth;
1551
+ }
1552
+
1553
+ if (isTree) calculatedTree = true;
1547
1554
  e = e.offsetParent;
1548
1555
  }
1549
1556
 
@@ -4959,6 +4966,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4959
4966
  if (Math.abs(x) > self.attributes.reorderDeadZone || Math.abs(y) > self.attributes.reorderDeadZone) {
4960
4967
  self.reorderObject = self.draggingItem;
4961
4968
  if (self.isMultiRowsSelected) self.reorderObject = self.getVisibleCellByIndex(-1, self.activeCell.rowIndex);
4969
+ if (!self.reorderObject) return;
4962
4970
  self.reorderTarget = self.currentCell;
4963
4971
  self.reorderObject.dragOffset = {
4964
4972
  x: x,
@@ -6006,7 +6014,7 @@ var parseData = function parseData(data, mimeType) {
6006
6014
  };
6007
6015
 
6008
6016
  var htmlSafe = function htmlSafe(value) {
6009
- if (typeof value === 'number') return value;
6017
+ if (typeof value !== 'string') return value;
6010
6018
  return value.replace(/</g, '&lt;').replace(/>/g, '&gt;');
6011
6019
  };
6012
6020
 
@@ -8471,9 +8479,16 @@ __webpack_require__.r(__webpack_exports__);
8471
8479
 
8472
8480
 
8473
8481
  self.scrollIntoView = function (x, y, offsetX, offsetY) {
8474
- if (self.visibleCells.filter(function (cell) {
8482
+ var matched = self.visibleCells.filter(function (cell) {
8475
8483
  return (cell.rowIndex === y || y === undefined) && (cell.columnIndex === x || x === undefined) && cell.x > 0 && cell.y > 0 && cell.x + cell.width < self.width && cell.y + cell.height < self.height;
8476
- }).length === 0) {
8484
+ });
8485
+
8486
+ if (matched.length === 1 && x !== undefined && y !== undefined) {
8487
+ // goto specific cell and its part be hidden by header
8488
+ if (matched[0].x < self.getRowHeaderCellWidth() || matched[0].y < self.getColumnHeaderCellHeight()) matched.length = 0;
8489
+ }
8490
+
8491
+ if (matched.length === 0) {
8477
8492
  self.gotoCell(x, y, offsetX, offsetY);
8478
8493
  }
8479
8494
  };