canvas-datagrid 0.3.23 → 0.3.24
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 +6 -0
- package/dist/canvas-datagrid.debug.js +10 -9
- 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/events/index.js +10 -9
- package/lib/events/util.js +3 -3
- package/package.json +1 -1
package/lib/events/index.js
CHANGED
|
@@ -1870,17 +1870,17 @@ export default function (self) {
|
|
|
1870
1870
|
self.draw();
|
|
1871
1871
|
});
|
|
1872
1872
|
};
|
|
1873
|
-
self.cut = function (
|
|
1874
|
-
if (self.dispatchEvent('cut', { NativeEvent:
|
|
1873
|
+
self.cut = function (event) {
|
|
1874
|
+
if (self.dispatchEvent('cut', { NativeEvent: event })) {
|
|
1875
1875
|
return;
|
|
1876
1876
|
}
|
|
1877
1877
|
|
|
1878
1878
|
// Expecting instance of `ClipboardEvent` with `clipboardData` attribute
|
|
1879
|
-
if (!self.hasFocus || !
|
|
1879
|
+
if (!self.hasFocus || !event.clipboardData) {
|
|
1880
1880
|
return;
|
|
1881
1881
|
}
|
|
1882
1882
|
|
|
1883
|
-
self.copySelectedCellsToClipboard(
|
|
1883
|
+
self.copySelectedCellsToClipboard(event.clipboardData);
|
|
1884
1884
|
|
|
1885
1885
|
const affectedCells = self.clearSelectedCells();
|
|
1886
1886
|
|
|
@@ -1889,20 +1889,21 @@ export default function (self) {
|
|
|
1889
1889
|
});
|
|
1890
1890
|
|
|
1891
1891
|
requestAnimationFrame(() => self.draw());
|
|
1892
|
+
event.preventDefault();
|
|
1892
1893
|
};
|
|
1893
|
-
self.copy = function (
|
|
1894
|
-
if (self.dispatchEvent('copy', { NativeEvent:
|
|
1894
|
+
self.copy = function (event) {
|
|
1895
|
+
if (self.dispatchEvent('copy', { NativeEvent: event })) {
|
|
1895
1896
|
return;
|
|
1896
1897
|
}
|
|
1897
1898
|
|
|
1898
1899
|
// Expecting instance of `ClipboardEvent` with `clipboardData` attribute
|
|
1899
|
-
if (!self.hasFocus || !
|
|
1900
|
+
if (!self.hasFocus || !event.clipboardData) {
|
|
1900
1901
|
return;
|
|
1901
1902
|
}
|
|
1902
1903
|
|
|
1903
|
-
self.copySelectedCellsToClipboard(
|
|
1904
|
+
self.copySelectedCellsToClipboard(event.clipboardData);
|
|
1904
1905
|
|
|
1905
|
-
|
|
1906
|
+
event.preventDefault();
|
|
1906
1907
|
};
|
|
1907
1908
|
return;
|
|
1908
1909
|
}
|
package/lib/events/util.js
CHANGED
|
@@ -86,12 +86,12 @@ const parseData = function (data, mimeType) {
|
|
|
86
86
|
return parseText(data);
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
const htmlSafe = (value)
|
|
89
|
+
const htmlSafe = function (value) {
|
|
90
90
|
if (typeof value === 'number') return value;
|
|
91
91
|
return value.replace(/</g, '<').replace(/>/g, '>');
|
|
92
92
|
};
|
|
93
93
|
|
|
94
|
-
const createTextString = (selectedData, isNeat)
|
|
94
|
+
const createTextString = function (selectedData, isNeat) {
|
|
95
95
|
// Selected like [[0, 1], [0, 1]] of [[0, 3]] is neat; Selected like [[0, 1], [1, 2]] is untidy.
|
|
96
96
|
// If not isNeat we just return a simple string of concatenated values.
|
|
97
97
|
if (!isNeat)
|
|
@@ -101,7 +101,7 @@ const createTextString = (selectedData, isNeat) => {
|
|
|
101
101
|
return selectedData.map((row) => Object.values(row).join('\t')).join('\n');
|
|
102
102
|
};
|
|
103
103
|
|
|
104
|
-
const createHTMLString = (selectedData, isNeat)
|
|
104
|
+
const createHTMLString = function (selectedData, isNeat) {
|
|
105
105
|
if (!isNeat) return createTextString(selectedData, isNeat);
|
|
106
106
|
|
|
107
107
|
// If isNeat, we can create a HTML table with the selected data.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "canvas-datagrid",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.24",
|
|
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",
|