canvas-datagrid 0.4.1 → 0.4.4

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.
@@ -1153,8 +1153,131 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1153
1153
  });
1154
1154
  }
1155
1155
  }
1156
+ /**
1157
+ * Return a tuple if the user selected contiguous columns, otherwise `null`.
1158
+ * Info: Because the user may reorder the columns,
1159
+ * the schemaIndex of the first item may be greater than the schemaIndex of the second item,
1160
+ * but the columnIndex of the firs item must less than the columnIndex of the second item.
1161
+ * @param {any[]} schema from `self.getSchema()`
1162
+ * @returns {any[]} column schemas tuple (each schema has an additional field `schemaIndex`)
1163
+ */
1164
+
1165
+
1166
+ function getSelectedContiguousColumns(ev, schema) {
1167
+ var memoKey = '__contiguousColumns';
1168
+ if (Array.isArray(ev[memoKey]) || ev[memoKey] === null) return ev[memoKey];
1169
+ ev[memoKey] = null;
1170
+ if (!Array.isArray(self.selections) || self.selections.length === 0) return;
1171
+ var selection = self.selections[0];
1172
+ if (!selection || selection.length === 0) return;
1173
+
1174
+ for (var rowIndex = 0; rowIndex < self.viewData.length; rowIndex++) {
1175
+ var row = self.viewData[rowIndex];
1176
+ if (!row) continue;
1177
+ var compare = self.selections[rowIndex];
1178
+ if (!compare) return;
1179
+ if (compare.length !== selection.length) return;
1180
+
1181
+ for (var i = 0; i < selection.length; i++) {
1182
+ if (selection[i] !== compare[i]) return;
1183
+ }
1184
+ }
1185
+
1186
+ selection.sort(function (a, b) {
1187
+ return a - b;
1188
+ });
1189
+ /** @type {number[][]} */
1190
+
1191
+ var ranges = [];
1192
+ var begin = selection[0];
1193
+ var end = selection[0];
1194
+
1195
+ for (var _i = 1; _i < selection.length; _i++) {
1196
+ var orderIndex = selection[_i];
1197
+
1198
+ if (orderIndex === end + 1) {
1199
+ end = orderIndex;
1200
+ continue;
1201
+ }
1202
+
1203
+ ranges.push([begin, end]);
1204
+ begin = orderIndex;
1205
+ end = orderIndex;
1206
+ }
1207
+
1208
+ ranges.push([begin, end]);
1209
+ var currentOrderIndex = ev.cell.columnIndex;
1210
+ var matchedRange = ranges.find(function (range) {
1211
+ return currentOrderIndex >= range[0] && currentOrderIndex <= range[1] && range[0] !== range[1];
1212
+ });
1213
+ if (!matchedRange) return;
1214
+ /** @type {number[]} orders[index] => columnIndex */
1215
+
1216
+ var orders = self.orders.columns;
1217
+ if (!Array.isArray(orders)) return;
1218
+ var matchedSchema = matchedRange.map(function (orderIndex) {
1219
+ var schemaIndex = orders[orderIndex];
1220
+ var thisSchema = schema[schemaIndex];
1221
+ return Object.assign({}, thisSchema, {
1222
+ orderIndex: orderIndex
1223
+ });
1224
+ });
1225
+ if (matchedSchema.findIndex(function (it) {
1226
+ return !it;
1227
+ }) >= 0) return;
1228
+ return ev[memoKey] = matchedSchema;
1229
+ }
1230
+ /**
1231
+ * @param {boolean} [allowOnlyOneRow]
1232
+ * @returns {number[]} a rowIndex tuple. It can contains one row index or two row indexes.
1233
+ */
1234
+
1235
+
1236
+ function getSelectedContiguousRows(allowOnlyOneRow) {
1237
+ var range = [];
1238
+ var prev = -2;
1239
+ var ok = true;
1240
+ self.selections.forEach(function (row, index) {
1241
+ if (!ok) return;
1242
+
1243
+ if (prev < -1) {
1244
+ prev = index;
1245
+ range[0] = index;
1246
+ return;
1247
+ }
1248
+
1249
+ if (index !== prev + 1 || !row || row.length === 0) {
1250
+ ok = false;
1251
+ return;
1252
+ }
1253
+
1254
+ prev = index;
1255
+ range[1] = index;
1256
+ });
1257
+
1258
+ if (ok) {
1259
+ if (range.length === 1) return allowOnlyOneRow ? range : null;
1260
+ return range;
1261
+ }
1262
+ }
1156
1263
 
1157
1264
  function addDefaultContextMenuItem(e) {
1265
+ var schema = self.getSchema();
1266
+ /**
1267
+ * A map between columnIndex and column data
1268
+ * @type {Map<string,any>}
1269
+ */
1270
+
1271
+ var columns;
1272
+
1273
+ var getColumnsMap = function getColumnsMap() {
1274
+ if (!columns) columns = new Map(schema.map(function (_col) {
1275
+ return [_col.columnIndex, _col];
1276
+ }));
1277
+ return columns;
1278
+ };
1279
+
1280
+ var isSorting = self.orderings.columns && self.orderings.columns.length > 0;
1158
1281
  var isNormalCell = !(e.cell.isBackground || e.cell.isColumnHeaderCellCap || e.cell.isScrollBar || e.cell.isCorner || e.cell.isRowHeader) && e.cell.header;
1159
1282
 
1160
1283
  if (self.attributes.showFilter && isNormalCell) {
@@ -1221,17 +1344,30 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1221
1344
  // columnIndex: columnOrderIndex,
1222
1345
  var columnOrderIndex = e.cell.columnIndex;
1223
1346
  var columnIndex = self.orders.columns[columnOrderIndex];
1347
+ var contiguousColumns = getSelectedContiguousColumns(e, schema);
1348
+ var title = '';
1349
+
1350
+ if (contiguousColumns) {
1351
+ title = contiguousColumns.map(function (col) {
1352
+ return col.title || col.name;
1353
+ }).join('-');
1354
+ } else {
1355
+ var column = schema[columnIndex];
1356
+ if (column) title = column.title || column.name;
1357
+ }
1358
+
1224
1359
  e.items.push({
1225
- title: self.attributes.hideColumnText.replace(/%s/gi, e.cell.header.title || e.cell.header.name),
1360
+ title: self.attributes.hideColumnText.replace(/%s/gi, title),
1226
1361
  click: function click(ev) {
1227
- self.getSchema()[columnIndex].hidden = true;
1228
1362
  ev.preventDefault();
1229
1363
  self.stopPropagation(ev);
1230
1364
  self.disposeContextMenu();
1231
- self.setStorageData();
1232
- setTimeout(function () {
1233
- self.resize(true);
1234
- }, 10);
1365
+
1366
+ if (contiguousColumns) {
1367
+ self.hideColumns(contiguousColumns[0].orderIndex, contiguousColumns[1].orderIndex);
1368
+ } else {
1369
+ self.hideColumns(columnOrderIndex);
1370
+ }
1235
1371
  }
1236
1372
  });
1237
1373
  }
@@ -1279,7 +1415,50 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1279
1415
  self.controlInput.focus();
1280
1416
  }
1281
1417
  });
1282
- } //#region group/ungroup columns
1418
+ } //#region hide rows
1419
+
1420
+
1421
+ var canHideRows = !isSorting && e.cell.isRowHeader && e.cell.header;
1422
+
1423
+ if (canHideRows) {
1424
+ var range = getSelectedContiguousRows(true);
1425
+
1426
+ if (range) {
1427
+ var boundRowIndexes = range.map(function (viewRowIndex) {
1428
+ return self.getBoundRowIndexFromViewRowIndex(viewRowIndex);
1429
+ });
1430
+
1431
+ var _title;
1432
+
1433
+ if (boundRowIndexes.length === 1) {
1434
+ if (typeof boundRowIndexes[0] === 'number') _title = boundRowIndexes[0] + 1;else _title = range[0] + 1;
1435
+ _title = self.attributes.showHideRow.replace('%s', _title); // hide one row
1436
+
1437
+ e.items.push({
1438
+ title: _title,
1439
+ click: function click(ev) {
1440
+ ev.preventDefault();
1441
+ self.hideRows(boundRowIndexes[0], boundRowIndexes[0]);
1442
+ }
1443
+ });
1444
+ } else if (boundRowIndexes[0] <= boundRowIndexes[1]) {
1445
+ _title = boundRowIndexes.map(function (it, index) {
1446
+ if (typeof it === 'number') return it + 1;
1447
+ return range[index] + 1;
1448
+ }).join('-');
1449
+ _title = self.attributes.showHideRows.replace('%s', _title); // hide rows
1450
+
1451
+ e.items.push({
1452
+ title: _title,
1453
+ click: function click(ev) {
1454
+ ev.preventDefault();
1455
+ self.hideRows(boundRowIndexes[0], boundRowIndexes[1]);
1456
+ }
1457
+ });
1458
+ }
1459
+ }
1460
+ } //#endregion hide rows
1461
+ //#region group/ungroup columns
1283
1462
 
1284
1463
 
1285
1464
  var groupAreaHeight = self.getColumnGroupAreaHeight();
@@ -1352,31 +1531,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1352
1531
 
1353
1532
  var canGroupByColumns = self.attributes.allowGroupingColumns && e.cell.isColumnHeader && e.cell.header && e.cell.header.index > 0;
1354
1533
  var canUngroupColumns = self.attributes.allowGroupingColumns && e.cell.isColumnHeader;
1355
- var canGroupByRows = self.attributes.allowGroupingRows && e.cell.isRowHeader && e.cell.header;
1534
+ var canGroupByRows = !isSorting && self.attributes.allowGroupingRows && e.cell.isRowHeader && e.cell.header;
1356
1535
  var canUngroupRows = self.attributes.allowGroupingRows && e.cell.isRowHeader;
1357
- /**
1358
- * The value for storing the return value from `self.getSchema()`
1359
- * @type {any[]}
1360
- */
1361
-
1362
- var schema;
1363
- /**
1364
- * A map between columnIndex and column data
1365
- * @type {Map<string,any>}
1366
- */
1367
-
1368
- var columns;
1369
-
1370
- var getColumnsMap = function getColumnsMap() {
1371
- if (!columns) {
1372
- if (!schema) schema = self.getSchema();
1373
- columns = new Map(schema.map(function (_col) {
1374
- return [_col.columnIndex, _col];
1375
- }));
1376
- }
1377
-
1378
- return columns;
1379
- };
1380
1536
 
