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 +8 -0
- package/dist/canvas-datagrid.debug.js +22 -7
- package/dist/canvas-datagrid.debug.map +1 -1
- package/dist/canvas-datagrid.js +1 -1
- package/dist/canvas-datagrid.module.js +1 -1
- package/dist/canvas-datagrid.module.js.map +1 -1
- package/lib/dom.js +9 -4
- package/lib/events/index.js +1 -0
- package/lib/events/util.js +2 -1
- package/lib/publicMethods.js +19 -12
- package/package.json +1 -1
package/lib/dom.js
CHANGED
|
@@ -143,11 +143,16 @@ export default function (self) {
|
|
|
143
143
|
s = e,
|
|
144
144
|
h,
|
|
145
145
|
w;
|
|
146
|
+
let calculatedTree = false;
|
|
146
147
|
while (e.offsetParent && e.nodeName !== 'CANVAS-DATAGRID') {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
148
|
+
const isTree = e.nodeType === 'canvas-datagrid-tree';
|
|
149
|
+
if (!isTree || !calculatedTree) {
|
|
150
|
+
x += e.offsetLeft;
|
|
151
|
+
y += e.offsetTop;
|
|
152
|
+
h = e.offsetHeight;
|
|
153
|
+
w = e.offsetWidth;
|
|
154
|
+
}
|
|
155
|
+
if (isTree) calculatedTree = true;
|
|
151
156
|
e = e.offsetParent;
|
|
152
157
|
}
|
|
153
158
|
if (ignoreScrollOffset) {
|
package/lib/events/index.js
CHANGED
package/lib/events/util.js
CHANGED
|
@@ -87,7 +87,8 @@ const parseData = function (data, mimeType) {
|
|
|
87
87
|
};
|
|
88
88
|
|
|
89
89
|
const htmlSafe = function (value) {
|
|
90
|
-
if (typeof value
|
|
90
|
+
if (typeof value !== 'string') return value;
|
|
91
|
+
|
|
91
92
|
return value.replace(/</g, '<').replace(/>/g, '>');
|
|
92
93
|
};
|
|
93
94
|
|
package/lib/publicMethods.js
CHANGED
|
@@ -342,18 +342,25 @@ export default function (self) {
|
|
|
342
342
|
* @param {number} [offsetY=0] Percentage offset the cell should be from the top edge (not including headers). The default is 0, meaning the cell will appear at the top edge. Valid values are 0 through 1. 1 = Bottom, 0 = Top, 0.5 = Center.
|
|
343
343
|
*/
|
|
344
344
|
self.scrollIntoView = function (x, y, offsetX, offsetY) {
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
345
|
+
const matched = self.visibleCells.filter(function (cell) {
|
|
346
|
+
return (
|
|
347
|
+
(cell.rowIndex === y || y === undefined) &&
|
|
348
|
+
(cell.columnIndex === x || x === undefined) &&
|
|
349
|
+
cell.x > 0 &&
|
|
350
|
+
cell.y > 0 &&
|
|
351
|
+
cell.x + cell.width < self.width &&
|
|
352
|
+
cell.y + cell.height < self.height
|
|
353
|
+
);
|
|
354
|
+
});
|
|
355
|
+
if (matched.length === 1 && x !== undefined && y !== undefined) {
|
|
356
|
+
// goto specific cell and its part be hidden by header
|
|
357
|
+
if (
|
|
358
|
+
matched[0].x < self.getRowHeaderCellWidth() ||
|
|
359
|
+
matched[0].y < self.getColumnHeaderCellHeight()
|
|
360
|
+
)
|
|
361
|
+
matched.length = 0;
|
|
362
|
+
}
|
|
363
|
+
if (matched.length === 0) {
|
|
357
364
|
self.gotoCell(x, y, offsetX, offsetY);
|
|
358
365
|
}
|
|
359
366
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "canvas-datagrid",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.25",
|
|
4
4
|
"description": "Canvas based data grid web component. Capable of displaying millions of contiguous hierarchical rows and columns without paging or loading, on a single canvas element.",
|
|
5
5
|
"main": "./dist/canvas-datagrid.js",
|
|
6
6
|
"module": "./dist/canvas-datagrid.module.js",
|