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/dist/types.d.ts CHANGED
@@ -1306,9 +1306,12 @@ declare namespace canvasDatagrid {
1306
1306
  * @property [gridBorderWidth = 1] - Style of gridBorderWidth.
1307
1307
  * @property [groupIndicatorColor = rgba(155, 155, 155, 1)'] - Foreground color of the group indicator(icon).
1308
1308
  * @property [groupIndicatorBackgroundColor = rgba(255, 255, 255, 1)'] - Background color of the group indicator(icon).
1309
- * @property [columnHeaderCellCapBackgroundColor = rgba(240, 240, 240, 1)] - Style of columnHeaderCellBackgroundColor.
1310
- * @property [columnHeaderCellCapBorderColor = rgba(172, 172, 172, 1)] - Style of columnHeaderCellBackgroundColor.
1311
- * @property [columnHeaderCellCapBorderWidth = 1] - Style of columnHeaderCellBackgroundColor.
1309
+ * @property [columnHeaderCellBackgroundColor = rgba(240, 240, 240, 1)] - Style of columnHeaderCellBackgroundColor.
1310
+ * @property [columnHeaderCellBorderColor = rgba(172, 172, 172, 1)] - Style of columnHeaderCellBackgroundColor.
1311
+ * @property [columnHeaderCellBorderWidth = 1] - Style of columnHeaderCellBackgroundColor.
1312
+ * @property [columnHeaderCellCapBackgroundColor = rgba(240, 240, 240, 1)] - Style of columnHeaderCellCapBackgroundColor.
1313
+ * @property [columnHeaderCellCapBorderColor = rgba(172, 172, 172, 1)] - Style of columnHeaderCellCapBackgroundColor.
1314
+ * @property [columnHeaderCellCapBorderWidth = 1] - Style of columnHeaderCellCapBackgroundColor.
1312
1315
  * @property [columnHeaderCellBorderColor = rgba(152, 152, 152, 1)] - Style of columnHeaderCellBorderColor.
1313
1316
  * @property [columnHeaderCellBorderWidth = 0.25] - Style of columnHeaderCellBorderWidth.
1314
1317
  * @property [columnHeaderCellColor = rgba(50, 50, 50, 1)] - Style of columnHeaderCellColor.
@@ -1332,6 +1335,7 @@ declare namespace canvasDatagrid {
1332
1335
  * @property [columnHeaderOrderByArrowWidth = 13] - Style of columnHeaderOrderByArrowWidth.
1333
1336
  * @property [rowHeaderCellWidth = 57] - Style of rowHeaderCellWidth.
1334
1337
  * @property [minColumnWidth = 45] - Style of minColumnWidth.
1338
+ * @property [height = auto] - Style of height.
1335
1339
  * @property [minHeight = 24] - Style of minHeight.
1336
1340
  * @property [minRowHeight = 24] - Style of minRowHeight.
1337
1341
  * @property [name = default] - Style of name.
@@ -1401,6 +1405,7 @@ declare namespace canvasDatagrid {
1401
1405
  * @property [frozenMarkerWidth = 1] - Style of frozenMarkerWidth.
1402
1406
  * @property [overflowY = auto] - When set to hidden, vertical scroll bar will be hidden. When set to auto vertical scroll bar will appear when data overflows the height. When set to scroll the vertical scrollbar will always be visible.
1403
1407
  * @property [overflowX = auto] - When set to hidden, horizontal scroll bar will be hidden. When set to auto horizontal scroll bar will appear when data overflows the width. When set to scroll the horizontal scrollbar will always be visible.
1408
+ * @property [width = auto] - Style of width.
1404
1409
  *
1405
1410
  * ['', 'normal'],
1406
1411
  */
@@ -1852,13 +1857,25 @@ declare namespace canvasDatagrid {
1852
1857
  /**
1853
1858
  * Style of columnHeaderCellBackgroundColor.
1854
1859
  */
1860
+ columnHeaderCellBackgroundColor?: string;
1861
+ /**
1862
+ * Style of columnHeaderCellBorderColor.
1863
+ */
1864
+ columnHeaderCellBorderColor?: string;
1865
+ /**
1866
+ * Style of columnHeaderCellBorderWidth.
1867
+ */
1868
+ columnHeaderCellBorderWidth?: number;
1869
+ /**
1870
+ * Style of columnHeaderCellCapBackgroundColor.
1871
+ */
1855
1872
  columnHeaderCellCapBackgroundColor?: string;
1856
1873
  /**
1857
- * Style of columnHeaderCellBackgroundColor.
1874
+ * Style of columnHeaderCellCapBackgroundColor.
1858
1875
  */
1859
1876
  columnHeaderCellCapBorderColor?: string;
1860
1877
  /**
1861
- * Style of columnHeaderCellBackgroundColor.
1878
+ * Style of columnHeaderCellCapBackgroundColor.
1862
1879
  */
1863
1880
  columnHeaderCellCapBorderWidth?: number;
1864
1881
  /**
@@ -1953,6 +1970,10 @@ declare namespace canvasDatagrid {
1953
1970
  * Style of minColumnWidth.
1954
1971
  */
1955
1972
  minColumnWidth?: number;
1973
+ /**
1974
+ * Style of height.
1975
+ */
1976
+ height?: number | string;
1956
1977
  /**
1957
1978
  * Style of minHeight.
1958
1979
  */
@@ -2227,10 +2248,14 @@ declare namespace canvasDatagrid {
2227
2248
  overflowY?: string;
2228
2249
  /**
2229
2250
  * When set to hidden, horizontal scroll bar will be hidden. When set to auto horizontal scroll bar will appear when data overflows the width. When set to scroll the horizontal scrollbar will always be visible.
2251
+ */
2252
+ overflowX?: string;
2253
+ /**
2254
+ * Style of width.
2230
2255
 
2231
2256
  ['', 'normal'],
2232
2257
  */
2233
- overflowX?: string;
2258
+ width?: number | string;
2234
2259
  }
2235
2260
  /**
2236
2261
  * An item in the context menu.
package/lib/docs.js CHANGED
@@ -401,9 +401,12 @@
401
401
  * @property {number} [gridBorderWidth=1] - Style of gridBorderWidth.
402
402
  * @property {string} [groupIndicatorColor=rgba(155, 155, 155, 1)'] - Foreground color of the group indicator(icon).
403
403
  * @property {string} [groupIndicatorBackgroundColor=rgba(255, 255, 255, 1)'] - Background color of the group indicator(icon).
404
- * @property {string} [columnHeaderCellCapBackgroundColor=rgba(240, 240, 240, 1)] - Style of columnHeaderCellBackgroundColor.
405
- * @property {string} [columnHeaderCellCapBorderColor=rgba(172, 172, 172, 1)] - Style of columnHeaderCellBackgroundColor.
406
- * @property {number} [columnHeaderCellCapBorderWidth=1] - Style of columnHeaderCellBackgroundColor.
404
+ * @property {string} [columnHeaderCellBackgroundColor=rgba(240, 240, 240, 1)] - Style of columnHeaderCellBackgroundColor.
405
+ * @property {string} [columnHeaderCellBorderColor=rgba(172, 172, 172, 1)] - Style of columnHeaderCellBackgroundColor.
406
+ * @property {number} [columnHeaderCellBorderWidth=1] - Style of columnHeaderCellBackgroundColor.
407
+ * @property {string} [columnHeaderCellCapBackgroundColor=rgba(240, 240, 240, 1)] - Style of columnHeaderCellCapBackgroundColor.
408
+ * @property {string} [columnHeaderCellCapBorderColor=rgba(172, 172, 172, 1)] - Style of columnHeaderCellCapBackgroundColor.
409
+ * @property {number} [columnHeaderCellCapBorderWidth=1] - Style of columnHeaderCellCapBackgroundColor.
407
410
  * @property {string} [columnHeaderCellBorderColor=rgba(152, 152, 152, 1)] - Style of columnHeaderCellBorderColor.
408
411
  * @property {number} [columnHeaderCellBorderWidth=0.25] - Style of columnHeaderCellBorderWidth.
409
412
  * @property {string} [columnHeaderCellColor=rgba(50, 50, 50, 1)] - Style of columnHeaderCellColor.
@@ -427,6 +430,7 @@
427
430
  * @property {number} [columnHeaderOrderByArrowWidth=13] - Style of columnHeaderOrderByArrowWidth.
428
431
  * @property {number} [rowHeaderCellWidth=57] - Style of rowHeaderCellWidth.
429
432
  * @property {number} [minColumnWidth=45] - Style of minColumnWidth.
433
+ * @property {(number|string)} [height=auto] - Style of height.
430
434
  * @property {number} [minHeight=24] - Style of minHeight.
431
435
  * @property {number} [minRowHeight=24] - Style of minRowHeight.
432
436
  * @property {string} [name=default] - Style of name.
@@ -496,6 +500,7 @@
496
500
  * @property {number} [frozenMarkerWidth=1] - Style of frozenMarkerWidth.
497
501
  * @property {string} [overflowY=auto] - When set to hidden, vertical scroll bar will be hidden. When set to auto vertical scroll bar will appear when data overflows the height. When set to scroll the vertical scrollbar will always be visible.
498
502
  * @property {string} [overflowX=auto] - When set to hidden, horizontal scroll bar will be hidden. When set to auto horizontal scroll bar will appear when data overflows the width. When set to scroll the horizontal scrollbar will always be visible.
503
+ * @property {(number|string)} [width=auto] - Style of width.
499
504
 
500
505
  ['', 'normal'],
501
506
  */
@@ -2073,7 +2073,7 @@ export default function (self) {
2073
2073
  ? cellsLength - colPosReal - 1
2074
2074
  : colPosReal;
2075
2075
  const columnIndex = startColumnIndex + colPosition;
2076
- var column = schema[columnIndex];
2076
+ var column = schema[self.orders.columns[columnIndex]];
2077
2077
 
2078
2078
  if (!column) {
2079
2079
  console.warn('Paste data exceeded grid bounds. Skipping.');
@@ -492,7 +492,7 @@ export default function (self) {
492
492
  iterateSelectedCells(
493
493
  (cell) => {
494
494
  affectedCells.push(cell);
495
- self.viewData[cell.boundRowIndex][cell.columnName] = '';
495
+ self.viewData[cell.viewRowIndex][cell.columnName] = '';
496
496
  },
497
497
  bounds,
498
498
  false,
@@ -546,9 +546,10 @@ export default function (self) {
546
546
  */
547
547
  self.copySelectedCellsToClipboard = (clipboardData) => {
548
548
  const isNeat = areSelectionsNeat(self.selections);
549
- const data = self.getSelectedData();
549
+ const selectedData = self.getSelectedData();
550
+ const data = selectedData.filter((row) => row != null);
551
+
550
552
  if (data.length > 0) {
551
- // TODO: improve these two creating string method
552
553
  const textString = createTextString(data, isNeat);
553
554
  const htmlString = createHTMLString(data, isNeat);
554
555
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "canvas-datagrid",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
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",
@@ -77,7 +77,7 @@
77
77
  "eslint": "^7.14.0",
78
78
  "eslint-config-prettier": "^6.15.0",
79
79
  "eslint-plugin-prettier": "^3.1.4",
80
- "husky": "^4.3.0",
80
+ "husky": "^8.0.3",
81
81
  "istanbul": "^0.4.5",
82
82
  "jsdoc": "^3.6.6",
83
83
  "karma": "^6.3.14",
@@ -86,7 +86,7 @@
86
86
  "karma-coverage": "^2.0.2",
87
87
  "karma-coverage-istanbul-reporter": "^3.0.2",
88
88
  "karma-mocha": "^2.0.1",
89
- "lint-staged": "^10.5.2",
89
+ "lint-staged": "^13.2.1",
90
90
  "marked": "^1.2.5",
91
91
  "mocha": "^8.2.1",
92
92
  "prettier": "^2.2.0",