1381
1537
  if (canGroupByColumns) {
1382
1538
  /** @type {number[]} */
@@ -1405,11 +1561,11 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1405
1561
  for (var i = 0; i < groupIndexes.length; i++) {
1406
1562
  var _columnIndex = groupIndexes[i];
1407
1563
 
1408
- var column = _columns.get(_columnIndex);
1564
+ var _column = _columns.get(_columnIndex);
1409
1565
 
1410
- if (column) {
1411
- groupNames.push(column.name);
1412
- groupTitles.push(column.title || column.name || column.index);
1566
+ if (_column) {
1567
+ groupNames.push(_column.name);
1568
+ groupTitles.push(_column.title || _column.name || _column.index);
1413
1569
  }
1414
1570
  }
1415
1571
 
@@ -1433,8 +1589,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1433
1589
 
1434
1590
  var _columns2 = getColumnsMap();
1435
1591
 
1436
- var _loop = function _loop(_i) {
1437
- var _groups$_i = groups[_i],
1592
+ var _loop = function _loop(_i2) {
1593
+ var _groups$_i = groups[_i2],
1438
1594
  from = _groups$_i.from,
1439
1595
  to = _groups$_i.to;
1440
1596
 
@@ -1457,44 +1613,26 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1457
1613
  }
1458
1614
  };
1459
1615
 
1460
- for (var _i = 0; _i < groups.length; _i++) {
1461
- _loop(_i);
1616
+ for (var _i2 = 0; _i2 < groups.length; _i2++) {
1617
+ _loop(_i2);
1462
1618
  }
1463
1619
  }
1464
1620
 
1465
1621
  if (canGroupByRows) {
1466
- var range = [];
1467
- var prev = -2;
1468
- var ok = true;
1469
- self.selections.forEach(function (row, index) {
1470
- if (!ok) return;
1471
-
1472
- if (prev < -1) {
1473
- prev = index;
1474
- range[0] = index;
1475
- return;
1476
- }
1477
-
1478
- if (index !== prev + 1 || !row || row.length === 0) {
1479
- ok = false;
1480
- return;
1481
- }
1622
+ var _range = getSelectedContiguousRows(false) || [];
1482
1623
 
1483
- prev = index;
1484
- range[1] = index;
1485
- });
1486
- var rangeTitle = range.map(function (rowIndex) {
1624
+ var rangeTitle = _range.map(function (rowIndex) {
1487
1625
  var index = self.getBoundRowIndexFromViewRowIndex(rowIndex);
1488
1626
  if (typeof index === 'number') return index + 1;
1489
1627
  return rowIndex + 1;
1490
1628
  }).join('-');
1491
1629
 
1492
- if (ok && range.length === 2 && self.isNewGroupRangeValid(self.groupedRows, range[0], range[1])) {
1630
+ if (_range.length === 2 && self.isNewGroupRangeValid(self.groupedRows, _range[0], _range[1])) {
1493
1631
  e.items.push({
1494
1632
  title: self.attributes.showGroupRows.replace('%s', rangeTitle),
1495
1633
  click: function click(ev) {
1496
1634
  ev.preventDefault();
1497
- self.groupRows(range[0], range[1]);
1635
+ self.groupRows(_range[0], _range[1]);
1498
1636
  }
1499
1637
  });
1500
1638
  }
@@ -1505,8 +1643,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1505
1643
 
1506
1644
  var _groups = self.getGroupsRowBelongsTo(rowIndex);
1507
1645
 
1508
- var _loop2 = function _loop2(_i2) {
1509
- var _groups$_i2 = _groups[_i2],
1646
+ var _loop2 = function _loop2(_i3) {
1647
+ var _groups$_i2 = _groups[_i3],
1510
1648
  from = _groups$_i2.from,
1511
1649
  to = _groups$_i2.to;
1512
1650
  var rangeTitle = [from, to].map(function (rowIndex) {
@@ -1524,8 +1662,8 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1524
1662
  });
1525
1663
  };
1526
1664
 
1527
- for (var _i2 = 0; _i2 < _groups.length; _i2++) {
1528
- _loop2(_i2);
1665
+ for (var _i3 = 0; _i3 < _groups.length; _i3++) {
1666
+ _loop2(_i3);
1529
1667
  }
1530
1668
  } //#endregion group/ungroup columns
1531
1669
 
@@ -1617,7 +1755,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1617
1755
  function createDisposeEvent() {
1618
1756
  requestAnimationFrame(function () {
1619
1757
  document.addEventListener('click', self.disposeContextMenu);
1620
- document.removeEventListener('mouseup', createDisposeEvent);
1758
+ window.removeEventListener('mouseup', createDisposeEvent);
1621
1759
  });
1622
1760
  }
1623
1761
 
@@ -1665,7 +1803,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "functi
1665
1803
  self.contextMenu = createContextMenu(ev, contextPosition, items);
1666
1804
 
1667
1805
  if (e.type == 'mousedown') {
1668
- document.addEventListener('mouseup', createDisposeEvent);
1806
+ window.addEventListener('mouseup', createDisposeEvent);
1669
1807
  } else {
1670
1808
  createDisposeEvent();
1671
1809
  }
@@ -1701,10 +1839,10 @@ __webpack_require__.r(__webpack_exports__);
1701
1839
 
1702
1840
  /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(self) {
1703
1841
  self.defaults = {
1704
- attributes: [['allowColumnReordering', true], ['allowColumnResize', true], ['allowColumnResizeFromCell', false], ['allowFreezingRows', false], ['allowFreezingColumns', false], ['allowMovingSelection', true], ['allowRowHeaderResize', true], ['allowRowReordering', false], ['allowRowResize', true], ['allowRowResizeFromCell', false], ['allowSorting', true], ['allowGroupingRows', true], ['allowGroupingColumns', true], ['animationDurationShowContextMenu', 50], ['animationDurationHideContextMenu', 50], ['autoGenerateSchema', false], ['autoResizeColumns', false], ['autoResizeRows', false], ['autoScrollOnMousemove', false], ['autoScrollMargin', 5], ['blanksText', '(Blanks)'], ['borderDragBehavior', 'none'], ['borderResizeZone', 10], ['clearSettingsOptionText', 'Clear saved settings'], ['columnHeaderClickBehavior', 'sort'], ['columnSelectorHiddenText', '&nbsp;&nbsp;&nbsp;'], ['columnSelectorText', 'Add/Remove columns'], ['columnSelectorVisibleText', "\u2713"], ['contextHoverScrollAmount', 2], ['contextHoverScrollRateMs', 5], ['copyHeadersOnSelectAll', true], ['copyText', 'Copy'], ['debug', false], ['editable', true], ['ellipsisText', '...'], ['filterOptionText', 'Filter %s'], ['filterTextPrefix', '(filtered) '], ['filterFrozenRows', true], ['globalRowResize', false], ['hideColumnText', 'Hide %s'], ['hoverMode', 'cell'], ['keepFocusOnMouseOut', false], ['maxAutoCompleteItems', 200], ['multiLine', false], ['name', ''], ['pageUpDownOverlap', 1], ['pasteText', 'Paste'], ['persistantSelectionMode', false], ['removeFilterOptionText', 'Remove filter on %s'], ['reorderDeadZone', 3], ['resizeScrollZone', 20], ['rowGrabZoneSize', 5], ['columnGrabZoneSize', 30], ['saveAppearance', true], ['scrollAnimationPPSThreshold', 0.75], ['scrollPointerLock', false], ['scrollRepeatRate', 75], ['selectionFollowsActiveCell', false], ['selectionHandleBehavior', 'none'], ['selectionMode', 'cell'], ['selectionScrollIncrement', 20], ['selectionScrollZone', 20], ['showClearSettingsOption', true], ['showColumnHeaders', true], ['showColumnSelector', true], ['showCopy', false], ['showFilter', true], ['showFilterInCell', false], ['showNewRow', false], ['showOrderByOption', true], ['showOrderByOptionTextAsc', 'Order by %s ascending'], ['showOrderByOptionTextDesc', 'Order by %s descending'], //#region grouping
1842
+ attributes: [['allowColumnReordering', true], ['allowColumnResize', true], ['allowColumnResizeFromCell', false], ['allowFreezingRows', false], ['allowFreezingColumns', false], ['allowMovingSelection', true], ['allowRowHeaderResize', true], ['allowRowReordering', false], ['allowRowResize', true], ['allowRowResizeFromCell', false], ['allowSorting', true], ['allowGroupingRows', true], ['allowGroupingColumns', true], ['animationDurationShowContextMenu', 50], ['animationDurationHideContextMenu', 50], ['autoGenerateSchema', false], ['autoResizeColumns', false], ['autoResizeRows', false], ['autoScrollOnMousemove', false], ['autoScrollMargin', 5], ['blanksText', '(Blanks)'], ['borderDragBehavior', 'none'], ['borderResizeZone', 10], ['clearSettingsOptionText', 'Clear saved settings'], ['columnHeaderClickBehavior', 'sort'], ['columnSelectorHiddenText', '&nbsp;&nbsp;&nbsp;'], ['columnSelectorText', 'Add/Remove columns'], ['columnSelectorVisibleText', "\u2713"], ['contextHoverScrollAmount', 2], ['contextHoverScrollRateMs', 5], ['copyHeadersOnSelectAll', true], ['copyText', 'Copy'], ['debug', false], ['editable', true], ['ellipsisText', '...'], ['filterOptionText', 'Filter %s'], ['filterTextPrefix', '(filtered) '], ['filterFrozenRows', true], ['globalRowResize', false], ['hideColumnText', 'Hide %s'], ['showUnhideColumnsIndicator', false], ['showUnhideRowsIndicator', false], ['showHideRow', 'Hide row %s'], ['showHideRows', 'Hide rows %s'], ['hoverMode', 'cell'], ['keepFocusOnMouseOut', false], ['maxAutoCompleteItems', 200], ['multiLine', false], ['name', ''], ['pageUpDownOverlap', 1], ['pasteText', 'Paste'], ['persistantSelectionMode', false], ['removeFilterOptionText', 'Remove filter on %s'], ['reorderDeadZone', 3], ['resizeScrollZone', 20], ['rowGrabZoneSize', 5], ['columnGrabZoneSize', 30], ['saveAppearance', true], ['scrollAnimationPPSThreshold', 0.75], ['scrollPointerLock', false], ['scrollRepeatRate', 75], ['selectionFollowsActiveCell', false], ['selectionHandleBehavior', 'none'], ['selectionMode', 'cell'], ['selectionScrollIncrement', 20], ['selectionScrollZone', 20], ['showClearSettingsOption', true], ['showColumnHeaders', true], ['showColumnSelector', true], ['showCopy', false], ['showFilter', true], ['showFilterInCell', false], ['showNewRow', false], ['showOrderByOption', true], ['showOrderByOptionTextAsc', 'Order by %s ascending'], ['showOrderByOptionTextDesc', 'Order by %s descending'], //#region grouping
1705
1843
  ['showGroupColumns', 'Group columns %s'], ['showGroupRows', 'Group rows %s'], ['showRemoveGroupColumns', 'Remove group %s'], ['showRemoveGroupRows', 'Remove group %s'], ['showRemoveAllGroupColumns', 'Remove all column groups'], ['showRemoveAllGroupRows', 'Remove all row groups'], ['showExpandAllGroupColumns', 'Expand all column groups'], ['showExpandAllGroupRows', 'Expand all row groups'], ['showCollapseAllGroupColumns', 'Collapse all column groups'], ['showCollapseAllGroupRows', 'Collapse all row groups'], ['columnGroupIndicatorPosition', 'right'], ['rowGroupIndicatorPosition', 'bottom'], //#endregion grouping
1706
1844
  ['showPaste', false], ['showPerformance', false], ['showRowHeaders', true], ['showRowNumbers', true], ['showRowNumberGaps', true], ['singleSelectionMode', false], ['snapToRow', false], ['sortFrozenRows', true], ['touchContextMenuTimeMs', 800], ['touchDeadZone', 3], ['touchEasingMethod', 'easeOutQuad'], ['touchReleaseAcceleration', 1000], ['touchReleaseAnimationDurationMs', 2000], ['touchScrollZone', 20], ['touchSelectHandleZone', 20], ['touchZoomSensitivity', 0.005], ['touchZoomMin', 0.5], ['touchZoomMax', 1.75], ['maxPixelRatio', 2], ['tree', false], ['treeHorizontalScroll', false], ['rowTree', []], ['rowTreeColIndex', 0], ['columnTree', []], ['columnTreeRowStartIndex', 0], ['columnTreeRowEndIndex', 0]],
1707
- styles: [['activeCellBackgroundColor', 'rgba(255, 255, 255, 1)'], ['activeCellBorderColor', 'rgba(110, 168, 255, 1)'], ['activeCellBorderWidth', 1], ['activeCellColor', 'rgba(0, 0, 0, 1)'], ['activeCellFont', '16px sans-serif'], ['activeCellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'], ['activeCellHorizontalAlignment', 'left'], ['activeCellHoverColor', 'rgba(0, 0, 0, 1)'], ['activeCellOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['activeCellOverlayBorderWidth', 1], ['activeCellPaddingBottom', 5], ['activeCellPaddingLeft', 5], ['activeCellPaddingRight', 5], ['activeCellPaddingTop', 5], ['activeCellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'], ['activeCellSelectedColor', 'rgba(0, 0, 0, 1)'], ['activeCellVerticalAlignment', 'center'], ['activeColumnHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'], ['activeColumnHeaderCellColor', 'rgba(0, 0, 0, 1)'], ['activeRowHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'], ['activeRowHeaderCellColor', 'rgba(0, 0, 0, 1)'], ['autocompleteBottomMargin', 60], ['autosizeHeaderCellPadding', 8], ['autosizePadding', 5], ['buttonActiveBackgroundColor', 'rgba(255, 255, 255, 1)'], ['buttonActiveBorderColor', 'rgba(110, 168, 255, 1)'], ['buttonArrowColor', 'rgba(50, 50, 50, 1)'], ['buttonArrowDownHTML', '&#x25BC;'], ['buttonZIndex', 10000], ['buttonBackgroundColor', 'rgba(255, 255, 255, 1)'], ['buttonBorderColor', 'rgba(172, 172, 172, 1)'], ['buttonHoverBackgroundColor', 'rgba(240, 240, 240, 1)'], ['buttonMenuWindowMargin', 30], ['buttonPadding', '3px'], ['cellAutoResizePadding', 13], ['cellBackgroundColor', 'rgba(255, 255, 255, 1)'], ['cellBorderColor', 'rgba(195, 199, 202, 1)'], ['cellBorderWidth', 1], ['cellColor', 'rgba(0, 0, 0, 1)'], ['cellFont', '16px sans-serif'], ['cellGridHeight', 250], ['cellHeight', 24], ['cellHeightWithChildGrid', 150], ['cellHorizontalAlignment', 'left'], ['cellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'], ['cellHoverColor', 'rgba(0, 0, 0, 1)'], ['cellPaddingBottom', 5], ['cellPaddingLeft', 5], ['cellPaddingRight', 5], ['cellPaddingTop', 5], ['cellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'], ['cellSelectedColor', 'rgba(0, 0, 0, 1)'], ['cellTreeIconBorderColor', 'rgba(162, 174, 207, 1)'], ['cellTreeIconFillColor', 'rgba(240, 240, 240, 1)'], ['cellTreeIconHoverFillColor', 'rgba(198, 217, 233, 1)'], ['cellTreeIconLineColor', 'rgba(43, 53, 81, 1)'], ['cellTreeIconLineWidth', 1.5], ['cellTreeIconMarginLeft', 0], ['cellTreeIconMarginRight', 5], ['cellTreeIconMarginTop', 6], ['cellTreeIconWidth', 13], ['cellVerticalAlignment', 'center'], ['cellWidth', 250], ['cellWidthWithChildGrid', 250], ['cellWhiteSpace', 'nowrap'], ['cellLineHeight', 1], ['cellLineSpacing', 3], ['childContextMenuArrowColor', 'rgba(43, 48, 43, 1)'], ['childContextMenuArrowHTML', '&#x25BA;'], ['childContextMenuMarginLeft', -11], ['childContextMenuMarginTop', -6], ['columnGroupRowHeight', 25], ['columnHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['columnHeaderCellBorderColor', 'rgba(172, 172, 172, 1)'], ['columnHeaderCellBorderWidth', 1], ['columnHeaderCellCapBackgroundColor', 'rgba(240, 240, 240, 1)'], ['columnHeaderCellCapBorderColor', 'rgba(172, 172, 172, 1)'], ['columnHeaderCellCapBorderWidth', 1], ['columnHeaderCellColor', 'rgba(50, 50, 50, 1)'], ['columnHeaderCellFont', '16px sans-serif'], ['columnHeaderCellHeight', 25], ['columnHeaderCellHorizontalAlignment', 'left'], ['columnHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['columnHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'], ['columnHeaderCellPaddingBottom', 5], ['columnHeaderCellPaddingLeft', 5], ['columnHeaderCellPaddingRight', 5], ['columnHeaderCellPaddingTop', 5], ['columnHeaderCellVerticalAlignment', 'center'], ['columnHeaderOrderByArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['columnHeaderOrderByArrowBorderWidth', 1], ['columnHeaderOrderByArrowColor', 'rgba(155, 155, 155, 1)'], ['columnHeaderOrderByArrowHeight', 8], ['columnHeaderOrderByArrowMarginLeft', 0], ['columnHeaderOrderByArrowMarginRight', 5], ['columnHeaderOrderByArrowMarginTop', 6], ['columnHeaderOrderByArrowWidth', 13], ['contextFilterButtonBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextFilterButtonBorderRadius', '3px'], ['contextFilterButtonHTML', '&#x25BC;'], ['contextFilterInputBackground', 'rgba(255,255,255,1)'], ['contextFilterInputBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextFilterInputBorderRadius', '0'], ['contextFilterInputColor', 'rgba(0,0,0,1)'], ['contextFilterInputFontFamily', 'sans-serif'], ['contextFilterInputFontSize', '14px'], ['contextFilterInvalidRegExpBackground', 'rgba(180, 6, 1, 1)'], ['contextFilterInvalidRegExpColor', 'rgba(255, 255, 255, 1)'], ['contextMenuArrowColor', 'rgba(43, 48, 43, 1)'], ['contextMenuArrowDownHTML', '&#x25BC;'], ['contextMenuArrowUpHTML', '&#x25B2;'], ['contextMenuBackground', 'rgba(240, 240, 240, 1)'], ['contextMenuBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextMenuBorderRadius', '3px'], ['contextMenuChildArrowFontSize', '12px'], ['contextMenuColor', 'rgba(43, 48, 43, 1)'], ['contextMenuCursor', 'default'], ['contextMenuFilterButtonFontFamily', 'sans-serif'], ['contextMenuFilterButtonFontSize', '10px'], ['contextMenuFilterInvalidExpresion', 'rgba(237, 155, 156, 1)'], ['contextMenuFontFamily', 'sans-serif'], ['contextMenuFontSize', '16px'], ['contextMenuHoverBackground', 'rgba(182, 205, 250, 1)'], ['contextMenuHoverColor', 'rgba(43, 48, 153, 1)'], ['contextMenuItemBorderRadius', '3px'], ['contextMenuItemMargin', '2px'], ['contextMenuLabelDisplay', 'inline-block'], ['contextMenuLabelMargin', '0 3px 0 0'], ['contextMenuLabelMaxWidth', '700px'], ['contextMenuLabelMinWidth', '75px'], ['contextMenuMarginLeft', 3], ['contextMenuMarginTop', -3], ['contextMenuOpacity', '0.98'], ['contextMenuPadding', '2px'], ['contextMenuWindowMargin', 30], ['contextMenuZIndex', 10000], ['cornerCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['cornerCellBorderColor', 'rgba(202, 202, 202, 1)'], ['debugBackgroundColor', 'rgba(0, 0, 0, .0)'], ['debugColor', 'rgba(255, 15, 24, 1)'], ['debugEntitiesColor', 'rgba(76, 231, 239, 1.00)'], ['debugFont', '11px sans-serif'], ['debugPerfChartBackground', 'rgba(29, 25, 26, 1.00)'], ['debugPerfChartTextColor', 'rgba(255, 255, 255, 0.8)'], ['debugPerformanceColor', 'rgba(252, 255, 37, 1.00)'], ['debugScrollHeightColor', 'rgba(248, 33, 103, 1.00)'], ['debugScrollWidthColor', 'rgba(66, 255, 27, 1.00)'], ['debugTouchPPSXColor', 'rgba(246, 102, 24, 1.00)'], ['debugTouchPPSYColor', 'rgba(186, 0, 255, 1.00)'], ['display', 'inline-block'], ['editCellBackgroundColor', 'white'], ['editCellBorder', 'solid 1px rgba(110, 168, 255, 1)'], ['editCellBoxShadow', '0 2px 5px rgba(0,0,0,0.4)'], ['editCellColor', 'black'], ['editCellFontFamily', 'sans-serif'], ['editCellFontSize', '16px'], ['editCellPaddingLeft', 4], ['editCellZIndex', 10000], ['filterButtonActiveBackgroundColor', 'rgba(225, 225, 225, 1)'], ['filterButtonArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['filterButtonArrowBorderWidth', 1], ['filterButtonArrowClickRadius', 5], ['filterButtonArrowColor', 'rgba(50, 50, 50, 1)'], ['filterButtonArrowHeight', 5], ['filterButtonArrowWidth', 8], ['filterButtonBackgroundColor', 'rgba(240, 240, 240, 1)'], ['filterButtonBorderColor', 'rgba(172, 172, 172, 1)'], ['filterButtonBorderRadius', 3], ['filterButtonHeight', 20], ['filterButtonHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['filterButtonMenuOffsetTop', 10], ['filterButtonWidth', 20], ['frozenMarkerHoverColor', 'rgba(236, 243, 255, 1)'], ['frozenMarkerHoverBorderColor', 'rgba(110, 168, 255, 1)'], ['frozenMarkerActiveColor', 'rgba(236, 243, 255, 1)'], ['frozenMarkerActiveBorderColor', 'rgba(110, 168, 255, 1)'], ['frozenMarkerColor', 'rgba(222, 222, 222, 1)'], ['frozenMarkerBorderColor', 'rgba(168, 168, 168, 1)'], ['frozenMarkerBorderWidth', 1], ['frozenMarkerWidth', 2], ['groupingAreaBackgroundColor', 'rgba(240, 240, 240, 1)'], ['gridBackgroundColor', 'rgba(240, 240, 240, 1)'], ['gridBorderCollapse', 'collapse'], ['gridBorderColor', 'rgba(202, 202, 202, 1)'], ['gridBorderWidth', 1], ['groupIndicatorColor', 'rgba(155, 155, 155, 1)'], ['groupIndicatorBackgroundColor', 'rgba(255, 255, 255, 1)'], ['height', 'auto'], ['maxHeight', 'inherit'], ['maxWidth', 'inherit'], ['minColumnWidth', 45], ['minHeight', 'inherit'], ['minRowHeight', 24], ['minWidth', 'inherit'], ['mobileContextMenuMargin', 10], ['mobileEditInputHeight', 30], ['mobileEditFontFamily', 'sans-serif'], ['mobileEditFontSize', '16px'], ['moveOverlayBorderWidth', 1], ['moveOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['moveOverlayBorderSegments', '12, 7'], ['name', 'default'], ['overflowY', 'auto'], ['overflowX', 'auto'], ['reorderMarkerBackgroundColor', 'rgba(0, 0, 0, 0.1)'], ['reorderMarkerBorderColor', 'rgba(0, 0, 0, 0.2)'], ['reorderMarkerBorderWidth', 1.25], ['reorderMarkerIndexBorderColor', 'rgba(66, 133, 244, 1)'], ['reorderMarkerIndexBorderWidth', 2.75], ['rowGroupColumnWidth', 25], ['rowHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['rowHeaderCellBorderColor', 'rgba(200, 200, 200, 1)'], ['rowHeaderCellBorderWidth', 1], ['rowHeaderCellColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellFont', '16px sans-serif'], ['rowHeaderCellHeight', 25], ['rowHeaderCellHorizontalAlignment', 'left'], ['rowHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['rowHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'], ['rowHeaderCellPaddingBottom', 5], ['rowHeaderCellPaddingLeft', 5], ['rowHeaderCellPaddingRight', 5], ['rowHeaderCellPaddingTop', 5], ['rowHeaderCellRowNumberGapHeight', 5], ['rowHeaderCellRowNumberGapColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellSelectedBackgroundColor', 'rgba(217, 217, 217, 1)'], ['rowHeaderCellSelectedColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellVerticalAlignment', 'center'], ['rowHeaderCellWidth', 57], ['scrollBarActiveColor', 'rgba(125, 125, 125, 1)'], ['scrollBarBackgroundColor', 'rgba(240, 240, 240, 1)'], ['scrollBarBorderColor', 'rgba(202, 202, 202, 1)'], ['scrollBarBorderWidth', 0.5], ['scrollBarBoxBorderRadius', 4.125], ['scrollBarBoxColor', 'rgba(192, 192, 192, 1)'], ['scrollBarBoxMargin', 2], ['scrollBarBoxMinSize', 15], ['scrollBarBoxWidth', 8], ['scrollBarCornerBackgroundColor', 'rgba(240, 240, 240, 1)'], ['scrollBarCornerBorderColor', 'rgba(202, 202, 202, 1)'], ['scrollBarWidth', 11], ['selectionHandleBorderColor', 'rgba(255, 255, 255, 1)'], ['selectionHandleBorderWidth', 1.5], ['selectionHandleColor', 'rgba(66, 133, 244, 1)'], ['selectionHandleSize', 8], ['selectionHandleType', 'square'], ['selectionOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['selectionOverlayBorderWidth', 1], ['treeArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['treeArrowBorderWidth', 1], ['treeArrowClickRadius', 5], ['treeArrowColor', 'rgba(155, 155, 155, 1)'], ['treeArrowHeight', 8], ['treeArrowMarginLeft', 0], ['treeArrowMarginRight', 5], ['treeArrowMarginTop', 6], ['treeArrowWidth', 13], ['treeGridHeight', 250], ['width', 'auto']]
1845
+ styles: [['activeCellBackgroundColor', 'rgba(255, 255, 255, 1)'], ['activeCellBorderColor', 'rgba(110, 168, 255, 1)'], ['activeCellBorderWidth', 1], ['activeCellColor', 'rgba(0, 0, 0, 1)'], ['activeCellFont', '16px sans-serif'], ['activeCellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'], ['activeCellHorizontalAlignment', 'left'], ['activeCellHoverColor', 'rgba(0, 0, 0, 1)'], ['activeCellOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['activeCellOverlayBorderWidth', 1], ['activeCellPaddingBottom', 5], ['activeCellPaddingLeft', 5], ['activeCellPaddingRight', 5], ['activeCellPaddingTop', 5], ['activeCellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'], ['activeCellSelectedColor', 'rgba(0, 0, 0, 1)'], ['activeCellVerticalAlignment', 'center'], ['activeColumnHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'], ['activeColumnHeaderCellColor', 'rgba(0, 0, 0, 1)'], ['activeRowHeaderCellBackgroundColor', 'rgba(225, 225, 225, 1)'], ['activeRowHeaderCellColor', 'rgba(0, 0, 0, 1)'], ['autocompleteBottomMargin', 60], ['autosizeHeaderCellPadding', 8], ['autosizePadding', 5], ['buttonActiveBackgroundColor', 'rgba(255, 255, 255, 1)'], ['buttonActiveBorderColor', 'rgba(110, 168, 255, 1)'], ['buttonArrowColor', 'rgba(50, 50, 50, 1)'], ['buttonArrowDownHTML', '&#x25BC;'], ['buttonZIndex', 10000], ['buttonBackgroundColor', 'rgba(255, 255, 255, 1)'], ['buttonBorderColor', 'rgba(172, 172, 172, 1)'], ['buttonHoverBackgroundColor', 'rgba(240, 240, 240, 1)'], ['buttonMenuWindowMargin', 30], ['buttonPadding', '3px'], ['cellAutoResizePadding', 13], ['cellBackgroundColor', 'rgba(255, 255, 255, 1)'], ['cellBorderColor', 'rgba(195, 199, 202, 1)'], ['cellBorderWidth', 1], ['cellColor', 'rgba(0, 0, 0, 1)'], ['cellFont', '16px sans-serif'], ['cellGridHeight', 250], ['cellHeight', 24], ['cellHeightWithChildGrid', 150], ['cellHorizontalAlignment', 'left'], ['cellHoverBackgroundColor', 'rgba(255, 255, 255, 1)'], ['cellHoverColor', 'rgba(0, 0, 0, 1)'], ['cellPaddingBottom', 5], ['cellPaddingLeft', 5], ['cellPaddingRight', 5], ['cellPaddingTop', 5], ['cellSelectedBackgroundColor', 'rgba(236, 243, 255, 1)'], ['cellSelectedColor', 'rgba(0, 0, 0, 1)'], ['cellTreeIconBorderColor', 'rgba(162, 174, 207, 1)'], ['cellTreeIconFillColor', 'rgba(240, 240, 240, 1)'], ['cellTreeIconHoverFillColor', 'rgba(198, 217, 233, 1)'], ['cellTreeIconLineColor', 'rgba(43, 53, 81, 1)'], ['cellTreeIconLineWidth', 1.5], ['cellTreeIconMarginLeft', 0], ['cellTreeIconMarginRight', 5], ['cellTreeIconMarginTop', 6], ['cellTreeIconWidth', 13], ['cellVerticalAlignment', 'center'], ['cellWidth', 250], ['cellWidthWithChildGrid', 250], ['cellWhiteSpace', 'nowrap'], ['cellLineHeight', 1], ['cellLineSpacing', 3], ['childContextMenuArrowColor', 'rgba(43, 48, 43, 1)'], ['childContextMenuArrowHTML', '&#x25BA;'], ['childContextMenuMarginLeft', -11], ['childContextMenuMarginTop', -6], ['columnGroupRowHeight', 25], ['columnHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['columnHeaderCellBorderColor', 'rgba(172, 172, 172, 1)'], ['columnHeaderCellBorderWidth', 1], ['columnHeaderCellCapBackgroundColor', 'rgba(240, 240, 240, 1)'], ['columnHeaderCellCapBorderColor', 'rgba(172, 172, 172, 1)'], ['columnHeaderCellCapBorderWidth', 1], ['columnHeaderCellColor', 'rgba(50, 50, 50, 1)'], ['columnHeaderCellFont', '16px sans-serif'], ['columnHeaderCellHeight', 25], ['columnHeaderCellHorizontalAlignment', 'left'], ['columnHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['columnHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'], ['columnHeaderCellPaddingBottom', 5], ['columnHeaderCellPaddingLeft', 5], ['columnHeaderCellPaddingRight', 5], ['columnHeaderCellPaddingTop', 5], ['columnHeaderCellVerticalAlignment', 'center'], ['columnHeaderOrderByArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['columnHeaderOrderByArrowBorderWidth', 1], ['columnHeaderOrderByArrowColor', 'rgba(155, 155, 155, 1)'], ['columnHeaderOrderByArrowHeight', 8], ['columnHeaderOrderByArrowMarginLeft', 0], ['columnHeaderOrderByArrowMarginRight', 5], ['columnHeaderOrderByArrowMarginTop', 6], ['columnHeaderOrderByArrowWidth', 13], ['contextFilterButtonBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextFilterButtonBorderRadius', '3px'], ['contextFilterButtonHTML', '&#x25BC;'], ['contextFilterInputBackground', 'rgba(255,255,255,1)'], ['contextFilterInputBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextFilterInputBorderRadius', '0'], ['contextFilterInputColor', 'rgba(0,0,0,1)'], ['contextFilterInputFontFamily', 'sans-serif'], ['contextFilterInputFontSize', '14px'], ['contextFilterInvalidRegExpBackground', 'rgba(180, 6, 1, 1)'], ['contextFilterInvalidRegExpColor', 'rgba(255, 255, 255, 1)'], ['contextMenuArrowColor', 'rgba(43, 48, 43, 1)'], ['contextMenuArrowDownHTML', '&#x25BC;'], ['contextMenuArrowUpHTML', '&#x25B2;'], ['contextMenuBackground', 'rgba(240, 240, 240, 1)'], ['contextMenuBorder', 'solid 1px rgba(158, 163, 169, 1)'], ['contextMenuBorderRadius', '3px'], ['contextMenuChildArrowFontSize', '12px'], ['contextMenuColor', 'rgba(43, 48, 43, 1)'], ['contextMenuCursor', 'default'], ['contextMenuFilterButtonFontFamily', 'sans-serif'], ['contextMenuFilterButtonFontSize', '10px'], ['contextMenuFilterInvalidExpresion', 'rgba(237, 155, 156, 1)'], ['contextMenuFontFamily', 'sans-serif'], ['contextMenuFontSize', '16px'], ['contextMenuHoverBackground', 'rgba(182, 205, 250, 1)'], ['contextMenuHoverColor', 'rgba(43, 48, 153, 1)'], ['contextMenuItemBorderRadius', '3px'], ['contextMenuItemMargin', '2px'], ['contextMenuLabelDisplay', 'inline-block'], ['contextMenuLabelMargin', '0 3px 0 0'], ['contextMenuLabelMaxWidth', '700px'], ['contextMenuLabelMinWidth', '75px'], ['contextMenuMarginLeft', 3], ['contextMenuMarginTop', -3], ['contextMenuOpacity', '0.98'], ['contextMenuPadding', '2px'], ['contextMenuWindowMargin', 30], ['contextMenuZIndex', 10000], ['cornerCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['cornerCellBorderColor', 'rgba(202, 202, 202, 1)'], ['debugBackgroundColor', 'rgba(0, 0, 0, .0)'], ['debugColor', 'rgba(255, 15, 24, 1)'], ['debugEntitiesColor', 'rgba(76, 231, 239, 1.00)'], ['debugFont', '11px sans-serif'], ['debugPerfChartBackground', 'rgba(29, 25, 26, 1.00)'], ['debugPerfChartTextColor', 'rgba(255, 255, 255, 0.8)'], ['debugPerformanceColor', 'rgba(252, 255, 37, 1.00)'], ['debugScrollHeightColor', 'rgba(248, 33, 103, 1.00)'], ['debugScrollWidthColor', 'rgba(66, 255, 27, 1.00)'], ['debugTouchPPSXColor', 'rgba(246, 102, 24, 1.00)'], ['debugTouchPPSYColor', 'rgba(186, 0, 255, 1.00)'], ['display', 'inline-block'], ['editCellBackgroundColor', 'white'], ['editCellBorder', 'solid 1px rgba(110, 168, 255, 1)'], ['editCellBoxShadow', '0 2px 5px rgba(0,0,0,0.4)'], ['editCellColor', 'black'], ['editCellFontFamily', 'sans-serif'], ['editCellFontSize', '16px'], ['editCellPaddingLeft', 4], ['editCellZIndex', 10000], ['filterButtonActiveBackgroundColor', 'rgba(225, 225, 225, 1)'], ['filterButtonArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['filterButtonArrowBorderWidth', 1], ['filterButtonArrowClickRadius', 5], ['filterButtonArrowColor', 'rgba(50, 50, 50, 1)'], ['filterButtonArrowHeight', 5], ['filterButtonArrowWidth', 8], ['filterButtonBackgroundColor', 'rgba(240, 240, 240, 1)'], ['filterButtonBorderColor', 'rgba(172, 172, 172, 1)'], ['filterButtonBorderRadius', 3], ['filterButtonHeight', 20], ['filterButtonHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['filterButtonMenuOffsetTop', 10], ['filterButtonWidth', 20], ['frozenMarkerHoverColor', 'rgba(165, 198, 254, 1)'], ['frozenMarkerHoverBorderColor', 'rgba(165, 198, 254, 1)'], ['frozenMarkerActiveColor', 'rgba(165, 198, 254, 0.2)'], ['frozenMarkerActiveBorderColor', 'rgba(165, 198, 254, 0.5)'], ['frozenMarkerActiveHeaderColor', 'rgba(165, 198, 254, 1)'], ['frozenMarkerColor', 'rgba(221, 221, 221, 1)'], ['frozenMarkerBorderColor', 'rgba(221, 221, 221, 1)'], ['frozenMarkerBorderWidth', 1], ['frozenMarkerHeaderColor', 'rgba(188, 188, 188, 1)'], ['frozenMarkerWidth', 4], ['groupingAreaBackgroundColor', 'rgba(240, 240, 240, 1)'], ['gridBackgroundColor', 'rgba(240, 240, 240, 1)'], ['gridBorderCollapse', 'collapse'], ['gridBorderColor', 'rgba(202, 202, 202, 1)'], ['gridBorderWidth', 1], ['groupIndicatorColor', 'rgba(155, 155, 155, 1)'], ['groupIndicatorBackgroundColor', 'rgba(255, 255, 255, 1)'], ['height', 'auto'], ['maxHeight', 'inherit'], ['maxWidth', 'inherit'], ['minColumnWidth', 45], ['minHeight', 'inherit'], ['minRowHeight', 24], ['minWidth', 'inherit'], ['mobileContextMenuMargin', 10], ['mobileEditInputHeight', 30], ['mobileEditFontFamily', 'sans-serif'], ['mobileEditFontSize', '16px'], ['moveOverlayBorderWidth', 1], ['moveOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['moveOverlayBorderSegments', '12, 7'], ['name', 'default'], ['overflowY', 'auto'], ['overflowX', 'auto'], ['reorderMarkerBackgroundColor', 'rgba(0, 0, 0, 0.1)'], ['reorderMarkerBorderColor', 'rgba(0, 0, 0, 0.2)'], ['reorderMarkerBorderWidth', 1.25], ['reorderMarkerIndexBorderColor', 'rgba(66, 133, 244, 1)'], ['reorderMarkerIndexBorderWidth', 2.75], ['rowGroupColumnWidth', 25], ['rowHeaderCellBackgroundColor', 'rgba(240, 240, 240, 1)'], ['rowHeaderCellBorderColor', 'rgba(200, 200, 200, 1)'], ['rowHeaderCellBorderWidth', 1], ['rowHeaderCellColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellFont', '16px sans-serif'], ['rowHeaderCellHeight', 25], ['rowHeaderCellHorizontalAlignment', 'left'], ['rowHeaderCellHoverBackgroundColor', 'rgba(235, 235, 235, 1)'], ['rowHeaderCellHoverColor', 'rgba(0, 0, 0, 1)'], ['rowHeaderCellPaddingBottom', 5], ['rowHeaderCellPaddingLeft', 5], ['rowHeaderCellPaddingRight', 5], ['rowHeaderCellPaddingTop', 5], ['rowHeaderCellRowNumberGapHeight', 5], ['rowHeaderCellRowNumberGapColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellSelectedBackgroundColor', 'rgba(217, 217, 217, 1)'], ['rowHeaderCellSelectedColor', 'rgba(50, 50, 50, 1)'], ['rowHeaderCellVerticalAlignment', 'center'], ['rowHeaderCellWidth', 57], ['scrollBarActiveColor', 'rgba(125, 125, 125, 1)'], ['scrollBarBackgroundColor', 'rgba(240, 240, 240, 1)'], ['scrollBarBorderColor', 'rgba(202, 202, 202, 1)'], ['scrollBarBorderWidth', 0.5], ['scrollBarBoxBorderRadius', 4.125], ['scrollBarBoxColor', 'rgba(192, 192, 192, 1)'], ['scrollBarBoxMargin', 2], ['scrollBarBoxMinSize', 15], ['scrollBarBoxWidth', 8], ['scrollBarCornerBackgroundColor', 'rgba(240, 240, 240, 1)'], ['scrollBarCornerBorderColor', 'rgba(202, 202, 202, 1)'], ['scrollBarWidth', 11], ['selectionHandleBorderColor', 'rgba(255, 255, 255, 1)'], ['selectionHandleBorderWidth', 1.5], ['selectionHandleColor', 'rgba(66, 133, 244, 1)'], ['selectionHandleSize', 8], ['selectionHandleType', 'square'], ['selectionOverlayBorderColor', 'rgba(66, 133, 244, 1)'], ['selectionOverlayBorderWidth', 1], ['treeArrowBorderColor', 'rgba(195, 199, 202, 1)'], ['treeArrowBorderWidth', 1], ['treeArrowClickRadius', 5], ['treeArrowColor', 'rgba(155, 155, 155, 1)'], ['treeArrowHeight', 8], ['treeArrowMarginLeft', 0], ['treeArrowMarginRight', 5], ['treeArrowMarginTop', 6], ['treeArrowWidth', 13], ['treeGridHeight', 250], ['unhideIndicatorColor', 'rgba(0, 0, 0, 1)'], ['unhideIndicatorBackgroundColor', 'rgba(255, 255, 255, 1)'], ['unhideIndicatorBorderColor', 'rgba(174, 193, 232, 1)'], ['unhideIndicatorSize', 16], ['width', 'auto']]
1708
1846
  };
1709
1847
  }
1710
1848
 
@@ -2108,6 +2246,16 @@ __webpack_require__.r(__webpack_exports__);
2108
2246
  var cellValueIsEmpty = [null, undefined].indexOf(cell.value) !== -1;
2109
2247
  var shouldClearCellValue = cellValueIsEmpty || inEnterMode;
2110
2248
  self.input.value = shouldClearCellValue ? '' : cell.value;
2249
+ var width = Math.round(self.input.value.length * parseInt(self.style.editCellFontSize, 10) * 0.7 * self.scale);
2250
+
2251
+ if (width + self.style.cellPaddingLeft < cell.width) {
2252
+ width = cell.width - self.style.cellPaddingLeft;
2253
+ } else if (width > self.width - cell.x - self.style.scrollBarWidth) {
2254
+ width = self.width - cell.x - self.style.scrollBarWidth;
2255
+ self.input.style.height = 'auto';
2256
+ }
2257
+
2258
+ self.input.style.width = width + 'px';
2111
2259
  self.input.focus();
2112
2260
  self.input.addEventListener('click', self.stopPropagation);
2113
2261
  self.input.addEventListener('dblclick', self.stopPropagation);
@@ -2191,6 +2339,17 @@ __webpack_require__.r(__webpack_exports__);
2191
2339
 
2192
2340
  self.scrollIntoView(nx, ny);
2193
2341
  self.beginEditAt(nx, ny, e);
2342
+ } else {
2343
+ var _width = Math.round(self.input.value.length * parseInt(self.style.editCellFontSize, 10) * 0.7 * self.scale);
2344
+
2345
+ if (_width + self.style.cellPaddingLeft < cell.width) {
2346
+ _width = cell.width - self.style.cellPaddingLeft;
2347
+ } else if (_width > self.width - cell.x - self.style.scrollBarWidth) {
2348
+ _width = self.width - cell.x - self.style.scrollBarWidth;
2349
+ self.input.style.height = 'auto';
2350
+ }
2351
+
2352
+ self.input.style.width = _width + 'px';
2194
2353
  }
2195
2354
  });
2196
2355
  self.dispatchEvent('beginedit', {
@@ -2521,11 +2680,11 @@ __webpack_require__.r(__webpack_exports__);
2521
2680
  });
2522
2681
  self.eventParent.addEventListener('scroll', self.resize, false);
2523
2682
  self.eventParent.addEventListener('touchstart', self.touchstart, false);
2524
- self.eventParent.addEventListener('mouseup', self.mouseup, false);
2525
2683
  self.eventParent.addEventListener('mousedown', self.mousedown, false);
2526
2684
  self.eventParent.addEventListener('dblclick', self.dblclick, false);
2527
2685
  self.eventParent.addEventListener('click', self.click, false);
2528
- document.body.addEventListener('mousemove', self.mousemove);
2686
+ window.addEventListener('mouseup', self.mouseup, false);
2687
+ window.addEventListener('mousemove', self.mousemove);
2529
2688
  self[self.isChildGrid ? 'parentGrid' : 'eventParent'].addEventListener('wheel', self.scrollWheel, false);
2530
2689
  self.canvas.addEventListener('contextmenu', self.contextmenuEvent, false);
2531
2690
  self.controlInput.addEventListener('copy', self.copy);
@@ -2560,6 +2719,14 @@ __webpack_require__.r(__webpack_exports__);
2560
2719
  /*globals XMLSerializer: false, define: true, Blob: false, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/
2561
2720
 
2562
2721
 
2722
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2723
+
2724
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
2725
+
2726
+ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
2727
+
2728
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2729
+
2563
2730
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2564
2731
 
2565
2732
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -2675,10 +2842,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
2675
2842
  }
2676
2843
  /**
2677
2844
  * @param {number[]} coords [x0,y0, x1,y1, x2,y2, ...]
2845
+ * @param {boolean} [fill] fill the area that construct by these lines but not stroke
2678
2846
  */
2679
2847
 
2680
2848
 
2681
- function strokeLines(coords) {
2849
+ function drawLines(coords, fill) {
2682
2850
  if (coords.length < 4) return;
2683
2851
  self.ctx.beginPath();
2684
2852
  self.ctx.moveTo(coords[0] + self.canvasOffsetLeft, coords[1] + self.canvasOffsetTop);
@@ -2689,7 +2857,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
2689
2857
  self.ctx.lineTo(x, y);
2690
2858
  }
2691
2859
 
2692
- self.ctx.stroke();
2860
+ if (fill) self.ctx.fill();else self.ctx.stroke();
2693
2861
  }
2694
2862
  /**
2695
2863
  * @param {number} x based-X (left-top)
@@ -2704,8 +2872,72 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
2704
2872
  strokeRect(x, y, width, width);
2705
2873
  var cx = x + width * 0.5;
2706
2874
  var cy = y + width * 0.5;
2707
- strokeLines([x + width * 0.2, cy, x + width * 0.78, cy]);
2708
- if (collapsed) strokeLines([cx, y + width * 0.22, cx, y + width * 0.8]);
2875
+ drawLines([x + width * 0.2, cy, x + width * 0.78, cy]);
2876
+ if (collapsed) drawLines([cx, y + width * 0.22, cx, y + width * 0.8]);
2877
+ }
2878
+ /**
2879
+ * @param {number} x
2880
+ * @param {number} y
2881
+ * @param {number} size
2882
+ * @param {string} dir Direction of the triangle, one of the 't','b','l' and 'r'
2883
+ * @param {boolean} [active]
2884
+ */
2885
+
2886
+
2887
+ function drawUnhideIndicator(x, y, size, dir, active) {
2888
+ var minPadding = size * 0.2;
2889
+ var maxPadding = size * 0.3;
2890
+ /** The long edge width of the triangle */
2891
+
2892
+ var longEdge = size - 2 * minPadding;
2893
+ /** The median width of the triangle */
2894
+
2895
+ var median = size - 2 * maxPadding;
2896
+ var halfLongEdge = longEdge * 0.5;
2897
+ var x0, y0;
2898
+ var coords, borderCoords;
2899
+
2900
+ switch (dir) {
2901
+ case 'r':
2902
+ x0 = x + maxPadding;
2903
+ y0 = y + minPadding;
2904
+ borderCoords = [x, y, x + size, y, x + size, y + size, x, y + size];
2905
+ coords = [x0, y0, x0, y0 + longEdge, x0 + median, y0 + halfLongEdge];
2906
+ break;
2907
+
2908
+ case 'l':
2909
+ x0 = x + size - maxPadding;
2910
+ y0 = y + minPadding;
2911
+ borderCoords = [x + size, y, x, y, x, y + size, x + size, y + size];
2912
+ coords = [x0, y0, x0, y0 + longEdge, x0 - median, y0 + halfLongEdge];
2913
+ break;
2914
+
2915
+ case 't':
2916
+ x0 = x + minPadding;
2917
+ y0 = y + size - maxPadding;
2918
+ borderCoords = [x, y + size, x, y, x + size, y, x + size, y + size];
2919
+ coords = [x0, y0, x0 + longEdge, y0, x0 + halfLongEdge, y0 - median];
2920
+ break;
2921
+
2922
+ case 'b':
2923
+ x0 = x + minPadding;
2924
+ y0 = y + maxPadding;
2925
+ borderCoords = [x, y, x, y + size, x + size, y + size, x + size, y];
2926
+ coords = [x0, y0, x0 + longEdge, y0, x0 + halfLongEdge, y0 + median];
2927
+ break;
2928
+ }
2929
+
2930
+ if (active) {
2931
+ self.ctx.strokeStyle = self.style.unhideIndicatorBorderColor;
2932
+ self.ctx.lineWidth = 2;
2933
+ drawLines(borderCoords);
2934
+ self.ctx.fillStyle = self.style.unhideIndicatorBackgroundColor;
2935
+ var offset = dir === 'r' || dir === 'b' ? 1 : 0;
2936
+ if (dir === 'l' || dir === 'r') fillRect(x - offset, y, size + offset, size);else fillRect(x, y - offset, size, size + offset);
2937
+ }
2938
+
2939
+ self.ctx.fillStyle = self.style.unhideIndicatorColor;
2940
+ drawLines(coords, true);
2709
2941
  }
2710
2942
 
2711
2943
  function drawOrderByArrow(x, y) {
@@ -3292,7 +3524,18 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
3292
3524
  columnGroupsRectInfo = {},
3293
3525
  collapsedColumnGroups = self.getCollapsedColumnGroups(),
3294
3526
  collapsedRowGroups = self.getCollapsedRowGroups(),
3295
- cellHeight = self.style.cellHeight;
3527
+ cellHeight = self.style.cellHeight,
3528
+ currentRowIndexOffset = 0,
3529
+
3530
+ /** @type {Array<{from:number,plus:number}>} */
3531
+ rowIndexOffsetByHiddenRows = self.hiddenRowRanges.map(function (range) {
3532
+ return {
3533
+ from: range[0],
3534
+ plus: range[1] - range[0] + 1
3535
+ };
3536
+ }).sort(function (a, b) {
3537
+ return a.from - b.from;
3538
+ });
3296
3539
  drawCount += 1;
3297
3540
  p = performance.now();
3298
3541
  self.visibleRowHeights = []; // if data length has changed, there is no way to know
@@ -3480,7 +3723,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
3480
3723
  isColumnHeaderCellCap = cellStyle === 'columnHeaderCellCap',
3481
3724
  rawValue = rowData ? rowData[header.name] : undefined,
3482
3725
  isGrid = header.type === 'canvas-datagrid',
3483
- activeHeader = (self.orders.rows[self.activeCell.rowIndex] === rowOrderIndex || self.orders.columns[self.activeCell.columnIndex] === headerIndex) && (columnOrderIndex === -1 || rowOrderIndex === -1) ? isRowHeader ? 'activeRowHeaderCell' : 'activeColumnHeaderCell' : false,
3726
+ activeHeader = (self.orders.rows[self.activeCell.rowIndex] === rowOrderIndex || self.selectedRows.indexOf(rowOrderIndex) >= 0 || self.orders.columns[self.activeCell.columnIndex] === headerIndex || self.selectedColumns.indexOf(headerIndex) >= 0) && (columnOrderIndex === -1 || rowOrderIndex === -1) ? isRowHeader ? 'activeRowHeaderCell' : 'activeColumnHeaderCell' : false,
3484
3727
  val,
3485
3728
  f = self.formatters[header.type || 'string'],
3486
3729
  orderByArrowSize = 0,
@@ -3800,6 +4043,20 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
3800
4043
  hasRowGap = collapsedRowGroups.find(function (group) {
3801
4044
  return group.from === previousRowNumber && group.to === cell.boundRowIndex;
3802
4045
  }) >= 0;
4046
+ } // We don't treat the row index difference from hidden rows as the row gap.
4047
+
4048
+
4049
+ if (hasRowGap && self.hiddenRowRanges.length > 0) {
4050
+ for (var i = 0; i < self.hiddenRowRanges.length; i++) {
4051
+ var _self$hiddenRowRanges = _slicedToArray(self.hiddenRowRanges[i], 2),
4052
+ beginRowIndex = _self$hiddenRowRanges[0],
4053
+ endRowIndex = _self$hiddenRowRanges[1];
4054
+
4055
+ if (cell.boundRowIndex === endRowIndex + 1 && previousRowNumber === beginRowIndex - 1) {
4056
+ hasRowGap = false;
4057
+ break;
4058
+ }
4059
+ }
3803
4060
  }
3804
4061
 
3805
4062
  if (hasRowGap) {
@@ -3810,11 +4067,162 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
3810
4067
  fillRect(cell.x, cell.y - barHeight / 2, cell.width, barHeight);
3811
4068
  self.ctx.restore();
3812
4069
  }
3813
- }
4070
+ } //#region draw unhide indicator for column headers
4071
+
4072
+
4073
+ if (isColumnHeader && self.attributes.showUnhideColumnsIndicator) {
4074
+ var _hovered = self.hovers.unhideIndicator;
4075
+ var size = self.style.unhideIndicatorSize;
4076
+ var cellX = x;
4077
+ var topY = cell.y + Math.max(0.5 * (cell.height - size), 0);
4078
+
4079
+ var isActive = function isActive(orderIndex) {
4080
+ return _hovered && (_hovered.dir === 'l' || _hovered.dir === 'r') && orderIndex >= _hovered.orderIndex0 && orderIndex <= _hovered.orderIndex1;
4081
+ };
4082
+
4083
+ var isHiddenColumn = function isHiddenColumn(columnIndex) {
4084
+ return columnIndex >= 0 && schema[columnIndex] && schema[columnIndex].hidden;
4085
+ };
4086
+
4087
+ var orderIndex0, orderIndex1;
4088
+
4089
+ var drawIndicator = function drawIndicator(leftX, dir, active) {
4090
+ self.visibleUnhideIndicators.push({
4091
+ x: leftX - 1,
4092
+ y: topY - 1,
4093
+ x2: leftX + size + 2,
4094
+ y2: topY + size + 2,
4095
+ orderIndex0: orderIndex0,
4096
+ orderIndex1: orderIndex1,
4097
+ dir: dir
4098
+ });
4099
+
4100
+ if (!active) {
4101
+ var line = cell.text && cell.text.lines && cell.text.lines[0];
4102
+
4103
+ if (line) {
4104
+ var iconsWidth = orderByArrowSize + treeArrowSize;
4105
+ var lineX0 = iconsWidth > 0 ? iconsWidth : line.x;
4106
+ var lineX1 = line.x + line.width;
4107
+ if (leftX + size >= lineX0 && leftX <= lineX1) return;
4108
+ }
4109
+ }
4110
+
4111
+ drawUnhideIndicator(leftX, topY, size, dir, active);
4112
+ }; // end of drawIndicator
4113
+
4114
+
4115
+ var orderIndexPtr = columnOrderIndex - 1;
4116
+ var prevColumnIndex = self.orders.columns[orderIndexPtr];
4117
+
4118
+ if (isHiddenColumn(prevColumnIndex)) {
4119
+ var _active = isActive(prevColumnIndex);
4120
+
4121
+ orderIndex0 = orderIndexPtr;
4122
+ orderIndex1 = orderIndexPtr;
4123
+
4124
+ while (--orderIndexPtr >= 0) {
4125
+ if (isHiddenColumn(self.orders.columns[orderIndexPtr])) orderIndex0 = orderIndexPtr;else break;
4126
+ }
4127
+
4128
+ drawIndicator(cellX, 'r', _active);
4129
+ }
4130
+
4131
+ orderIndexPtr = columnOrderIndex + 1;
4132
+ var nextColumnIndex = self.orders.columns[orderIndexPtr];
4133
+
4134
+ if (isHiddenColumn(nextColumnIndex)) {
4135
+ var _active2 = isActive(nextColumnIndex);
4136
+
4137
+ orderIndex0 = orderIndexPtr;
4138
+ orderIndex1 = orderIndexPtr;
4139
+
4140
+ while (++orderIndexPtr < self.orders.columns.length) {
4141
+ if (isHiddenColumn(self.orders.columns[orderIndexPtr])) orderIndex1 = orderIndexPtr;else break;
4142
+ }
4143
+
4144
+ var indicatorX = x + cell.width - size;
4145
+ drawIndicator(indicatorX, 'l', _active2);
4146
+ }
4147
+ } //#endregion draw unhide indicator for column headers
4148
+ //#region draw unhide indicator for row headers
4149
+
4150
+
4151
+ if (isRowHeader && self.attributes.showUnhideRowsIndicator && self.hiddenRowRanges.length > 0) {
4152
+ // Leo's comment:
4153
+ // from the first row to the last row, `rowIndex` is from 0 to the count of rows
4154
+ // but `boundRowIndex` can be disordered if there are any ordered columns or filtered columns
4155
+ // Like this statement:
4156
+ // console.log(rowIndex, cell.boundRowIndex, cell.formattedValue);
4157
+ // can output the result like this:
4158
+ // 0 1 '2'
4159
+ // 1 3 '4'
4160
+ var _hovered2 = self.hovers.unhideIndicator;
4161
+ var _size = self.style.unhideIndicatorSize;
4162
+ var leftX = cell.x + cell.width - _size - 2;
4163
+ var cellY = y;
4164
+ var topIndicators = {};
4165
+ var bottomIndicators = {};
4166
+ self.hiddenRowRanges.forEach(function (it) {
4167
+ topIndicators[it[0] - 1] = it;
4168
+ bottomIndicators[it[1] + 1] = it;
4169
+ });
4170
+
4171
+ var _rowIndex = cell.rowIndex + currentRowIndexOffset;
4172
+
4173
+ var _isActive = function _isActive() {
4174
+ return _hovered2 && (_hovered2.dir === 't' || _hovered2.dir === 'b') && _rowIndex >= _hovered2.orderIndex0 - 1 && _rowIndex <= _hovered2.orderIndex1 + 1;
4175
+ };
4176
+
4177
+ var _orderIndex, _orderIndex2;
4178
+
4179
+ var _drawIndicator = function _drawIndicator(topY, dir, active) {
4180
+ self.visibleUnhideIndicators.push({
4181
+ x: leftX - 1,
4182
+ y: topY - 1,
4183
+ x2: leftX + _size + 2,
4184
+ y2: topY + _size + 2,
4185
+ orderIndex0: _orderIndex,
4186
+ orderIndex1: _orderIndex2,
4187
+ dir: dir
4188
+ });
4189
+ drawUnhideIndicator(leftX, topY, _size, dir, active);
4190
+ }; // end of drawIndicator
4191
+
4192
+
4193
+ var matched = topIndicators[_rowIndex];
4194
+
4195
+ if (matched) {
4196
+ var indicatorY = cellY + cell.height - _size;
4197
+ var _matched = matched;
4198
+
4199
+ var _matched2 = _slicedToArray(_matched, 2);
4200
+
4201
+ _orderIndex = _matched2[0];
4202
+ _orderIndex2 = _matched2[1];
4203
+
4204
+ _drawIndicator(indicatorY, 't', _isActive());
4205
+ }
4206
+
4207
+ matched = bottomIndicators[_rowIndex];
4208
+
4209
+ if (matched) {
4210
+ var _indicatorY = cellY;
4211
+ var _matched3 = matched;
4212
+
4213
+ var _matched4 = _slicedToArray(_matched3, 2);
4214
+
4215
+ _orderIndex = _matched4[0];
4216
+ _orderIndex2 = _matched4[1];
4217
+
4218
+ _drawIndicator(_indicatorY, 'b', _isActive());
4219
+ }
4220
+ } //#endregion draw unhide indicator for row headers
4221
+
3814
4222
 
3815
4223
  x += cell.width + (bc ? 0 : self.style.cellBorderWidth);
3816
4224
  return cell.width;
3817
- };
4225
+ }; // end of drawEach
3818
4226
  }
3819
4227
 
3820
4228
  function drawFilterButton(cell, ev) {
@@ -3851,8 +4259,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
3851
4259
  // row index + 1. If rowIndex > viewData.length, it's a new row
3852
4260
  // added to the end, and we want to render that new row's number
3853
4261
 
3854
- var filteredRowNumber = self.viewData && rowIndex < self.viewData.length ? self.getBoundRowIndexFromViewRowIndex(rowIndex) + 1 : self.originalData ? self.originalData.length + 1 : rowOrderIndex + 1;
4262
+ var filteredRowNumber;
4263
+ if (self.viewData && rowIndex < self.viewData.length) filteredRowNumber = self.getBoundRowIndexFromViewRowIndex(rowIndex) + 1;else filteredRowNumber = self.originalData ? self.originalData.length + 1 : rowOrderIndex + 1;
3855
4264
  var rowHeaderValue = self.hasActiveFilters() || self.hasCollapsedRowGroup() ? filteredRowNumber : rowIndex + 1;
4265
+ rowHeaderValue += currentRowIndexOffset;
3856
4266
  var _rowHeaderCell = {
3857
4267
  rowHeaderCell: rowHeaderValue
3858
4268
  };
@@ -3866,6 +4276,13 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
3866
4276
  };
3867
4277
  rowOpen = self.openChildren[rowIndex];
3868
4278
  drawCell(_rowHeaderCell, rowOrderIndex, rowIndex)(headerDescription, -1, -1);
4279
+
4280
+ if (rowIndexOffsetByHiddenRows[0] && rowHeaderValue >= rowIndexOffsetByHiddenRows[0].from) {
4281
+ var _rowIndexOffsetByHidd = rowIndexOffsetByHiddenRows.shift(),
4282
+ plus = _rowIndexOffsetByHidd.plus;
4283
+
4284
+ currentRowIndexOffset += plus;
4285
+ }
3869
4286
  }
3870
4287
  }
3871
4288
 
@@ -4017,7 +4434,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4017
4434
  } //draw frozen columns
4018
4435
 
4019
4436
 
4020
- x = 0;
4437
+ x = 1;
4021
4438
 
4022
4439
  if (self.attributes.showRowHeaders) {
4023
4440
  x += rowHeaderCellWidth;
@@ -4094,10 +4511,18 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4094
4511
  schema = self.getSchema();
4095
4512
  self.visibleCells = [];
4096
4513
  self.visibleGroups = [];
4514
+ self.visibleUnhideIndicators = [];
4097
4515
  self.canvasOffsetTop = self.isChildGrid ? self.parentNode.offsetTop : 0.5;
4098
4516
  self.canvasOffsetLeft = self.isChildGrid ? self.parentNode.offsetLeft : -0.5;
4099
4517
  h = self.height;
4100
- w = self.width;
4518
+ w = self.width; // patch for first row being hidden
4519
+
4520
+ var firstRowIndexOffset = rowIndexOffsetByHiddenRows[0];
4521
+
4522
+ if (firstRowIndexOffset && firstRowIndexOffset.from === 0) {
4523
+ currentRowIndexOffset = firstRowIndexOffset.plus;
4524
+ rowIndexOffsetByHiddenRows.shift();
4525
+ }
4101
4526
  }
4102
4527
 
4103
4528
  function drawBackground() {
@@ -4312,7 +4737,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4312
4737
  if (containsEnd) rightX += toggleHandleSize;
4313
4738
  }
4314
4739
 
4315
- strokeLines(lineCoords);
4740
+ drawLines(lineCoords);
4316
4741
  ctx.restore();
4317
4742
  pushToVisibleGroups(leftX, rightX);
4318
4743
  };
@@ -4383,13 +4808,13 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4383
4808
 
4384
4809
 
4385
4810
  if (group.from > 0) {
4386
- var _rowIndex = group.to + 1;
4811
+ var _rowIndex2 = group.to + 1;
4387
4812
 
4388
- var _row = rowGroupsRectInfo[_rowIndex];
4813
+ var _row = rowGroupsRectInfo[_rowIndex2];
4389
4814
 
4390
4815
  if (!_row) {
4391
- _rowIndex = group.from - 1;
4392
- _row = rowGroupsRectInfo[_rowIndex];
4816
+ _rowIndex2 = group.from - 1;
4817
+ _row = rowGroupsRectInfo[_rowIndex2];
4393
4818
  if (!_row) return "continue"; // don't draw this group indicator because it is invisible
4394
4819
 
4395
4820
  _topY = _row.y + _row.h - toggleHandleSize * 0.5;
@@ -4397,7 +4822,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4397
4822
  _topY = _row.y;
4398
4823
  }
4399
4824
 
4400
- if (_rowIndex >= self.frozenRow) {
4825
+ if (_rowIndex2 >= self.frozenRow) {
4401
4826
  var compare = frozenRowsHeight + columnHeaderCellHeight - toggleHandlePadding; // don't draw this group indicator because it is hidden by frozen columns
4402
4827
 
4403
4828
  if (_topY < compare) return "continue";
@@ -4513,7 +4938,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4513
4938
  if (containsEnd) bottomY += toggleHandleSize;
4514
4939
  }
4515
4940
 
4516
- strokeLines(lineCoords);
4941
+ drawLines(lineCoords);
4517
4942
  ctx.restore();
4518
4943
  pushToVisibleGroups(topY, bottomY);
4519
4944
  };
@@ -4545,7 +4970,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4545
4970
  if (self.attributes.allowFreezingRows) {
4546
4971
  // HACK great, another stupid magic number.
4547
4972
  // Background will appear as a 0.5px artifact behind the row freeze bar without this hack
4548
- y += self.style.frozenMarkerBorderWidth + self.style.frozenMarkerWidth - 0.4999999999;
4973
+ if (y > columnHeaderCellHeight) y += self.style.frozenMarkerWidth;
4974
+ y += self.style.frozenMarkerBorderWidth - 0.4999999999;
4549
4975
  }
4550
4976
 
4551
4977
  self.lastFrozenRowPixel = y;
@@ -4656,14 +5082,16 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4656
5082
  self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;
4657
5083
  self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;
4658
5084
 
4659
- if (self.currentCell.rowIndex !== self.reorderObject.rowIndex && self.currentCell.rowIndex > -1 && self.currentCell.rowIndex < l) {
5085
+ if (self.selectedRows.indexOf(self.reorderTarget.sortRowIndex) === -1 && self.currentCell.rowIndex !== self.reorderObject.rowIndex && self.currentCell.rowIndex > -1 && self.currentCell.rowIndex < l) {
4660
5086
  addBorderLine(m, self.reorderTarget.sortRowIndex > self.reorderObject.sortRowIndex ? 'b' : 't');
4661
5087
  }
4662
5088
  } else if (self.dragMode === 'column-reorder' && self.reorderObject) {
4663
5089
  var selectedColumns = self.selections[0];
4664
5090
 
4665
- for (var k = 1; k < selectedColumns.length; k++) {
4666
- b.width += self.getColumnWidth(self.orders.columns[selectedColumns[k]]);
5091
+ if (selectedColumns) {
5092
+ for (var k = 1; k < selectedColumns.length; k++) {
5093
+ b.width += self.getColumnWidth(self.orders.columns[selectedColumns[k]]);
5094
+ }
4667
5095
  }
4668
5096
 
4669
5097
  b.height = h;
@@ -4677,7 +5105,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4677
5105
  self.ctx.lineWidth = self.style.reorderMarkerIndexBorderWidth;
4678
5106
  self.ctx.strokeStyle = self.style.reorderMarkerIndexBorderColor;
4679
5107
 
4680
- if (self.currentCell.sortColumnIndex !== self.reorderObject.sortColumnIndex && self.currentCell.sortColumnIndex > -1 && self.currentCell.sortColumnIndex < schema.length) {
5108
+ if (self.selectedColumns.indexOf(self.reorderTarget.sortColumnIndex) === -1 && self.currentCell.sortColumnIndex !== self.reorderObject.sortColumnIndex && self.reorderTarget.columnIndex !== self.reorderObject.columnIndex && self.currentCell.sortColumnIndex > -1 && self.currentCell.sortColumnIndex < schema.length) {
4681
5109
  addBorderLine(m, self.reorderTarget.columnIndex > self.reorderObject.columnIndex ? 'r' : 'l');
4682
5110
  }
4683
5111
  }
@@ -4771,40 +5199,67 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4771
5199
  }
4772
5200
 
4773
5201
  function drawFrozenMarkers() {
4774
- if (self.dragStartObject !== undefined) return;
4775
5202
  var my = self.lastFrozenRowPixel - self.style.frozenMarkerWidth,
4776
- mx = self.lastFrozenColumnPixel - self.style.frozenMarkerBorderWidth,
5203
+ mx = self.lastFrozenColumnPixel - self.style.frozenMarkerWidth,
4777
5204
  xHover = self.currentCell && self.currentCell.style === 'frozen-row-marker',
4778
5205
  yHover = self.currentCell && self.currentCell.style === 'frozen-column-marker';
5206
+ var rowHeaderCellWidth = self.getRowHeaderCellWidth();
4779
5207
  self.ctx.lineWidth = self.style.frozenMarkerBorderWidth;
4780
5208
 
4781
5209
  if (self.attributes.allowFreezingColumns) {
4782
- self.ctx.fillStyle = yHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerColor;
4783
- self.ctx.strokeStyle = yHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerBorderColor;
4784
- fillRect(mx, 0, self.style.frozenMarkerWidth, self.height);
4785
- strokeRect(mx, 0, self.style.frozenMarkerWidth, self.height);
4786
- self.visibleCells.unshift({
4787
- x: mx,
4788
- y: 0,
4789
- height: self.height,
4790
- width: self.style.frozenMarkerWidth + self.style.frozenMarkerBorderWidth,
4791
- style: 'frozen-column-marker'
4792
- });
5210
+ if (!self.freezeMarkerPosition || self.freezeMarkerPosition && self.dragMode === 'frozen-row-marker') {
5211
+ if (mx > self.style.rowHeaderCellWidth) {
5212
+ self.ctx.fillStyle = self.style.frozenMarkerColor;
5213
+ self.ctx.strokeStyle = self.style.frozenMarkerBorderColor;
5214
+ fillRect(mx, 0, self.style.frozenMarkerWidth, self.height);
5215
+ strokeRect(mx, 0, self.style.frozenMarkerWidth, self.height);
5216
+ }
5217
+
5218
+ self.ctx.fillStyle = yHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerHeaderColor;
5219
+ self.ctx.strokeStyle = yHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerHeaderColor;
5220
+ fillRect(mx, 0, self.style.frozenMarkerWidth, self.style.columnHeaderCellHeight);
5221
+ strokeRect(mx, 0, self.style.frozenMarkerWidth, self.style.columnHeaderCellHeight);
5222
+ }
5223
+
5224
+ if (!self.dragStartObject || self.dragStartObject && self.dragStartObject.style !== 'rowHeaderCell') {
5225
+ self.visibleCells.unshift({
5226
+ x: mx,
5227
+ y: 0,
5228
+ height: self.height,
5229
+ width: self.style.frozenMarkerWidth,
5230
+ // + self.style.frozenMarkerBorderWidth,
5231
+ style: 'frozen-column-marker'
5232
+ });
5233
+ }
4793
5234
  }
4794
5235
 
4795
5236
  if (self.attributes.allowFreezingRows) {
4796
- self.ctx.fillStyle = xHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerColor;
4797
- self.ctx.strokeStyle = xHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerBorderColor;
4798
- fillRect(0, my, self.width, self.style.frozenMarkerWidth);
4799
- strokeRect(0, my, self.width, self.style.frozenMarkerWidth);
5237
+ if (!self.freezeMarkerPosition || self.freezeMarkerPosition && self.dragMode === 'frozen-column-marker') {
5238
+ if (my > rowHeaderCellWidth) {
5239
+ self.ctx.fillStyle = self.style.frozenMarkerColor;
5240
+ self.ctx.strokeStyle = self.style.frozenMarkerBorderColor;
5241
+ fillRect(0, my, self.width, self.style.frozenMarkerWidth);
5242
+ strokeRect(0, my, self.width, self.style.frozenMarkerWidth);
5243
+ }
5244
+
5245
+ self.ctx.fillStyle = xHover ? self.style.frozenMarkerHoverColor : self.style.frozenMarkerHeaderColor;
5246
+ self.ctx.strokeStyle = xHover ? self.style.frozenMarkerHoverBorderColor : self.style.frozenMarkerHeaderColor;
5247
+ fillRect(0, my, rowHeaderCellWidth, self.style.frozenMarkerWidth);
5248
+ strokeRect(0, my, rowHeaderCellWidth, self.style.frozenMarkerWidth);
5249
+ }
5250
+
4800
5251
  var height = self.style.frozenMarkerWidth + self.style.frozenMarkerBorderWidth;
4801
- self.visibleCells.unshift({
4802
- x: 0,
4803
- y: my,
4804
- height: height,
4805
- width: self.width,
4806
- style: 'frozen-row-marker'
4807
- });
5252
+
5253
+ if (!self.dragStartObject || self.dragStartObject && self.dragStartObject.style !== 'columnHeaderCell') {
5254
+ self.visibleCells.unshift({
5255
+ x: 0,
5256
+ y: my,
5257
+ height: height,
5258
+ width: self.width,
5259
+ style: 'frozen-row-marker'
5260
+ });
5261
+ }
5262
+
4808
5263
  rowGroupsFrozenInfo = {
4809
5264
  y: my,
4810
5265
  h: height
@@ -4816,11 +5271,59 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
4816
5271
  self.ctx.strokeStyle = self.style.frozenMarkerActiveBorderColor;
4817
5272
 
4818
5273
  if (self.dragMode === 'frozen-column-marker') {
4819
- fillRect(self.freezeMarkerPosition.x, 0, self.style.frozenMarkerWidth, self.height);
4820
- strokeRect(self.freezeMarkerPosition.x, 0, self.style.frozenMarkerWidth, self.height);
5274
+ var posX = self.freezeMarkerPosition.x;
5275
+ var nearCell = self.getCellAt(posX, 0);
5276
+ if (self.freezeMarkerPosition.isGrab) posX = mx;
5277
+
5278
+ if (posX > rowHeaderCellWidth) {
5279
+ var _x = nearCell.x - self.style.frozenMarkerWidth - self.style.frozenMarkerBorderWidth;
5280
+
5281
+ if (posX > _x + nearCell.width / 2) _x = _x + nearCell.width;
5282
+ self.ctx.fillStyle = self.style.frozenMarkerColor;
5283
+ self.ctx.strokeStyle = self.style.frozenMarkerBorderColor;
5284
+ fillRect(_x, 0, self.style.frozenMarkerWidth, self.height);
5285
+ strokeRect(_x, 0, self.style.frozenMarkerWidth, self.height);
5286
+ self.ctx.fillStyle = self.style.frozenMarkerHeaderColor;
5287
+ self.ctx.strokeStyle = self.style.frozenMarkerHeaderColor;
5288
+ fillRect(_x, 0, self.style.frozenMarkerWidth, self.style.columnHeaderCellHeight);
5289
+ strokeRect(_x, 0, self.style.frozenMarkerWidth, self.style.columnHeaderCellHeight);
5290
+ }
5291
+
5292
+ self.ctx.fillStyle = self.style.frozenMarkerActiveHeaderColor;
5293
+ self.ctx.strokeStyle = self.style.frozenMarkerActiveBorderColor;
5294
+ fillRect(posX, 0, self.style.frozenMarkerWidth, self.style.columnHeaderCellHeight);
5295
+ strokeRect(posX, 0, self.style.frozenMarkerWidth, self.style.columnHeaderCellHeight);
5296
+ self.ctx.fillStyle = self.style.frozenMarkerActiveColor;
5297
+ fillRect(posX, 0, self.style.frozenMarkerWidth, self.height);
5298
+ strokeRect(posX, 0, self.style.frozenMarkerWidth, self.height);
4821
5299
  } else {
4822
- fillRect(0, self.freezeMarkerPosition.y, self.width, self.style.frozenMarkerWidth);
4823
- strokeRect(0, self.freezeMarkerPosition.y, self.width, self.style.frozenMarkerWidth);
5300
+ var posY = self.freezeMarkerPosition.y;
5301
+
5302
+ var _nearCell = self.getCellAt(0, posY);
5303
+
5304
+ if (self.freezeMarkerPosition.isGrab) posY = my;
5305
+
5306
+ if (posY > self.style.columnHeaderCellHeight) {
5307
+ var _y = _nearCell.y - self.style.frozenMarkerWidth - self.style.frozenMarkerBorderWidth;
5308
+
5309
+ if (posY > _y + _nearCell.height / 2) _y = _y + _nearCell.height;
5310
+ self.ctx.fillStyle = self.style.frozenMarkerColor;
5311
+ self.ctx.strokeStyle = self.style.frozenMarkerBorderColor;
5312
+ fillRect(0, _y, self.width, self.style.frozenMarkerWidth);
5313
+ strokeRect(0, _y, self.width, self.style.frozenMarkerWidth);
5314
+ self.ctx.fillStyle = self.style.frozenMarkerHeaderColor;
5315
+ self.ctx.strokeStyle = self.style.frozenMarkerHeaderColor;
5316
+ fillRect(0, _y, rowHeaderCellWidth, self.style.frozenMarkerWidth);
5317
+ strokeRect(0, _y, rowHeaderCellWidth, self.style.frozenMarkerWidth);
5318
+ }
5319
+
5320
+ self.ctx.fillStyle = self.style.frozenMarkerActiveHeaderColor;
5321
+ self.ctx.strokeStyle = self.style.frozenMarkerActiveBorderColor;
5322
+ fillRect(0, posY, rowHeaderCellWidth, self.style.frozenMarkerWidth);
5323
+ strokeRect(0, posY, rowHeaderCellWidth, self.style.frozenMarkerWidth);
5324
+ self.ctx.fillStyle = self.style.frozenMarkerActiveColor;
5325
+ fillRect(0, posY, self.width, self.style.frozenMarkerWidth);
5326
+ strokeRect(0, posY, self.width, self.style.frozenMarkerWidth);
4824
5327
  }
4825
5328
  }
4826
5329
  }
@@ -5103,6 +5606,43 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5103
5606
  self.getRatio = function () {
5104
5607
  return Math.min(self.attributes.maxPixelRatio, (window.devicePixelRatio || 1) / (self.ctx.webkitBackingStorePixelRatio || self.ctx.mozBackingStorePixelRatio || self.ctx.msBackingStorePixelRatio || self.ctx.oBackingStorePixelRatio || self.ctx.backingStorePixelRatio || 1));
5105
5608
  };
5609
+ /**
5610
+ * @returns {number} dataWidth
5611
+ */
5612
+
5613
+
5614
+ self.refreshScrollCacheX = function () {
5615
+ var s = self.getSchema();
5616
+ self.scrollCache.x = [];
5617
+ /** @type {number} it will be used in `reduceSchema` only */
5618
+
5619
+ var frozenWidth = 0;
5620
+ var collapsedColumnGroups = self.getCollapsedColumnGroups();
5621
+
5622
+ var isColumnCollapsed = function isColumnCollapsed(columnIndex) {
5623
+ return collapsedColumnGroups.findIndex(function (group) {
5624
+ return columnIndex >= group.from && columnIndex <= group.to;
5625
+ }) >= 0;
5626
+ };
5627
+
5628
+ var dataWidth = s.reduce(function reduceSchema(accumulator, column, columnIndex) {
5629
+ // intentional redefintion of column. This causes scrollCache to be in the correct order
5630
+ var schemaIndex = self.orders.columns[columnIndex];
5631
+ var columnWidth = self.getColumnWidth(schemaIndex);
5632
+ column = s[schemaIndex];
5633
+ if (!column.hidden && !isColumnCollapsed(columnIndex)) accumulator += columnWidth;
5634
+
5635
+ if (columnIndex < self.frozenColumn) {
5636
+ self.scrollCache.x[columnIndex] = accumulator;
5637
+ frozenWidth = accumulator;
5638
+ } else {
5639
+ self.scrollCache.x[columnIndex] = Math.max(frozenWidth + columnWidth, accumulator);
5640
+ }
5641
+
5642
+ return accumulator;
5643
+ }, 0) || 0;
5644
+ return dataWidth;
5645
+ };
5106
5646
 
5107
5647
  self.resize = function (drawAfterResize) {
5108
5648
  if (!self.canvas) {
@@ -5163,8 +5703,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5163
5703
  rowHeaderCellWidth = self.getRowHeaderCellWidth(),
5164
5704
  topGroupAreaHeight = self.getColumnGroupAreaHeight(),
5165
5705
  leftGroupAreaWidth = self.getRowGroupAreaWidth(),
5166
- ch = self.style.cellHeight,
5167
- s = self.getSchema(); // sets actual DOM canvas element
5706
+ ch = self.style.cellHeight; // sets actual DOM canvas element
5168
5707
 
5169
5708
  function checkScrollBoxVisibility() {
5170
5709
  self.scrollBox.horizontalBarVisible = self.style.width !== 'auto' && dataWidth > self.scrollBox.width && self.style.overflowX !== 'hidden' || self.style.overflowX === 'scroll';
@@ -5202,7 +5741,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5202
5741
  });
5203
5742
  }
5204
5743
 
5205
- self.scrollCache.x = [];
5744
+ dataWidth = self.refreshScrollCacheX();
5206
5745
  self.scrollCache.y = [];
5207
5746
 
5208
5747
  for (x = 0; x < l; x += 1) {
@@ -5215,34 +5754,6 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5215
5754
  self.scrollCache.y[x] = dataHeight;
5216
5755
  }
5217
5756
 
5218
- var collapsedColumnGroups = self.getCollapsedColumnGroups();
5219
-
5220
- var isColumnCollapsed = function isColumnCollapsed(columnIndex) {
5221
- return collapsedColumnGroups.findIndex(function (group) {
5222
- return columnIndex >= group.from && columnIndex <= group.to;
5223
- }) >= 0;
5224
- };
5225
- /** @type {number} it will be used in `reduceSchema` only */
5226
-
5227
-
5228
- var frozenWidth = 0;
5229
- dataWidth = s.reduce(function reduceSchema(accumulator, column, columnIndex) {
5230
- // intentional redefintion of column. This causes scrollCache to be in the correct order
5231
- var schemaIndex = self.orders.columns[columnIndex];
5232
- var columnWidth = self.getColumnWidth(schemaIndex);
5233
- column = s[schemaIndex];
5234
- if (!column.hidden && !isColumnCollapsed(columnIndex)) accumulator += columnWidth;
5235
-
5236
- if (columnIndex < self.frozenColumn) {
5237
- self.scrollCache.x[columnIndex] = accumulator;
5238
- frozenWidth = accumulator;
5239
- } else {
5240
- self.scrollCache.x[columnIndex] = Math.max(frozenWidth + columnWidth, accumulator);
5241
- }
5242
-
5243
- return accumulator;
5244
- }, 0) || 0;
5245
-
5246
5757
  if (self.attributes.showNewRow) {
5247
5758
  dataHeight += ch;
5248
5759
  }
@@ -5359,9 +5870,17 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5359
5870
  self.page = Math.max(1, self.visibleRows.length - 3 - self.attributes.pageUpDownOverlap); // set canvas drawing related items
5360
5871
 
5361
5872
  if (!self.isChildGrid) {
5362
- self.canvas.width = self.width * ratio;
5363
- self.canvas.height = self.height * ratio;
5364
- self.ctx.scale(ratio, ratio);
5873
+ var newWidth = self.width * ratio;
5874
+ var newHeight = self.height * ratio; // We need to check is settings size to canvas necessary,
5875
+ // because settings the canvas'size will cause the canvas and its state be cleared
5876
+ // even if the size is the same.
5877
+ // Notes: Please don't call `self.resize()` without a subsequent call to `self.draw()`
5878
+
5879
+ if (self.canvas.width !== newWidth || self.canvas.height !== newHeight) {
5880
+ self.canvas.width = newWidth;
5881
+ self.canvas.height = newHeight;
5882
+ self.ctx.scale(ratio, ratio);
5883
+ }
5365
5884
  } // resize any open dom elements (input/textarea)
5366
5885
 
5367
5886
 
@@ -5432,6 +5951,13 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5432
5951
  self.mousemove = function (e, overridePos) {
5433
5952
  if (self.contextMenu || self.input) {
5434
5953
  return;
5954
+ } // Cancel dragging action if user ventures outside grid
5955
+
5956
+
5957
+ if (self.draggingItem && e.which === 0) {
5958
+ self.stopFreezeMove(e);
5959
+ self.mouseup(e);
5960
+ return;
5435
5961
  }
5436
5962
 
5437
5963
  self.mouse = overridePos || self.getLayerPos(e);
@@ -5479,6 +6005,21 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5479
6005
  }
5480
6006
 
5481
6007
  self.currentCell = cell;
6008
+
6009
+ if (!self.draggingItem && // It is not in dragging mode (avoid changing hovers frequent)
6010
+ cell && (cell.context === 'cell' || cell.context === self.cursorGrab)) {
6011
+ var indicator = self.getUnhideIndicator(self.mouse.x, self.mouse.y);
6012
+
6013
+ if (indicator) {
6014
+ self.cursor = 'pointer';
6015
+ self.hovers = {
6016
+ unhideIndicator: indicator
6017
+ };
6018
+ self.draw();
6019
+ return;
6020
+ }
6021
+ }
6022
+
5482
6023
  self.hovers = {};
5483
6024
 
5484
6025
  if (!self.draggingItem && cell) {
@@ -5549,6 +6090,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5549
6090
  dragBounds.top = -1;
5550
6091
  dragBounds.bottom = self.viewData.length - 1;
5551
6092
  if (dragBounds.left < 0) dragBounds.left = 0;
6093
+ if (dragBounds.left != dragBounds.right) self.isMultiColumnsSelected = true;else self.isMultiRowsSelected = false;
5552
6094
  }
5553
6095
 
5554
6096
  if (self.dragStartObject.rowIndex !== cell.rowIndex || self.dragStartObject.columnIndex !== cell.columnIndex) {
@@ -5631,6 +6173,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5631
6173
  if ((!self.selectionBounds || dragBounds.top !== self.selectionBounds.top || dragBounds.left !== self.selectionBounds.left || dragBounds.bottom !== self.selectionBounds.bottom || dragBounds.right !== self.selectionBounds.right) && !ctrl) {
5632
6174
  if (!(cell.hovered && self.hovers.onFilterButton)) {
5633
6175
  self.selections = [];
6176
+ self.selectedRows = [];
6177
+ self.selectedColumns = [];
5634
6178
  }
5635
6179
 
5636
6180
  if (dragBounds.top === -1) {
@@ -5645,7 +6189,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5645
6189
  }
5646
6190
  } else {
5647
6191
  self.selectArea(sBounds, true);
5648
- if (sBounds.left == -1 && sBounds.top !== sBounds.bottom) self.isMultiRowsSelected = true;
6192
+ self.activeCell.rowIndex = sBounds.top;
6193
+ self.activeCell.columnIndex = sBounds.left;
6194
+
6195
+ if (sBounds.left == -1 && sBounds.top !== sBounds.bottom) {
6196
+ self.activeCell.columnIndex = 0;
6197
+ self.isMultiRowsSelected = true;
6198
+ self.isMultiColumnsSelected = false;
6199
+ }
5649
6200
  }
5650
6201
  }
5651
6202
 
@@ -5719,6 +6270,16 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5719
6270
  return;
5720
6271
  }
5721
6272
 
6273
+ var unhideIndicator = self.getUnhideIndicator(pos.x, pos.y);
6274
+
6275
+ if (unhideIndicator) {
6276
+ var dir = unhideIndicator.dir,
6277
+ orderIndex0 = unhideIndicator.orderIndex0,
6278
+ orderIndex1 = unhideIndicator.orderIndex1;
6279
+ if (dir === 'l' || dir === 'r') self.unhideColumns(orderIndex0, orderIndex1);else self.unhideRows(orderIndex0, orderIndex1);
6280
+ return;
6281
+ }
6282
+
5722
6283
  var group = self.getColumnGroupAt(pos.x, pos.y);
5723
6284
  if (!group) group = self.getRowGroupAt(pos.x, pos.y);
5724
6285
 
@@ -5858,8 +6419,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5858
6419
  }
5859
6420
 
5860
6421
  self.resize();
5861
- document.body.removeEventListener('mousemove', self.dragResizeColumn, false);
5862
- document.body.removeEventListener('mouseup', self.stopDragResize, false);
6422
+ window.removeEventListener('mousemove', self.dragResizeColumn, false);
6423
+ window.removeEventListener('mouseup', self.stopDragResize, false);
5863
6424
  self.setStorageData();
5864
6425
  self.draw(true);
5865
6426
  self.ignoreNextClick = true;
@@ -5936,7 +6497,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5936
6497
  document.exitPointerLock();
5937
6498
  }
5938
6499
 
5939
- document.removeEventListener('mousemove', self.scrollGrid, false);
6500
+ window.removeEventListener('mousemove', self.scrollGrid, false);
5940
6501
  };
5941
6502
 
5942
6503
  self.dragReorder = function (e) {
@@ -5958,7 +6519,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5958
6519
  }
5959
6520
 
5960
6521
  if ((e.ctrlKey || e.metaKey || e.shiftKey) && self.reorderObject) {
5961
- if (self.dragMode === 'column-reorder' && !self.isMultiColumnsSelected(self.draggingItem.header.index)) {
6522
+ if (self.dragMode === 'column-reorder' && !self.isMultiColumnsSelected) {
5962
6523
  self.selectColumn(self.draggingItem.header.index, false, false);
5963
6524
  }
5964
6525
  }
@@ -5975,6 +6536,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5975
6536
  if (Math.abs(x) > self.attributes.reorderDeadZone || Math.abs(y) > self.attributes.reorderDeadZone) {
5976
6537
  self.reorderObject = self.draggingItem;
5977
6538
  if (self.isMultiRowsSelected) self.reorderObject = self.getVisibleCellByIndex(-1, self.activeCell.rowIndex);
6539
+ if (self.isMultiColumnsSelected) self.reorderObject = self.getVisibleCellByIndex(self.activeCell.columnIndex, -1);
5978
6540
  if (!self.reorderObject) return;
5979
6541
  self.reorderTarget = self.currentCell;
5980
6542
  self.reorderObject.dragOffset = {
@@ -5997,8 +6559,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
5997
6559
  'row-reorder': 'rowIndex',
5998
6560
  'column-reorder': 'sortColumnIndex'
5999
6561
  }[self.dragMode];
6000
- document.body.removeEventListener('mousemove', self.dragReorder, false);
6001
- document.body.removeEventListener('mouseup', self.stopDragReorder, false);
6562
+ window.removeEventListener('mousemove', self.dragReorder, false);
6563
+ window.removeEventListener('mouseup', self.stopDragReorder, false);
6002
6564
 
6003
6565
  if (self.reorderObject && self.reorderTarget && (self.dragMode === 'column-reorder' && self.reorderTarget.sortColumnIndex > -1 && self.reorderTarget.sortColumnIndex < self.getSchema().length || self.dragMode === 'row-reorder' && self.reorderTarget.rowIndex > -1 && self.reorderTarget.rowIndex < self.viewData.length) && self.reorderObject[i] !== self.reorderTarget[i] && !self.dispatchEvent('reorder', {
6004
6566
  NativeEvent: e,
@@ -6012,27 +6574,34 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6012
6574
 
6013
6575
  if (self.dragMode === 'column-reorder') {
6014
6576
  var sortColumnIndices = [];
6015
- var seletedColumnIndices = [];
6577
+ var selectedColumnIndices = [];
6016
6578
 
6017
6579
  if (self.selections[0]) {
6580
+ oIndex = self.selections[0][0];
6018
6581
  self.selections[0].forEach(function (value) {
6019
6582
  sortColumnIndices.push(self.orders.columns[value]);
6020
6583
  });
6021
6584
  }
6022
6585
 
6023
6586
  var deleteCount = sortColumnIndices.length;
6024
- cr[self.dragMode].splice(oIndex, deleteCount);
6025
- if (tIndex > oIndex) tIndex = tIndex - (deleteCount - 1);
6026
6587
 
6027
- for (var i = 0; i < sortColumnIndices.length; i++) {
6028
- seletedColumnIndices.push(tIndex + i);
6029
- cr[self.dragMode].splice(tIndex + i, 0, sortColumnIndices[i]);
6030
- }
6588
+ if (tIndex < oIndex || tIndex > oIndex && Math.abs(tIndex - oIndex) >= deleteCount) {
6589
+ cr[self.dragMode].splice(oIndex, deleteCount);
6590
+ if (tIndex > oIndex) tIndex = tIndex - (deleteCount - 1);
6591
+ self.selectedColumns = [];
6031
6592
 
6032
- self.orders.columns = cr[self.dragMode];
6033
- self.viewData.forEach(function (row, rowIndex) {
6034
- self.selections[rowIndex] = seletedColumnIndices;
6035
- });
6593
+ for (var i = 0; i < sortColumnIndices.length; i++) {
6594
+ if (i === 0) self.activeCell.columnIndex = tIndex;
6595
+ selectedColumnIndices.push(tIndex + i);
6596
+ self.selectedColumns.push(sortColumnIndices[i]);
6597
+ cr[self.dragMode].splice(tIndex + i, 0, sortColumnIndices[i]);
6598
+ }
6599
+
6600
+ self.orders.columns = cr[self.dragMode];
6601
+ self.viewData.forEach(function (row, rowIndex) {
6602
+ self.selections[rowIndex] = selectedColumnIndices;
6603
+ });
6604
+ }
6036
6605
  } else {
6037
6606
  var selectedRows = [];
6038
6607
  self.selections.forEach(function (row, rowIndex) {
@@ -6041,14 +6610,19 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6041
6610
  odata.push(self.viewData[rowIndex]);
6042
6611
  }
6043
6612
  });
6044
- self.viewData.splice(oIndex, odata.length);
6045
- self.selections = [];
6046
- if (tIndex > oIndex) tIndex = tIndex - (odata.length - 1);
6047
- self.activeCell.rowIndex = tIndex;
6048
6613
 
6049
- for (var i = 0; i < odata.length; i++) {
6050
- self.viewData.splice(tIndex + i, 0, odata[i]);
6051
- self.selections[tIndex + i] = selectedRows[i];
6614
+ if (tIndex < oIndex || tIndex > oIndex && Math.abs(tIndex - oIndex) >= odata.length) {
6615
+ self.viewData.splice(oIndex, odata.length);
6616
+ self.selections = [];
6617
+ self.selectedRows = [];
6618
+ if (tIndex > oIndex) tIndex = tIndex - (odata.length - 1);
6619
+ self.activeCell.rowIndex = tIndex;
6620
+
6621
+ for (var i = 0; i < odata.length; i++) {
6622
+ self.viewData.splice(tIndex + i, 0, odata[i]);
6623
+ self.selections[tIndex + i] = selectedRows[i];
6624
+ self.selectedRows.push(tIndex + i);
6625
+ }
6052
6626
  }
6053
6627
  }
6054
6628
 
@@ -6083,8 +6657,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6083
6657
  };
6084
6658
 
6085
6659
  self.stopDragMove = function (e) {
6086
- document.body.removeEventListener('mousemove', self.dragMove, false);
6087
- document.body.removeEventListener('mouseup', self.stopDragMove, false);
6660
+ window.removeEventListener('mousemove', self.dragMove, false);
6661
+ window.removeEventListener('mouseup', self.stopDragMove, false);
6088
6662
  var b = self.getSelectionBounds();
6089
6663
 
6090
6664
  if (self.dispatchEvent('endmove', {
@@ -6115,13 +6689,25 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6115
6689
  return;
6116
6690
  }
6117
6691
 
6692
+ var pos = self.getLayerPos(e);
6693
+ self.ignoreNextClick = true;
6694
+ self.freezeMarkerPosition = pos;
6695
+ pos.x -= self.getRowGroupAreaWidth();
6696
+ pos.y -= self.getColumnGroupAreaHeight();
6697
+
6698
+ if (Math.abs(pos.x) > self.attributes.reorderDeadZone || Math.abs(pos.y) > self.attributes.reorderDeadZone) {
6699
+ setTimeout(function () {
6700
+ self.autoScrollZone(e, pos.x, pos.y, false);
6701
+ }, 1);
6702
+ }
6703
+ };
6704
+
6705
+ self.stopFreezeMove = function (e) {
6118
6706
  var pos = self.getLayerPos(e),
6119
6707
  bm = self.style.gridBorderCollapse === 'collapse' ? 1 : 2,
6120
6708
  columnHeaderCellBorder = self.style.columnHeaderCellBorderWidth * bm,
6121
6709
  columnHeaderCellHeight = self.getColumnHeaderCellHeight(),
6122
6710
  rowHeaderCellWidth = self.getRowHeaderCellWidth();
6123
- self.ignoreNextClick = true;
6124
- self.freezeMarkerPosition = pos;
6125
6711
  pos.x -= self.getRowGroupAreaWidth();
6126
6712
  pos.y -= self.getColumnGroupAreaHeight();
6127
6713
 
@@ -6138,12 +6724,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6138
6724
  }
6139
6725
 
6140
6726
  if (self.currentCell && self.currentCell.columnIndex !== undefined && self.dragMode === 'frozen-column-marker') {
6727
+ var dataWidth = self.refreshScrollCacheX();
6141
6728
  self.scrollBox.scrollLeft = 0;
6142
- self.frozenColumn = self.currentCell.columnIndex + 1;
6143
- self.scrollBox.bar.h.x = rowHeaderCellWidth + self.scrollCache.x[self.frozenColumn - 1];
6144
- self.scrollBox.box.h.x = rowHeaderCellWidth + self.scrollCache.x[self.frozenColumn - 1];
6145
- var dataWidth = self.scrollCache.x[self.scrollCache.x.length - 1];
6146
- self.scrollBox.widthBoxRatio = (self.scrollBox.width - self.scrollCache.x[self.frozenColumn - 1]) / dataWidth;
6729
+ var x = self.currentCell.x - self.style.frozenMarkerWidth - self.style.frozenMarkerBorderWidth;
6730
+ if (pos.x > x + self.currentCell.width / 2) self.frozenColumn = self.currentCell.columnIndex + 1;else if (self.currentCell.columnIndex >= 0) self.frozenColumn = self.currentCell.columnIndex;
6731
+ self.scrollBox.bar.h.x = rowHeaderCellWidth + self.scrollCache.x[self.frozenColumn];
6732
+ self.scrollBox.widthBoxRatio = (self.scrollBox.width - self.scrollCache.x[self.frozenColumn]) / dataWidth;
6147
6733
  self.scrollBox.scrollBoxWidth = self.scrollBox.width * self.scrollBox.widthBoxRatio - self.style.scrollBarWidth;
6148
6734
  self.scrollBox.scrollBoxWidth = Math.max(self.scrollBox.scrollBoxWidth, self.style.scrollBarBoxMinSize);
6149
6735
  self.scrollBox.box.h.width = self.scrollBox.scrollBoxWidth;
@@ -6154,11 +6740,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6154
6740
  self.autoScrollZone(e, pos.x, pos.y, false);
6155
6741
  }, 1);
6156
6742
  }
6157
- };
6158
6743
 
6159
- self.stopFreezeMove = function (e) {
6160
- document.body.removeEventListener('mousemove', self.freezeMove, false);
6161
- document.body.removeEventListener('mouseup', self.stopFreezeMove, false);
6744
+ window.removeEventListener('mousemove', self.freezeMove, false);
6745
+ window.removeEventListener('mouseup', self.stopFreezeMove, false);
6162
6746
  self.freezeMarkerPosition = undefined;
6163
6747
 
6164
6748
  if (self.dispatchEvent('endfreezemove', {
@@ -6172,6 +6756,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6172
6756
  }
6173
6757
 
6174
6758
  self.draw(true);
6759
+ self.resize();
6175
6760
  };
6176
6761
 
6177
6762
  self.mousedown = function (e, overridePos) {
@@ -6196,6 +6781,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6196
6781
  move = /-move/.test(self.dragMode),
6197
6782
  freeze = /frozen-row-marker|frozen-column-marker/.test(self.dragMode),
6198
6783
  resize = /-resize/.test(self.dragMode);
6784
+ var onUnhideIndicator = self.hovers && self.hovers.unhideIndicator;
6199
6785
  self.dragStart = overridePos || self.getLayerPos(e);
6200
6786
  self.scrollStart = {
6201
6787
  left: self.scrollBox.scrollLeft,
@@ -6207,6 +6793,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6207
6793
  if (!ctrl && !e.shiftKey && !/(vertical|horizontal)-scroll-(bar|box)/.test(self.dragStartObject.context) && self.currentCell && !self.currentCell.isColumnHeader && !move && !freeze && !resize) {
6208
6794
  if (!(self.dragMode == 'row-reorder' && self.isMultiRowsSelected) && !(self.currentCell.hovered && self.hovers.onFilterButton)) {
6209
6795
  self.selections = [];
6796
+ self.selectedRows = [];
6797
+ self.selectedColumns = [];
6210
6798
  }
6211
6799
  }
6212
6800
 
@@ -6214,7 +6802,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6214
6802
  return;
6215
6803
  }
6216
6804
 
6217
- if (self.scrollModes.indexOf(self.dragStartObject.context) !== -1) {
6805
+ if (self.scrollModes.indexOf(self.dragStartObject.context) !== -1 && !onUnhideIndicator) {
6218
6806
  self.scrollMode = self.dragStartObject.context;
6219
6807
  self.scrollStartMode = self.dragStartObject.context;
6220
6808
  self.scrollGrid(e);
@@ -6227,8 +6815,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6227
6815
  self.canvas.requestPointerLock();
6228
6816
  }
6229
6817
 
6230
- document.addEventListener('mousemove', self.scrollGrid, false);
6231
- document.addEventListener('mouseup', self.stopScrollGrid, false);
6818
+ window.addEventListener('mousemove', self.scrollGrid, false);
6819
+ window.addEventListener('mouseup', self.stopScrollGrid, false);
6232
6820
  self.ignoreNextClick = true;
6233
6821
  return;
6234
6822
  }
@@ -6240,7 +6828,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6240
6828
  self.selectRow(self.dragStartObject.rowIndex, ctrl, null);
6241
6829
  } else if ((self.attributes.selectionMode === 'column' || self.dragStartObject.rowIndex === -1) && self.dragStartObject.columnIndex > -1) {
6242
6830
  self.selectColumn(self.currentCell.header.index, ctrl, e.shiftKey);
6243
- } else if (self.attributes.selectionMode !== 'row') {
6831
+ return;
6832
+ }
6833
+
6834
+ if (self.attributes.selectionMode !== 'row') {
6244
6835
  self.mousemove(e);
6245
6836
  }
6246
6837
 
@@ -6259,8 +6850,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6259
6850
  return;
6260
6851
  }
6261
6852
 
6262
- document.body.addEventListener('mousemove', self.dragMove, false);
6263
- document.body.addEventListener('mouseup', self.stopDragMove, false);
6853
+ window.addEventListener('mousemove', self.dragMove, false);
6854
+ window.addEventListener('mouseup', self.stopDragMove, false);
6264
6855
  return self.mousemove(e);
6265
6856
  }
6266
6857
 
@@ -6277,12 +6868,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6277
6868
  return;
6278
6869
  }
6279
6870
 
6280
- document.body.addEventListener('mousemove', self.freezeMove, false);
6281
- document.body.addEventListener('mouseup', self.stopFreezeMove, false);
6871
+ self.freezeMarkerPosition = self.getLayerPos(e);
6872
+ self.freezeMarkerPosition.isGrab = true;
6873
+ window.addEventListener('mousemove', self.freezeMove, false);
6874
+ window.addEventListener('mouseup', self.stopFreezeMove, false);
6282
6875
  return self.mousemove(e);
6283
6876
  }
6284
6877
 
6285
- if (resize) {
6878
+ if (resize && !onUnhideIndicator) {
6286
6879
  self.draggingItem = self.dragItem;
6287
6880
 
6288
6881
  if (self.draggingItem.rowOpen) {
@@ -6292,22 +6885,22 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6292
6885
  }
6293
6886
 
6294
6887
  self.resizingStartingWidth = self.sizes.columns[self.draggingItem.header.style === 'rowHeaderCell' ? 'cornerCell' : self.draggingItem.sortColumnIndex] || self.draggingItem.width;
6295
- document.body.addEventListener('mousemove', self.dragResizeColumn, false);
6296
- document.body.addEventListener('mouseup', self.stopDragResize, false);
6888
+ window.addEventListener('mousemove', self.dragResizeColumn, false);
6889
+ window.addEventListener('mouseup', self.stopDragResize, false);
6297
6890
  return;
6298
6891
  }
6299
6892
 
6300
6893
  if (['row-reorder', 'column-reorder'].indexOf(self.dragMode) !== -1) {
6301
6894
  self.draggingItem = self.dragStartObject;
6302
6895
 
6303
- if (self.dragMode === 'column-reorder' && !self.isMultiColumnsSelected(self.currentCell.header.index)) {
6896
+ if (self.dragMode === 'column-reorder' && !self.isMultiColumnsSelected) {
6304
6897
  self.selectColumn(self.currentCell.header.index, ctrl, e.shiftKey);
6305
6898
  } else if (self.dragMode === 'row-reorder' && !self.isMultiRowsSelected) {
6306
6899
  self.selectRow(self.dragStartObject.rowIndex, ctrl, null);
6307
6900
  }
6308
6901
 
6309
- document.body.addEventListener('mousemove', self.dragReorder, false);
6310
- document.body.addEventListener('mouseup', self.stopDragReorder, false);
6902
+ window.addEventListener('mousemove', self.dragReorder, false);
6903
+ window.addEventListener('mouseup', self.stopDragReorder, false);
6311
6904
  return;
6312
6905
  }
6313
6906
  };
@@ -6552,6 +7145,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6552
7145
  if (!e.shiftKey && self.attributes.selectionFollowsActiveCell) {
6553
7146
  if (!ctrl) {
6554
7147
  self.selections = [];
7148
+ self.selectedRows = [];
7149
+ self.selectedColumns = [];
6555
7150
  }
6556
7151
 
6557
7152
  self.selections[y] = self.selections[y] || [];
@@ -6697,6 +7292,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6697
7292
  });
6698
7293
  } else {
6699
7294
  var selections = [];
7295
+ self.selectedRows = [];
7296
+ self.selectedColumns = [];
6700
7297
 
6701
7298
  for (var rowIndex = 0; rowIndex < rows.length; rowIndex++) {
6702
7299
  // Rows may have been moved by user, so get the actual row index
@@ -6706,6 +7303,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6706
7303
  var existingRowData = self.viewData[realRowIndex];
6707
7304
  var newRowData = Object.assign({}, existingRowData);
6708
7305
  selections[realRowIndex] = [];
7306
+ self.selectedRows.push(realRowIndex);
6709
7307
 
6710
7308
  for (var colIndex = 0; colIndex < cells.length; colIndex++) {
6711
7309
  var column = schema[startColIndex + colIndex];
@@ -6727,6 +7325,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
6727
7325
 
6728
7326
  selections[realRowIndex].push(startColIndex + colIndex);
6729
7327
  newRowData[columnName] = cellData;
7328
+ if (self.selectedColumns.indexOf(startColIndex + colIndex) === -1) self.selectedColumns.push(startColIndex + colIndex);
6730
7329
  }
6731
7330
 
6732
7331
  self.originalData[self.boundRowIndexMap.get(realRowIndex)] = newRowData; // Update view date here to avoid a full refresh of `viewData`.
@@ -7063,6 +7662,90 @@ var createHTMLString = function createHTMLString(selectedData, isNeat) {
7063
7662
 
7064
7663
 
7065
7664
 
7665
+ /***/ }),
7666
+
7667
+ /***/ "./lib/groups/util.js":
7668
+ /*!****************************!*\
7669
+ !*** ./lib/groups/util.js ***!
7670
+ \****************************/
7671
+ /*! namespace exports */
7672
+ /*! export mergeHiddenRowRanges [provided] [no usage info] [missing usage info prevents renaming] */
7673
+ /*! other exports [not provided] [no usage info] */
7674
+ /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
7675
+ /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
7676
+
7677
+ "use strict";
7678
+ __webpack_require__.r(__webpack_exports__);
7679
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7680
+ /* harmony export */ "mergeHiddenRowRanges": function() { return /* binding */ mergeHiddenRowRanges; }
7681
+ /* harmony export */ });
7682
+
7683
+ /**
7684
+ * Merge a new hidden row range into existed ranges array
7685
+ * @param {any[]} hiddenRowRanges tuples: Array<[bgeinRowIndex, endRowIndex]>
7686
+ * @param {number[]} newRange tuple: [beginRowIndex, endRowIndex]
7687
+ * @returns {boolean}
7688
+ */
7689
+
7690
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7691
+
7692
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
7693
+
7694
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
7695
+
7696
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
7697
+
7698
+ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
7699
+
7700
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7701
+
7702
+ var mergeHiddenRowRanges = function mergeHiddenRowRanges(hiddenRowRanges, newRange) {
7703
+ var _newRange = _slicedToArray(newRange, 2),
7704
+ beginRowIndex = _newRange[0],
7705
+ endRowIndex = _newRange[1];
7706
+
7707
+ if (endRowIndex < beginRowIndex) return false;
7708
+ var inserted = false;
7709
+
7710
+ for (var i = 0; i < hiddenRowRanges.length; i++) {
7711
+ var range = hiddenRowRanges[i];
7712
+ if (beginRowIndex > range[1] + 1) continue;
7713
+
7714
+ if (beginRowIndex <= range[0] && endRowIndex >= range[0]) {
7715
+ hiddenRowRanges[i] = [beginRowIndex, Math.max(endRowIndex, range[1])];
7716
+ inserted = true;
7717
+ break;
7718
+ }
7719
+
7720
+ if (beginRowIndex >= range[0]) {
7721
+ hiddenRowRanges[i] = [range[0], Math.max(endRowIndex, range[1])];
7722
+ inserted = true;
7723
+ break;
7724
+ }
7725
+ }
7726
+
7727
+ if (!inserted) hiddenRowRanges.push([beginRowIndex, endRowIndex]); // merge intersections after sorting ranges
7728
+
7729
+ hiddenRowRanges.sort(function (a, b) {
7730
+ return a[0] - b[0];
7731
+ });
7732
+
7733
+ for (var _i2 = 0; _i2 < hiddenRowRanges.length - 1; _i2++) {
7734
+ var _range = hiddenRowRanges[_i2];
7735
+ var nextRange = hiddenRowRanges[_i2 + 1];
7736
+
7737
+ if (nextRange[0] <= _range[1] + 1) {
7738
+ hiddenRowRanges[_i2] = [_range[0], Math.max(_range[1], nextRange[1])];
7739
+ hiddenRowRanges.splice(_i2 + 1, 1);
7740
+ _i2--;
7741
+ }
7742
+ }
7743
+
7744
+ return true;
7745
+ };
7746
+
7747
+
7748
+
7066
7749
  /***/ }),
7067
7750
 
7068
7751
  /***/ "./lib/intf.js":
@@ -7164,6 +7847,21 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
7164
7847
  self.scrollBox = {};
7165
7848
  self.visibleRows = [];
7166
7849
  self.visibleCells = [];
7850
+ /**
7851
+ * Each item of this array contains these properties:
7852
+ * - `x`, `y`, `x2`, `y2`
7853
+ * - `orderIndex0`, `orderIndex1`: The closed interval of the hiding rows/columns.
7854
+ * - `dir`: The directon of the unhide indicator. 'l' and 'r' for columns, 't' and 'b' for rows
7855
+ */
7856
+
7857
+ self.visibleUnhideIndicators = [];
7858
+ /**
7859
+ * Each item is a tuple conatins two numbers:
7860
+ * its type difination: Array<[beginRowIndex, endRowIndex]>
7861
+ * Each tuple represents a closed Interval
7862
+ */
7863
+
7864
+ self.hiddenRowRanges = [];
7167
7865
  /**
7168
7866
  * This array stored all groups information with context for drawing,
7169
7867
  * it is generated by drawing functions,
@@ -7185,6 +7883,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
7185
7883
  trees: {}
7186
7884
  };
7187
7885
  self.selections = [];
7886
+ self.selectedRows = [];
7887
+ self.selectedColumns = [];
7188
7888
  self.filterable = {
7189
7889
  rows: [],
7190
7890
  columns: []
@@ -7244,7 +7944,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
7244
7944
  self.groupedRows = [];
7245
7945
  self.scrollModes = ['vertical-scroll-box', 'vertical-scroll-top', 'vertical-scroll-bottom', 'horizontal-scroll-box', 'horizontal-scroll-right', 'horizontal-scroll-left'];
7246
7946
  self.componentL1Events = {};
7247
- self.eventNames = ['afterdraw', 'afterrendercell', 'afterrenderfilterbutton', 'aftercreategroup', 'attributechanged', 'beforebeginedit', 'beforecreatecellgrid', 'beforedraw', 'beforeendedit', 'beforerendercell', 'beforerendercellgrid', 'beforerenderfilterbutton', 'beginedit', 'cellmouseout', 'cellmouseover', 'click', 'collapsetree', 'contextmenu', 'copy', 'datachanged', 'dblclick', 'endedit', 'expandtree', 'formatcellvalue', 'keydown', 'keypress', 'keyup', 'mousedown', 'mousemove', 'mouseup', 'newrow', 'ordercolumn', 'rendercell', 'rendercellgrid', 'renderorderbyarrow', 'rendertext', 'rendertreearrow', 'reorder', 'reordering', 'resize', 'resizecolumn', 'resizerow', 'schemachanged', 'scroll', 'selectionchanged', 'stylechanged', 'touchcancel', 'touchend', 'touchmove', 'touchstart', 'wheel'];
7947
+ self.eventNames = ['afterdraw', 'afterrendercell', 'afterrenderfilterbutton', 'aftercreategroup', 'attributechanged', 'beforebeginedit', 'beforecreatecellgrid', 'beforedraw', 'beforeendedit', 'beforerendercell', 'beforerendercellgrid', 'beforerenderfilterbutton', 'beginedit', 'cellmouseout', 'cellmouseover', 'click', 'collapsetree', 'columnhide', 'columnunhide', 'contextmenu', 'copy', 'datachanged', 'dblclick', 'endedit', 'expandtree', 'formatcellvalue', 'keydown', 'keypress', 'keyup', 'mousedown', 'mousemove', 'mouseup', 'newrow', 'ordercolumn', 'rendercell', 'rendercellgrid', 'renderorderbyarrow', 'rendertext', 'rendertreearrow', 'reorder', 'reordering', 'resize', 'resizecolumn', 'resizerow', 'schemachanged', 'scroll', 'selectionchanged', 'stylechanged', 'touchcancel', 'touchend', 'touchmove', 'touchstart', 'wheel'];
7248
7948
  self.mouse = {
7249
7949
  x: 0,
7250
7950
  y: 0
@@ -7825,7 +8525,23 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
7825
8525
  // useful when emitting cell events.
7826
8526
  var newViewData = originalData.map(function (row, originalRowIndex) {
7827
8527
  return [row, originalRowIndex];
7828
- }); // Apply filtering
8528
+ }); // Remove hidden rows here. So we can keep the bound indexes correct
8529
+
8530
+ if (self.hiddenRowRanges.length > 0) {
8531
+ var ranges = self.hiddenRowRanges.sort(function (a, b) {
8532
+ return b[1] - a[1];
8533
+ });
8534
+
8535
+ for (var i = 0; i < ranges.length; i++) {
8536
+ var _ranges$i = _slicedToArray(ranges[i], 2),
8537
+ beginRowIndex = _ranges$i[0],
8538
+ endRowIndex = _ranges$i[1];
8539
+
8540
+ var countOfRows = endRowIndex - beginRowIndex + 1;
8541
+ newViewData.splice(beginRowIndex, countOfRows);
8542
+ }
8543
+ } // Apply filtering
8544
+
7829
8545
 
7830
8546
  var _loop = function _loop() {
7831
8547
  var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i4], 2),
@@ -7860,8 +8576,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
7860
8576
 
7861
8577
  var collapsedGroups = [];
7862
8578
 
7863
- for (var i = 0; i < self.groupedRows.length; i++) {
7864
- var rows = self.groupedRows[i];
8579
+ for (var _i5 = 0; _i5 < self.groupedRows.length; _i5++) {
8580
+ var rows = self.groupedRows[_i5];
7865
8581
 
7866
8582
  for (var j = 0; j < rows.length; j++) {
7867
8583
  var r = rows[j];
@@ -7878,17 +8594,17 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
7878
8594
  var newLen = 0;
7879
8595
  var len = collapsedGroups.length;
7880
8596
 
7881
- for (var _i5 = 0; _i5 < len; _i5++) {
7882
- var _r = collapsedGroups[_i5];
8597
+ for (var _i6 = 0; _i6 < len; _i6++) {
8598
+ var _r = collapsedGroups[_i6];
7883
8599
 
7884
- if (_i5 === len - 1) {
8600
+ if (_i6 === len - 1) {
7885
8601
  collapsedGroups[newLen++] = _r;
7886
8602
  break;
7887
8603
  }
7888
8604
 
7889
8605
  var to = _r[1];
7890
8606
 
7891
- var _collapsedGroups = _slicedToArray(collapsedGroups[_i5 + 1], 2),
8607
+ var _collapsedGroups = _slicedToArray(collapsedGroups[_i6 + 1], 2),
7892
8608
  from2 = _collapsedGroups[0],
7893
8609
  to2 = _collapsedGroups[1];
7894
8610
 
@@ -7897,8 +8613,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
7897
8613
  continue;
7898
8614
  }
7899
8615
 
7900
- collapsedGroups[_i5 + 1] = _r;
7901
- if (to2 > to) collapsedGroups[_i5 + 1][1] = to2;
8616
+ collapsedGroups[_i6 + 1] = _r;
8617
+ if (to2 > to) collapsedGroups[_i6 + 1][1] = to2;
7902
8618
  }
7903
8619
 
7904
8620
  collapsedGroups = collapsedGroups.slice(0, newLen); //#endregion merge groups
@@ -8092,7 +8808,6 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
8092
8808
  document.body.removeChild(self.controlInput);
8093
8809
  }
8094
8810
 
8095
- self.eventParent.removeEventListener('mouseup', self.mouseup, false);
8096
8811
  self.eventParent.removeEventListener('mousedown', self.mousedown, false);
8097
8812
  self.eventParent.removeEventListener('dblclick', self.dblclick, false);
8098
8813
  self.eventParent.removeEventListener('click', self.click, false);
@@ -8106,7 +8821,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
8106
8821
  self.controlInput.removeEventListener('keypress', self.keypress, false);
8107
8822
  self.controlInput.removeEventListener('keyup', self.keyup, false);
8108
8823
  self.controlInput.removeEventListener('keydown', self.keydown, false);
8109
- document.body.removeEventListener('mousemove', self.mousemove);
8824
+ window.removeEventListener('mouseup', self.mouseup, false);
8825
+ window.removeEventListener('mousemove', self.mousemove);
8110
8826
  window.removeEventListener('resize', self.resize);
8111
8827
 
8112
8828
  if (self.observer && self.observer.disconnect) {
@@ -8700,6 +9416,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
8700
9416
  self.intf.cut = self.cut;
8701
9417
  self.intf.paste = self.paste;
8702
9418
  self.intf.setStyleProperty = self.setStyleProperty;
9419
+ self.intf.hideColumns = self.hideColumns;
9420
+ self.intf.unhideColumns = self.unhideColumns;
9421
+ self.intf.hideRows = self.hideRows;
9422
+ self.intf.unhideRows = self.unhideRows;
8703
9423
  Object.defineProperty(self.intf, 'defaults', {
8704
9424
  get: function get() {
8705
9425
  return {
@@ -9763,7 +10483,7 @@ function canvasDatagrid(args) {
9763
10483
  /*! namespace exports */
9764
10484
  /*! export default [provided] [no usage info] [missing usage info prevents renaming] */
9765
10485
  /*! other exports [not provided] [no usage info] */
9766
- /*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
10486
+ /*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
9767
10487
  /***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
9768
10488
 
9769
10489
  "use strict";
@@ -9771,6 +10491,7 @@ __webpack_require__.r(__webpack_exports__);
9771
10491
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
9772
10492
  /* harmony export */ "default": function() { return /* export default binding */ __WEBPACK_DEFAULT_EXPORT__; }
9773
10493
  /* harmony export */ });
10494
+ /* harmony import */ var _groups_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./groups/util */ "./lib/groups/util.js");
9774
10495
  /*jslint browser: true, unparam: true, todo: true*/
9775
10496
 
9776
10497
  /*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/
@@ -9782,6 +10503,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
9782
10503
 
9783
10504
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
9784
10505
 
10506
+
9785
10507
  /* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(self) {
9786
10508
  /**
9787
10509
  * Converts a integer into a letter A - ZZZZZ...
@@ -10221,6 +10943,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
10221
10943
 
10222
10944
 
10223
10945
  self.setActiveCell = function (x, y) {
10946
+ if (typeof x === 'undefined') return;
10947
+
10224
10948
  if (x < 0) {
10225
10949
  x = 0;
10226
10950
  }
@@ -10245,6 +10969,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
10245
10969
 
10246
10970
  self.selectNone = function (dontDraw) {
10247
10971
  self.selections = [];
10972
+ self.selectedRows = [];
10973
+ self.selectedColumns = [];
10248
10974
  self.dispatchEvent('selectionchanged', {
10249
10975
  selectedData: self.getSelectedData(),
10250
10976
  selections: self.selections,
@@ -10282,51 +11008,42 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
10282
11008
  self.draw();
10283
11009
  };
10284
11010
  /**
10285
- * Returns true if indices of columns next to the selected columnIndex is selected on every row.
11011
+ * Returns true if the selected columnIndex is selected on every row.
10286
11012
  * @memberof canvasDatagrid
10287
- * @name isMultiColumnsSelected
11013
+ * @name isColumnSelected
10288
11014
  * @method
10289
11015
  * @param {number} columnIndex The column index to check.
10290
11016
  */
10291
11017
 
10292
11018
 
10293
- self.isMultiColumnsSelected = function (columnIndex) {
10294
- var multiColIsSelected = true;
11019
+ self.isColumnSelected = function (columnIndex) {
11020
+ var colIsSelected = true;
10295
11021
  self.viewData.forEach(function (row, rowIndex) {
10296
- var columnIndices = self.selections[rowIndex];
10297
-
10298
- if (!columnIndices || columnIndices.length <= 1 || columnIndices.indexOf(columnIndex) === -1) {
10299
- multiColIsSelected = false;
10300
- } else if (columnIndices.length > 1) {
10301
- if (columnIndices[0] != columnIndex) multiColIsSelected = false;else {
10302
- for (var i = 0; i < columnIndices.length - 1; i++) {
10303
- if (columnIndices[i] + 1 != columnIndices[i + 1]) {
10304
- multiColIsSelected = false;
10305
- break;
10306
- }
10307
- }
10308
- }
11022
+ if (!self.selections[rowIndex] || self.selections[rowIndex].indexOf(columnIndex) === -1) {
11023
+ colIsSelected = false;
10309
11024
  }
10310
11025
  });
10311
- return multiColIsSelected;
11026
+ return colIsSelected;
10312
11027
  };
10313
11028
  /**
10314
- * Returns true if the selected columnIndex is selected on every row.
11029
+ * Returns true if the selected rowIndex is selected on every column.
10315
11030
  * @memberof canvasDatagrid
10316
- * @name isColumnSelected
11031
+ * @name isRowSelected
10317
11032
  * @method
10318
- * @param {number} columnIndex The column index to check.
11033
+ * @param {number} rowIndex The row index to check.
10319
11034
  */
10320
11035
 
10321
11036
 
10322
- self.isColumnSelected = function (columnIndex) {
10323
- var colIsSelected = true;
10324
- self.viewData.forEach(function (row, rowIndex) {
10325
- if (!self.selections[rowIndex] || self.selections[rowIndex].indexOf(columnIndex) === -1) {
10326
- colIsSelected = false;
11037
+ self.isRowSelected = function (rowIndex) {
11038
+ if (!self.selections[rowIndex]) return false;
11039
+ var rowIsSelected = true;
11040
+ var schema = self.getVisibleSchema();
11041
+ schema.forEach(function (col, index) {
11042
+ if (!self.selections[rowIndex] || self.selections[rowIndex].indexOf(index) === -1) {
11043
+ rowIsSelected = false;
10327
11044
  }
10328
11045
  });
10329
- return colIsSelected;
11046
+ return rowIsSelected;
10330
11047
  };
10331
11048
  /**
10332
11049
  * Runs the defined method on each selected cell.
@@ -10376,6 +11093,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
10376
11093
 
10377
11094
  self.selectColumn = function (columnIndex, ctrl, shift, supressEvent) {
10378
11095
  var s, e, x;
11096
+ self.isMultiRowsSelected = false;
11097
+ self.isMultiColumnsSelected = false;
10379
11098
 
10380
11099
  function addCol(i) {
10381
11100
  self.viewData.forEach(function (row, rowIndex) {
@@ -10407,19 +11126,25 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
10407
11126
 
10408
11127
  for (x = s; e > x; x += 1) {
10409
11128
  addCol(x);
11129
+ if (self.selectedColumns.indexOf(x) === -1) self.selectedColumns.push(x);
10410
11130
  }
11131
+
11132
+ if (s != e) self.isMultiColumnsSelected = true;
10411
11133
  }
10412
11134
 
10413
11135
  if (!ctrl && !shift) {
10414
11136
  self.selections = [];
11137
+ self.selectedColumns = [];
10415
11138
  self.activeCell.columnIndex = columnIndex;
10416
11139
  self.activeCell.rowIndex = self.scrollIndexTop;
10417
11140
  }
10418
11141
 
10419
11142
  if (ctrl && self.isColumnSelected(columnIndex)) {
10420
11143
  removeCol(columnIndex);
11144
+ self.selectedColumns.splice(columnIndex, 1);
10421
11145
  } else {
10422
11146
  addCol(columnIndex);
11147
+ self.selectedColumns.push(columnIndex);
10423
11148
  }
10424
11149
 
10425
11150
  if (supressEvent) {
@@ -10470,6 +11195,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
10470
11195
  self.selections[ri].push(-1);
10471
11196
  s.forEach(function (col, index) {
10472
11197
  self.selections[ri].push(self.orders.columns.indexOf(col.index));
11198
+ if (col.index !== -1 && self.selectedColumns.indexOf(self.orders.columns.indexOf(col.index)) === -1) self.selectedColumns.push(self.orders.columns.indexOf(col.index));
10473
11199
  });
10474
11200
  }
10475
11201
 
@@ -10494,9 +11220,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
10494
11220
 
10495
11221
  for (x = st; en >= x; x += 1) {
10496
11222
  addRow(x);
11223
+ self.selectedRows.push(x);
10497
11224
  }
10498
11225
  } else {
10499
11226
  addRow(rowIndex);
11227
+ self.selectedRows = [];
11228
+ self.selectedRows.push(rowIndex);
10500
11229
  }
10501
11230
  }
10502
11231
 
@@ -10620,6 +11349,102 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
10620
11349
  }
10621
11350
  }
10622
11351
  };
11352
+ /**
11353
+ * Hide column/columns
11354
+ * @memberof canvasDatagrid
11355
+ * @name hideColumns
11356
+ * @method
11357
+ * @param {number} beginColumnOrderIndex
11358
+ * @param {number} [endColumnOrderIndex]
11359
+ */
11360
+
11361
+
11362
+ self.hideColumns = function (beginColumnOrderIndex, endColumnOrderIndex) {
11363
+ var schema = self.getSchema();
11364
+ var orders = self.orders.columns;
11365
+ var hiddenColumns = [];
11366
+ if (typeof endColumnOrderIndex !== 'number') endColumnOrderIndex = beginColumnOrderIndex;
11367
+
11368
+ for (var orderIndex = beginColumnOrderIndex; orderIndex <= endColumnOrderIndex; orderIndex++) {
11369
+ var columnIndex = orders[orderIndex];
11370
+
11371
+ if (columnIndex >= 0 && !schema[columnIndex].hidden) {
11372
+ hiddenColumns.push(columnIndex);
11373
+ schema[columnIndex].hidden = true;
11374
+ self.dispatchEvent('columnhide', {
11375
+ columnIndex: columnIndex
11376
+ });
11377
+ }
11378
+ }
11379
+
11380
+ if (hiddenColumns.length > 0) {
11381
+ self.setStorageData();
11382
+ setTimeout(function () {
11383
+ self.resize(true);
11384
+ }, 10);
11385
+ }
11386
+
11387
+ self.dispatchEvent('hidecolumns', {
11388
+ hiddenColumns: hiddenColumns
11389
+ });
11390
+ };
11391
+ /**
11392
+ * Unihde column/columns
11393
+ * @memberof canvasDatagrid
11394
+ * @name unhideColumns
11395
+ * @method
11396
+ * @param {number} beginColumnOrderIndex
11397
+ * @param {number} [endColumnOrderIndex]
11398
+ */
11399
+
11400
+
11401
+ self.unhideColumns = function (beginColumnOrderIndex, endColumnOrderIndex) {
11402
+ var orders = self.orders.columns;
11403
+ var schema = self.getSchema();
11404
+
11405
+ for (var i = beginColumnOrderIndex; i <= endColumnOrderIndex; i++) {
11406
+ var columnIndex = orders[i];
11407
+ var s = schema[columnIndex];
11408
+
11409
+ if (s && s.hidden) {
11410
+ s.hidden = false;
11411
+ self.dispatchEvent('columnunhide', {
11412
+ columnIndex: columnIndex
11413
+ });
11414
+ }
11415
+ }
11416
+
11417
+ self.refresh();
11418
+ };
11419
+ /**
11420
+ * Hide rows
11421
+ * @memberof canvasDatagrid
11422
+ * @name hideRows
11423
+ * @method
11424
+ * @param {number} beginRowIndex
11425
+ * @param {number} endRowIndex
11426
+ */
11427
+
11428
+
11429
+ self.hideRows = function (beginRowIndex, endRowIndex) {
11430
+ if ((0,_groups_util__WEBPACK_IMPORTED_MODULE_0__.mergeHiddenRowRanges)(self.hiddenRowRanges, [beginRowIndex, endRowIndex])) self.refresh();
11431
+ };
11432
+ /**
11433
+ * Unhide rows
11434
+ * @memberof canvasDatagrid
11435
+ * @name unhideRows
11436
+ * @method
11437
+ * @param {number} beginRowIndex
11438
+ * @param {number} endRowIndex
11439
+ */
11440
+
11441
+
11442
+ self.unhideRows = function (beginRowIndex, endRowIndex) {
11443
+ self.hiddenRowRanges = self.hiddenRowRanges.filter(function (range) {
11444
+ return range[0] !== beginRowIndex || range[1] !== endRowIndex;
11445
+ });
11446
+ self.refresh();
11447
+ };
10623
11448
  /**
10624
11449
  * Resizes a column to fit the longest value in the column. Call without a value to resize all columns.
10625
11450
  * Warning, can be slow on very large record sets (1m records ~3-5 seconds on an i7).
@@ -10738,6 +11563,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
10738
11563
  /**
10739
11564
  * Add grouping
10740
11565
  * @param {'columns'|'rows'} groupFor
11566
+ * @method
10741
11567
  * @param {number} from
10742
11568
  * @param {number} to
10743
11569
  */
@@ -10829,6 +11655,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
10829
11655
  /**
10830
11656
  * Remove grouping
10831
11657
  * @param {Array<Array<{from:number,to:number,collapsed:boolean}>>} allGroups
11658
+ * @method
10832
11659
  * @param {number} from
10833
11660
  * @param {number} to
10834
11661
  */
@@ -11064,10 +11891,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11064
11891
 
11065
11892
  self.moveSelection = function (offsetX, offsetY) {
11066
11893
  var sel = [];
11894
+ self.selectedRows = [];
11895
+ self.selectedColumns = [];
11067
11896
  self.selections.forEach(function (row, rowIndex) {
11068
11897
  sel[rowIndex + offsetY] = [];
11898
+ self.selectedRows.push(rowIndex + offsetY);
11069
11899
  row.forEach(function (colIndex) {
11070
11900
  sel[rowIndex + offsetY].push(colIndex + offsetX);
11901
+ if (self.selectedColumns.indexOf(colIndex + offsetX) === -1) self.selectedColumns.push(colIndex + offsetX);
11071
11902
  });
11072
11903
  });
11073
11904
  self.selections = sel;
@@ -11280,6 +12111,25 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11280
12111
  return c.columnIndex === x && c.rowIndex === y;
11281
12112
  })[0];
11282
12113
  };
12114
+ /**
12115
+ * Get an unhide indicator at grid pixel coordinate x and y.
12116
+ * @memberof canvasDatagrid
12117
+ * @name getUnhideIndicator
12118
+ * @method
12119
+ * @param {number} x Number of pixels from the left.
12120
+ * @param {number} y Number of pixels from the top.
12121
+ */
12122
+
12123
+
12124
+ self.getUnhideIndicator = function (x, y) {
12125
+ var indicators = self.visibleUnhideIndicators;
12126
+ if (indicators.length <= 0) return;
12127
+
12128
+ for (var i = 0; i < indicators.length; i++) {
12129
+ var indicator = indicators[i];
12130
+ if (x >= indicator.x && y >= indicator.y && x <= indicator.x2 && y <= indicator.y2) return indicator;
12131
+ }
12132
+ };
11283
12133
  /**
11284
12134
  * Get a column group at grid pixel coordinate x and y.
11285
12135
  * @memberof canvasDatagrid
@@ -11360,6 +12210,14 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11360
12210
 
11361
12211
  x -= self.getRowGroupAreaWidth();
11362
12212
  y -= self.getColumnGroupAreaHeight();
12213
+
12214
+ if (self.dragStartObject !== undefined) {
12215
+ if (x <= 0) x = 1;
12216
+ if (x >= self.width) x = self.width - 1;
12217
+ if (y <= 0) y = 1;
12218
+ if (y >= self.height) y = self.height - 1;
12219
+ }
12220
+
11363
12221
  var border,
11364
12222
  tsz = useTouchScrollZones ? self.attributes.touchScrollZone : 0,
11365
12223
  moveMode = self.attributes.borderDragBehavior === 'move',
@@ -11404,14 +12262,16 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11404
12262
 
11405
12263
  if (entitiy.x - self.style.cellBorderWidth < x && entitiy.x + entitiy.width + self.style.cellBorderWidth > x && entitiy.y - self.style.cellBorderWidth < y && entitiy.y + entitiy.height + self.style.cellBorderWidth > y) {
11406
12264
  if (/frozen-row-marker/.test(cell.style)) {
12265
+ if (self.dragMode === 'frozen-column-marker') continue;
11407
12266
  cell.dragContext = cell.style;
11408
- cell.context = 'row-resize';
12267
+ cell.context = 'grab';
11409
12268
  return cell;
11410
12269
  }
11411
12270
 
11412
12271
  if (/frozen-column-marker/.test(cell.style)) {
12272
+ if (self.dragMode === 'frozen-row-marker') continue;
11413
12273
  cell.dragContext = cell.style;
11414
- cell.context = 'col-resize';
12274
+ cell.context = 'grab';
11415
12275
  return cell;
11416
12276
  }
11417
12277
 
@@ -11490,7 +12350,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11490
12350
  }
11491
12351
 
11492
12352
  if (cell.style === 'columnHeaderCell') {
11493
- if (cell.x + cell.width - self.attributes.columnGrabZoneSize - self.style.cellBorderWidth > x || !self.attributes.allowRowReordering) {
12353
+ if (!self.isColumnSelected(cell.columnIndex) && cell.x + cell.width - self.attributes.columnGrabZoneSize - self.style.cellBorderWidth > x || !self.attributes.allowRowReordering) {
11494
12354
  cell.dragContext = 'cell';
11495
12355
  cell.context = 'cell';
11496
12356
  } else {
@@ -11502,7 +12362,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11502
12362
  }
11503
12363
 
11504
12364
  if (cell.style === 'rowHeaderCell') {
11505
- if (self.attributes.rowGrabZoneSize + (cell.y - self.style.cellBorderWidth) < y || !self.attributes.allowRowReordering) {
12365
+ if (!self.isRowSelected(cell.rowIndex) && self.attributes.rowGrabZoneSize + (cell.y - self.style.cellBorderWidth) < y || !self.attributes.allowRowReordering) {
11506
12366
  cell.dragContext = 'cell';
11507
12367
  cell.context = 'cell';
11508
12368
  } else {
@@ -11639,6 +12499,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11639
12499
 
11640
12500
  if (!ctrl) {
11641
12501
  self.selections = [];
12502
+ self.selectedRows = [];
12503
+ self.selectedColumns = [];
11642
12504
  }
11643
12505
 
11644
12506
  if (self.selectionBounds.top < -1 || self.selectionBounds.bottom > self.viewData.length || self.selectionBounds.left < -1 || self.selectionBounds.right > s.length) {
@@ -11647,11 +12509,16 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11647
12509
 
11648
12510
  for (x = self.selectionBounds.top; x <= self.selectionBounds.bottom; x += 1) {
11649
12511
  self.selections[x] = [];
12512
+ self.selectedRows.push(x);
11650
12513
 
11651
12514
  for (y = self.selectionBounds.left; y <= self.selectionBounds.right; y += 1) {
11652
12515
  if (self.selections[x].indexOf(y) === -1) {
11653
12516
  self.selections[x].push(y);
11654
12517
  }
12518
+
12519
+ if (y !== -1 && self.selectedColumns.indexOf(y) === -1) {
12520
+ self.selectedColumns.push(y);
12521
+ }
11655
12522
  }
11656
12523
  }
11657
12524
 
@@ -11692,7 +12559,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
11692
12559
  }
11693
12560
 
11694
12561
  self.ctx.font = self.style.columnHeaderCellFont;
11695
- var t = self.ctx.measureText(col.title || col.name).width + self.style.headerCellPaddingRight + self.style.headerCellPaddingLeft;
12562
+ var t = self.ctx.measureText(col.title || col.name).width + self.style.columnHeaderCellPaddingRight + self.style.columnHeaderCellPaddingLeft + self.style.cellAutoResizePadding;
11696
12563
  m = t > m ? t : m;
11697
12564
  formatter = self.formatters[col.type];
11698
12565
  });