canvas-datagrid 0.4.2 → 0.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/canvas-datagrid.debug.js +778 -129
- package/dist/canvas-datagrid.debug.map +1 -1
- package/dist/canvas-datagrid.js +1 -1
- package/dist/canvas-datagrid.module.js +1 -1
- package/dist/canvas-datagrid.module.js.map +1 -1
- package/dist/types.d.ts +25 -0
- package/lib/contextMenu.js +176 -47
- package/lib/defaults.js +8 -0
- package/lib/draw.js +246 -13
- package/lib/events/index.js +70 -32
- package/lib/groups/util.js +42 -0
- package/lib/intf.js +37 -0
- package/lib/publicMethods.js +84 -2
- package/package.json +1 -1
|
@@ -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,
|
|
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
|
-
|
|
1232
|
-
|
|
1233
|
-
self.
|
|
1234
|
-
}
|
|
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
|
|
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
|
|
1564
|
+
var _column = _columns.get(_columnIndex);
|
|
1409
1565
|
|
|
1410
|
-
if (
|
|
1411
|
-
groupNames.push(
|
|
1412
|
-
groupTitles.push(
|
|
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(
|
|
1437
|
-
var _groups$_i = groups[
|
|
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
|
|
1461
|
-
_loop(
|
|
1616
|
+
for (var _i2 = 0; _i2 < groups.length; _i2++) {
|
|
1617
|
+
_loop(_i2);
|
|
1462
1618
|
}
|
|
1463
1619
|
}
|
|
1464
1620
|
|
|
1465
1621
|
if (canGroupByRows) {
|
|
1466
|
-
var
|
|
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
|
-
|
|
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 (
|
|
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(
|
|
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(
|
|
1509
|
-
var _groups$_i2 = _groups[
|
|
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
|
|
1528
|
-
_loop2(
|
|
1665
|
+
for (var _i3 = 0; _i3 < _groups.length; _i3++) {
|
|
1666
|
+
_loop2(_i3);
|
|
1529
1667
|
}
|
|
1530
1668
|
} //#endregion group/ungroup columns
|
|
1531
1669
|
|
|
@@ -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', ' '], ['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', ' '], ['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', '▼'], ['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', '►'], ['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', '▼'], ['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', '▼'], ['contextMenuArrowUpHTML', '▲'], ['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', '▼'], ['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', '►'], ['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', '▼'], ['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', '▼'], ['contextMenuArrowUpHTML', '▲'], ['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], ['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
|
|
|
@@ -2560,6 +2698,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2560
2698
|
/*globals XMLSerializer: false, define: true, Blob: false, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/
|
|
2561
2699
|
|
|
2562
2700
|
|
|
2701
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2702
|
+
|
|
2703
|
+
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."); }
|
|
2704
|
+
|
|
2705
|
+
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; }
|
|
2706
|
+
|
|
2707
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
2708
|
+
|
|
2563
2709
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
2564
2710
|
|
|
2565
2711
|
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 +2821,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
2675
2821
|
}
|
|
2676
2822
|
/**
|
|
2677
2823
|
* @param {number[]} coords [x0,y0, x1,y1, x2,y2, ...]
|
|
2824
|
+
* @param {boolean} [fill] fill the area that construct by these lines but not stroke
|
|
2678
2825
|
*/
|
|
2679
2826
|
|
|
2680
2827
|
|
|
2681
|
-
function
|
|
2828
|
+
function drawLines(coords, fill) {
|
|
2682
2829
|
if (coords.length < 4) return;
|
|
2683
2830
|
self.ctx.beginPath();
|
|
2684
2831
|
self.ctx.moveTo(coords[0] + self.canvasOffsetLeft, coords[1] + self.canvasOffsetTop);
|
|
@@ -2689,7 +2836,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
2689
2836
|
self.ctx.lineTo(x, y);
|
|
2690
2837
|
}
|
|
2691
2838
|
|
|
2692
|
-
self.ctx.stroke();
|
|
2839
|
+
if (fill) self.ctx.fill();else self.ctx.stroke();
|
|
2693
2840
|
}
|
|
2694
2841
|
/**
|
|
2695
2842
|
* @param {number} x based-X (left-top)
|
|
@@ -2704,8 +2851,72 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
2704
2851
|
strokeRect(x, y, width, width);
|
|
2705
2852
|
var cx = x + width * 0.5;
|
|
2706
2853
|
var cy = y + width * 0.5;
|
|
2707
|
-
|
|
2708
|
-
if (collapsed)
|
|
2854
|
+
drawLines([x + width * 0.2, cy, x + width * 0.78, cy]);
|
|
2855
|
+
if (collapsed) drawLines([cx, y + width * 0.22, cx, y + width * 0.8]);
|
|
2856
|
+
}
|
|
2857
|
+
/**
|
|
2858
|
+
* @param {number} x
|
|
2859
|
+
* @param {number} y
|
|
2860
|
+
* @param {number} size
|
|
2861
|
+
* @param {string} dir Direction of the triangle, one of the 't','b','l' and 'r'
|
|
2862
|
+
* @param {boolean} [active]
|
|
2863
|
+
*/
|
|
2864
|
+
|
|
2865
|
+
|
|
2866
|
+
function drawUnhideIndicator(x, y, size, dir, active) {
|
|
2867
|
+
var minPadding = size * 0.2;
|
|
2868
|
+
var maxPadding = size * 0.3;
|
|
2869
|
+
/** The long edge width of the triangle */
|
|
2870
|
+
|
|
2871
|
+
var longEdge = size - 2 * minPadding;
|
|
2872
|
+
/** The median width of the triangle */
|
|
2873
|
+
|
|
2874
|
+
var median = size - 2 * maxPadding;
|
|
2875
|
+
var halfLongEdge = longEdge * 0.5;
|
|
2876
|
+
var x0, y0;
|
|
2877
|
+
var coords, borderCoords;
|
|
2878
|
+
|
|
2879
|
+
switch (dir) {
|
|
2880
|
+
case 'r':
|
|
2881
|
+
x0 = x + maxPadding;
|
|
2882
|
+
y0 = y + minPadding;
|
|
2883
|
+
borderCoords = [x, y, x + size, y, x + size, y + size, x, y + size];
|
|
2884
|
+
coords = [x0, y0, x0, y0 + longEdge, x0 + median, y0 + halfLongEdge];
|
|
2885
|
+
break;
|
|
2886
|
+
|
|
2887
|
+
case 'l':
|
|
2888
|
+
x0 = x + size - maxPadding;
|
|
2889
|
+
y0 = y + minPadding;
|
|
2890
|
+
borderCoords = [x + size, y, x, y, x, y + size, x + size, y + size];
|
|
2891
|
+
coords = [x0, y0, x0, y0 + longEdge, x0 - median, y0 + halfLongEdge];
|
|
2892
|
+
break;
|
|
2893
|
+
|
|
2894
|
+
case 't':
|
|
2895
|
+
x0 = x + minPadding;
|
|
2896
|
+
y0 = y + size - maxPadding;
|
|
2897
|
+
borderCoords = [x, y + size, x, y, x + size, y, x + size, y + size];
|
|
2898
|
+
coords = [x0, y0, x0 + longEdge, y0, x0 + halfLongEdge, y0 - median];
|
|
2899
|
+
break;
|
|
2900
|
+
|
|
2901
|
+
case 'b':
|
|
2902
|
+
x0 = x + minPadding;
|
|
2903
|
+
y0 = y + maxPadding;
|
|
2904
|
+
borderCoords = [x, y, x, y + size, x + size, y + size, x + size, y];
|
|
2905
|
+
coords = [x0, y0, x0 + longEdge, y0, x0 + halfLongEdge, y0 + median];
|
|
2906
|
+
break;
|
|
2907
|
+
}
|
|
2908
|
+
|
|
2909
|
+
if (active) {
|
|
2910
|
+
self.ctx.strokeStyle = self.style.unhideIndicatorBorderColor;
|
|
2911
|
+
self.ctx.lineWidth = 2;
|
|
2912
|
+
drawLines(borderCoords);
|
|
2913
|
+
self.ctx.fillStyle = self.style.unhideIndicatorBackgroundColor;
|
|
2914
|
+
var offset = dir === 'r' || dir === 'b' ? 1 : 0;
|
|
2915
|
+
if (dir === 'l' || dir === 'r') fillRect(x - offset, y, size + offset, size);else fillRect(x, y - offset, size, size + offset);
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
self.ctx.fillStyle = self.style.unhideIndicatorColor;
|
|
2919
|
+
drawLines(coords, true);
|
|
2709
2920
|
}
|
|
2710
2921
|
|
|
2711
2922
|
function drawOrderByArrow(x, y) {
|
|
@@ -3292,7 +3503,18 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
3292
3503
|
columnGroupsRectInfo = {},
|
|
3293
3504
|
collapsedColumnGroups = self.getCollapsedColumnGroups(),
|
|
3294
3505
|
collapsedRowGroups = self.getCollapsedRowGroups(),
|
|
3295
|
-
cellHeight = self.style.cellHeight
|
|
3506
|
+
cellHeight = self.style.cellHeight,
|
|
3507
|
+
currentRowIndexOffset = 0,
|
|
3508
|
+
|
|
3509
|
+
/** @type {Array<{from:number,plus:number}>} */
|
|
3510
|
+
rowIndexOffsetByHiddenRows = self.hiddenRowRanges.map(function (range) {
|
|
3511
|
+
return {
|
|
3512
|
+
from: range[0],
|
|
3513
|
+
plus: range[1] - range[0] + 1
|
|
3514
|
+
};
|
|
3515
|
+
}).sort(function (a, b) {
|
|
3516
|
+
return a.from - b.from;
|
|
3517
|
+
});
|
|
3296
3518
|
drawCount += 1;
|
|
3297
3519
|
p = performance.now();
|
|
3298
3520
|
self.visibleRowHeights = []; // if data length has changed, there is no way to know
|
|
@@ -3800,6 +4022,20 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
3800
4022
|
hasRowGap = collapsedRowGroups.find(function (group) {
|
|
3801
4023
|
return group.from === previousRowNumber && group.to === cell.boundRowIndex;
|
|
3802
4024
|
}) >= 0;
|
|
4025
|
+
} // We don't treat the row index difference from hidden rows as the row gap.
|
|
4026
|
+
|
|
4027
|
+
|
|
4028
|
+
if (hasRowGap && self.hiddenRowRanges.length > 0) {
|
|
4029
|
+
for (var i = 0; i < self.hiddenRowRanges.length; i++) {
|
|
4030
|
+
var _self$hiddenRowRanges = _slicedToArray(self.hiddenRowRanges[i], 2),
|
|
4031
|
+
beginRowIndex = _self$hiddenRowRanges[0],
|
|
4032
|
+
endRowIndex = _self$hiddenRowRanges[1];
|
|
4033
|
+
|
|
4034
|
+
if (cell.boundRowIndex === endRowIndex + 1 && previousRowNumber === beginRowIndex - 1) {
|
|
4035
|
+
hasRowGap = false;
|
|
4036
|
+
break;
|
|
4037
|
+
}
|
|
4038
|
+
}
|
|
3803
4039
|
}
|
|
3804
4040
|
|
|
3805
4041
|
if (hasRowGap) {
|
|
@@ -3810,11 +4046,162 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
3810
4046
|
fillRect(cell.x, cell.y - barHeight / 2, cell.width, barHeight);
|
|
3811
4047
|
self.ctx.restore();
|
|
3812
4048
|
}
|
|
3813
|
-
}
|
|
4049
|
+
} //#region draw unhide indicator for column headers
|
|
4050
|
+
|
|
4051
|
+
|
|
4052
|
+
if (isColumnHeader && self.attributes.showUnhideColumnsIndicator) {
|
|
4053
|
+
var _hovered = self.hovers.unhideIndicator;
|
|
4054
|
+
var size = self.style.unhideIndicatorSize;
|
|
4055
|
+
var cellX = x;
|
|
4056
|
+
var topY = cell.y + Math.max(0.5 * (cell.height - size), 0);
|
|
4057
|
+
|
|
4058
|
+
var isActive = function isActive(orderIndex) {
|
|
4059
|
+
return _hovered && (_hovered.dir === 'l' || _hovered.dir === 'r') && orderIndex >= _hovered.orderIndex0 && orderIndex <= _hovered.orderIndex1;
|
|
4060
|
+
};
|
|
4061
|
+
|
|
4062
|
+
var isHiddenColumn = function isHiddenColumn(columnIndex) {
|
|
4063
|
+
return columnIndex >= 0 && schema[columnIndex] && schema[columnIndex].hidden;
|
|
4064
|
+
};
|
|
4065
|
+
|
|
4066
|
+
var orderIndex0, orderIndex1;
|
|
4067
|
+
|
|
4068
|
+
var drawIndicator = function drawIndicator(leftX, dir, active) {
|
|
4069
|
+
self.visibleUnhideIndicators.push({
|
|
4070
|
+
x: leftX - 1,
|
|
4071
|
+
y: topY - 1,
|
|
4072
|
+
x2: leftX + size + 2,
|
|
4073
|
+
y2: topY + size + 2,
|
|
4074
|
+
orderIndex0: orderIndex0,
|
|
4075
|
+
orderIndex1: orderIndex1,
|
|
4076
|
+
dir: dir
|
|
4077
|
+
});
|
|
4078
|
+
|
|
4079
|
+
if (!active) {
|
|
4080
|
+
var line = cell.text && cell.text.lines && cell.text.lines[0];
|
|
4081
|
+
|
|
4082
|
+
if (line) {
|
|
4083
|
+
var iconsWidth = orderByArrowSize + treeArrowSize;
|
|
4084
|
+
var lineX0 = iconsWidth > 0 ? iconsWidth : line.x;
|
|
4085
|
+
var lineX1 = line.x + line.width;
|
|
4086
|
+
if (leftX + size >= lineX0 && leftX <= lineX1) return;
|
|
4087
|
+
}
|
|
4088
|
+
}
|
|
4089
|
+
|
|
4090
|
+
drawUnhideIndicator(leftX, topY, size, dir, active);
|
|
4091
|
+
}; // end of drawIndicator
|
|
4092
|
+
|
|
4093
|
+
|
|
4094
|
+
var orderIndexPtr = columnOrderIndex - 1;
|
|
4095
|
+
var prevColumnIndex = self.orders.columns[orderIndexPtr];
|
|
4096
|
+
|
|
4097
|
+
if (isHiddenColumn(prevColumnIndex)) {
|
|
4098
|
+
var _active = isActive(prevColumnIndex);
|
|
4099
|
+
|
|
4100
|
+
orderIndex0 = orderIndexPtr;
|
|
4101
|
+
orderIndex1 = orderIndexPtr;
|
|
4102
|
+
|
|
4103
|
+
while (--orderIndexPtr >= 0) {
|
|
4104
|
+
if (isHiddenColumn(self.orders.columns[orderIndexPtr])) orderIndex0 = orderIndexPtr;else break;
|
|
4105
|
+
}
|
|
4106
|
+
|
|
4107
|
+
drawIndicator(cellX, 'r', _active);
|
|
4108
|
+
}
|
|
4109
|
+
|
|
4110
|
+
orderIndexPtr = columnOrderIndex + 1;
|
|
4111
|
+
var nextColumnIndex = self.orders.columns[orderIndexPtr];
|
|
4112
|
+
|
|
4113
|
+
if (isHiddenColumn(nextColumnIndex)) {
|
|
4114
|
+
var _active2 = isActive(nextColumnIndex);
|
|
4115
|
+
|
|
4116
|
+
orderIndex0 = orderIndexPtr;
|
|
4117
|
+
orderIndex1 = orderIndexPtr;
|
|
4118
|
+
|
|
4119
|
+
while (++orderIndexPtr < self.orders.columns.length) {
|
|
4120
|
+
if (isHiddenColumn(self.orders.columns[orderIndexPtr])) orderIndex1 = orderIndexPtr;else break;
|
|
4121
|
+
}
|
|
4122
|
+
|
|
4123
|
+
var indicatorX = x + cell.width - size;
|
|
4124
|
+
drawIndicator(indicatorX, 'l', _active2);
|
|
4125
|
+
}
|
|
4126
|
+
} //#endregion draw unhide indicator for column headers
|
|
4127
|
+
//#region draw unhide indicator for row headers
|
|
4128
|
+
|
|
4129
|
+
|
|
4130
|
+
if (isRowHeader && self.attributes.showUnhideRowsIndicator && self.hiddenRowRanges.length > 0) {
|
|
4131
|
+
// Leo's comment:
|
|
4132
|
+
// from the first row to the last row, `rowIndex` is from 0 to the count of rows
|
|
4133
|
+
// but `boundRowIndex` can be disordered if there are any ordered columns or filtered columns
|
|
4134
|
+
// Like this statement:
|
|
4135
|
+
// console.log(rowIndex, cell.boundRowIndex, cell.formattedValue);
|
|
4136
|
+
// can output the result like this:
|
|
4137
|
+
// 0 1 '2'
|
|
4138
|
+
// 1 3 '4'
|
|
4139
|
+
var _hovered2 = self.hovers.unhideIndicator;
|
|
4140
|
+
var _size = self.style.unhideIndicatorSize;
|
|
4141
|
+
var leftX = cell.x + cell.width - _size - 2;
|
|
4142
|
+
var cellY = y;
|
|
4143
|
+
var topIndicators = {};
|
|
4144
|
+
var bottomIndicators = {};
|
|
4145
|
+
self.hiddenRowRanges.forEach(function (it) {
|
|
4146
|
+
topIndicators[it[0] - 1] = it;
|
|
4147
|
+
bottomIndicators[it[1] + 1] = it;
|
|
4148
|
+
});
|
|
4149
|
+
|
|
4150
|
+
var _rowIndex = cell.rowIndex + currentRowIndexOffset;
|
|
4151
|
+
|
|
4152
|
+
var _isActive = function _isActive() {
|
|
4153
|
+
return _hovered2 && (_hovered2.dir === 't' || _hovered2.dir === 'b') && _rowIndex >= _hovered2.orderIndex0 - 1 && _rowIndex <= _hovered2.orderIndex1 + 1;
|
|
4154
|
+
};
|
|
4155
|
+
|
|
4156
|
+
var _orderIndex, _orderIndex2;
|
|
4157
|
+
|
|
4158
|
+
var _drawIndicator = function _drawIndicator(topY, dir, active) {
|
|
4159
|
+
self.visibleUnhideIndicators.push({
|
|
4160
|
+
x: leftX - 1,
|
|
4161
|
+
y: topY - 1,
|
|
4162
|
+
x2: leftX + _size + 2,
|
|
4163
|
+
y2: topY + _size + 2,
|
|
4164
|
+
orderIndex0: _orderIndex,
|
|
4165
|
+
orderIndex1: _orderIndex2,
|
|
4166
|
+
dir: dir
|
|
4167
|
+
});
|
|
4168
|
+
drawUnhideIndicator(leftX, topY, _size, dir, active);
|
|
4169
|
+
}; // end of drawIndicator
|
|
4170
|
+
|
|
4171
|
+
|
|
4172
|
+
var matched = topIndicators[_rowIndex];
|
|
4173
|
+
|
|
4174
|
+
if (matched) {
|
|
4175
|
+
var indicatorY = cellY + cell.height - _size;
|
|
4176
|
+
var _matched = matched;
|
|
4177
|
+
|
|
4178
|
+
var _matched2 = _slicedToArray(_matched, 2);
|
|
4179
|
+
|
|
4180
|
+
_orderIndex = _matched2[0];
|
|
4181
|
+
_orderIndex2 = _matched2[1];
|
|
4182
|
+
|
|
4183
|
+
_drawIndicator(indicatorY, 't', _isActive());
|
|
4184
|
+
}
|
|
4185
|
+
|
|
4186
|
+
matched = bottomIndicators[_rowIndex];
|
|
4187
|
+
|
|
4188
|
+
if (matched) {
|
|
4189
|
+
var _indicatorY = cellY;
|
|
4190
|
+
var _matched3 = matched;
|
|
4191
|
+
|
|
4192
|
+
var _matched4 = _slicedToArray(_matched3, 2);
|
|
4193
|
+
|
|
4194
|
+
_orderIndex = _matched4[0];
|
|
4195
|
+
_orderIndex2 = _matched4[1];
|
|
4196
|
+
|
|
4197
|
+
_drawIndicator(_indicatorY, 'b', _isActive());
|
|
4198
|
+
}
|
|
4199
|
+
} //#endregion draw unhide indicator for row headers
|
|
4200
|
+
|
|
3814
4201
|
|
|
3815
4202
|
x += cell.width + (bc ? 0 : self.style.cellBorderWidth);
|
|
3816
4203
|
return cell.width;
|
|
3817
|
-
};
|
|
4204
|
+
}; // end of drawEach
|
|
3818
4205
|
}
|
|
3819
4206
|
|
|
3820
4207
|
function drawFilterButton(cell, ev) {
|
|
@@ -3851,8 +4238,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
3851
4238
|
// row index + 1. If rowIndex > viewData.length, it's a new row
|
|
3852
4239
|
// added to the end, and we want to render that new row's number
|
|
3853
4240
|
|
|
3854
|
-
var filteredRowNumber
|
|
4241
|
+
var filteredRowNumber;
|
|
4242
|
+
if (self.viewData && rowIndex < self.viewData.length) filteredRowNumber = self.getBoundRowIndexFromViewRowIndex(rowIndex) + 1;else filteredRowNumber = self.originalData ? self.originalData.length + 1 : rowOrderIndex + 1;
|
|
3855
4243
|
var rowHeaderValue = self.hasActiveFilters() || self.hasCollapsedRowGroup() ? filteredRowNumber : rowIndex + 1;
|
|
4244
|
+
rowHeaderValue += currentRowIndexOffset;
|
|
3856
4245
|
var _rowHeaderCell = {
|
|
3857
4246
|
rowHeaderCell: rowHeaderValue
|
|
3858
4247
|
};
|
|
@@ -3866,6 +4255,13 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
3866
4255
|
};
|
|
3867
4256
|
rowOpen = self.openChildren[rowIndex];
|
|
3868
4257
|
drawCell(_rowHeaderCell, rowOrderIndex, rowIndex)(headerDescription, -1, -1);
|
|
4258
|
+
|
|
4259
|
+
if (rowIndexOffsetByHiddenRows[0] && rowHeaderValue >= rowIndexOffsetByHiddenRows[0].from) {
|
|
4260
|
+
var _rowIndexOffsetByHidd = rowIndexOffsetByHiddenRows.shift(),
|
|
4261
|
+
plus = _rowIndexOffsetByHidd.plus;
|
|
4262
|
+
|
|
4263
|
+
currentRowIndexOffset += plus;
|
|
4264
|
+
}
|
|
3869
4265
|
}
|
|
3870
4266
|
}
|
|
3871
4267
|
|
|
@@ -4094,10 +4490,18 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
4094
4490
|
schema = self.getSchema();
|
|
4095
4491
|
self.visibleCells = [];
|
|
4096
4492
|
self.visibleGroups = [];
|
|
4493
|
+
self.visibleUnhideIndicators = [];
|
|
4097
4494
|
self.canvasOffsetTop = self.isChildGrid ? self.parentNode.offsetTop : 0.5;
|
|
4098
4495
|
self.canvasOffsetLeft = self.isChildGrid ? self.parentNode.offsetLeft : -0.5;
|
|
4099
4496
|
h = self.height;
|
|
4100
|
-
w = self.width;
|
|
4497
|
+
w = self.width; // patch for first row being hidden
|
|
4498
|
+
|
|
4499
|
+
var firstRowIndexOffset = rowIndexOffsetByHiddenRows[0];
|
|
4500
|
+
|
|
4501
|
+
if (firstRowIndexOffset && firstRowIndexOffset.from === 0) {
|
|
4502
|
+
currentRowIndexOffset = firstRowIndexOffset.plus;
|
|
4503
|
+
rowIndexOffsetByHiddenRows.shift();
|
|
4504
|
+
}
|
|
4101
4505
|
}
|
|
4102
4506
|
|
|
4103
4507
|
function drawBackground() {
|
|
@@ -4312,7 +4716,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
4312
4716
|
if (containsEnd) rightX += toggleHandleSize;
|
|
4313
4717
|
}
|
|
4314
4718
|
|
|
4315
|
-
|
|
4719
|
+
drawLines(lineCoords);
|
|
4316
4720
|
ctx.restore();
|
|
4317
4721
|
pushToVisibleGroups(leftX, rightX);
|
|
4318
4722
|
};
|
|
@@ -4383,13 +4787,13 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
4383
4787
|
|
|
4384
4788
|
|
|
4385
4789
|
if (group.from > 0) {
|
|
4386
|
-
var
|
|
4790
|
+
var _rowIndex2 = group.to + 1;
|
|
4387
4791
|
|
|
4388
|
-
var _row = rowGroupsRectInfo[
|
|
4792
|
+
var _row = rowGroupsRectInfo[_rowIndex2];
|
|
4389
4793
|
|
|
4390
4794
|
if (!_row) {
|
|
4391
|
-
|
|
4392
|
-
_row = rowGroupsRectInfo[
|
|
4795
|
+
_rowIndex2 = group.from - 1;
|
|
4796
|
+
_row = rowGroupsRectInfo[_rowIndex2];
|
|
4393
4797
|
if (!_row) return "continue"; // don't draw this group indicator because it is invisible
|
|
4394
4798
|
|
|
4395
4799
|
_topY = _row.y + _row.h - toggleHandleSize * 0.5;
|
|
@@ -4397,7 +4801,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
4397
4801
|
_topY = _row.y;
|
|
4398
4802
|
}
|
|
4399
4803
|
|
|
4400
|
-
if (
|
|
4804
|
+
if (_rowIndex2 >= self.frozenRow) {
|
|
4401
4805
|
var compare = frozenRowsHeight + columnHeaderCellHeight - toggleHandlePadding; // don't draw this group indicator because it is hidden by frozen columns
|
|
4402
4806
|
|
|
4403
4807
|
if (_topY < compare) return "continue";
|
|
@@ -4513,7 +4917,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
4513
4917
|
if (containsEnd) bottomY += toggleHandleSize;
|
|
4514
4918
|
}
|
|
4515
4919
|
|
|
4516
|
-
|
|
4920
|
+
drawLines(lineCoords);
|
|
4517
4921
|
ctx.restore();
|
|
4518
4922
|
pushToVisibleGroups(topY, bottomY);
|
|
4519
4923
|
};
|
|
@@ -5103,6 +5507,43 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5103
5507
|
self.getRatio = function () {
|
|
5104
5508
|
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
5509
|
};
|
|
5510
|
+
/**
|
|
5511
|
+
* @returns {number} dataWidth
|
|
5512
|
+
*/
|
|
5513
|
+
|
|
5514
|
+
|
|
5515
|
+
self.refreshScrollCacheX = function () {
|
|
5516
|
+
var s = self.getSchema();
|
|
5517
|
+
self.scrollCache.x = [];
|
|
5518
|
+
/** @type {number} it will be used in `reduceSchema` only */
|
|
5519
|
+
|
|
5520
|
+
var frozenWidth = 0;
|
|
5521
|
+
var collapsedColumnGroups = self.getCollapsedColumnGroups();
|
|
5522
|
+
|
|
5523
|
+
var isColumnCollapsed = function isColumnCollapsed(columnIndex) {
|
|
5524
|
+
return collapsedColumnGroups.findIndex(function (group) {
|
|
5525
|
+
return columnIndex >= group.from && columnIndex <= group.to;
|
|
5526
|
+
}) >= 0;
|
|
5527
|
+
};
|
|
5528
|
+
|
|
5529
|
+
var dataWidth = s.reduce(function reduceSchema(accumulator, column, columnIndex) {
|
|
5530
|
+
// intentional redefintion of column. This causes scrollCache to be in the correct order
|
|
5531
|
+
var schemaIndex = self.orders.columns[columnIndex];
|
|
5532
|
+
var columnWidth = self.getColumnWidth(schemaIndex);
|
|
5533
|
+
column = s[schemaIndex];
|
|
5534
|
+
if (!column.hidden && !isColumnCollapsed(columnIndex)) accumulator += columnWidth;
|
|
5535
|
+
|
|
5536
|
+
if (columnIndex < self.frozenColumn) {
|
|
5537
|
+
self.scrollCache.x[columnIndex] = accumulator;
|
|
5538
|
+
frozenWidth = accumulator;
|
|
5539
|
+
} else {
|
|
5540
|
+
self.scrollCache.x[columnIndex] = Math.max(frozenWidth + columnWidth, accumulator);
|
|
5541
|
+
}
|
|
5542
|
+
|
|
5543
|
+
return accumulator;
|
|
5544
|
+
}, 0) || 0;
|
|
5545
|
+
return dataWidth;
|
|
5546
|
+
};
|
|
5106
5547
|
|
|
5107
5548
|
self.resize = function (drawAfterResize) {
|
|
5108
5549
|
if (!self.canvas) {
|
|
@@ -5163,8 +5604,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5163
5604
|
rowHeaderCellWidth = self.getRowHeaderCellWidth(),
|
|
5164
5605
|
topGroupAreaHeight = self.getColumnGroupAreaHeight(),
|
|
5165
5606
|
leftGroupAreaWidth = self.getRowGroupAreaWidth(),
|
|
5166
|
-
ch = self.style.cellHeight
|
|
5167
|
-
s = self.getSchema(); // sets actual DOM canvas element
|
|
5607
|
+
ch = self.style.cellHeight; // sets actual DOM canvas element
|
|
5168
5608
|
|
|
5169
5609
|
function checkScrollBoxVisibility() {
|
|
5170
5610
|
self.scrollBox.horizontalBarVisible = self.style.width !== 'auto' && dataWidth > self.scrollBox.width && self.style.overflowX !== 'hidden' || self.style.overflowX === 'scroll';
|
|
@@ -5202,7 +5642,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5202
5642
|
});
|
|
5203
5643
|
}
|
|
5204
5644
|
|
|
5205
|
-
|
|
5645
|
+
dataWidth = self.refreshScrollCacheX();
|
|
5206
5646
|
self.scrollCache.y = [];
|
|
5207
5647
|
|
|
5208
5648
|
for (x = 0; x < l; x += 1) {
|
|
@@ -5215,34 +5655,6 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5215
5655
|
self.scrollCache.y[x] = dataHeight;
|
|
5216
5656
|
}
|
|
5217
5657
|
|
|
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
5658
|
if (self.attributes.showNewRow) {
|
|
5247
5659
|
dataHeight += ch;
|
|
5248
5660
|
}
|
|
@@ -5486,6 +5898,21 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5486
5898
|
}
|
|
5487
5899
|
|
|
5488
5900
|
self.currentCell = cell;
|
|
5901
|
+
|
|
5902
|
+
if (!self.draggingItem && // It is not in dragging mode (avoid changing hovers frequent)
|
|
5903
|
+
cell && (cell.context === 'cell' || cell.context === self.cursorGrab)) {
|
|
5904
|
+
var indicator = self.getUnhideIndicator(self.mouse.x, self.mouse.y);
|
|
5905
|
+
|
|
5906
|
+
if (indicator) {
|
|
5907
|
+
self.cursor = 'pointer';
|
|
5908
|
+
self.hovers = {
|
|
5909
|
+
unhideIndicator: indicator
|
|
5910
|
+
};
|
|
5911
|
+
self.draw();
|
|
5912
|
+
return;
|
|
5913
|
+
}
|
|
5914
|
+
}
|
|
5915
|
+
|
|
5489
5916
|
self.hovers = {};
|
|
5490
5917
|
|
|
5491
5918
|
if (!self.draggingItem && cell) {
|
|
@@ -5726,6 +6153,16 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
5726
6153
|
return;
|
|
5727
6154
|
}
|
|
5728
6155
|
|
|
6156
|
+
var unhideIndicator = self.getUnhideIndicator(pos.x, pos.y);
|
|
6157
|
+
|
|
6158
|
+
if (unhideIndicator) {
|
|
6159
|
+
var dir = unhideIndicator.dir,
|
|
6160
|
+
orderIndex0 = unhideIndicator.orderIndex0,
|
|
6161
|
+
orderIndex1 = unhideIndicator.orderIndex1;
|
|
6162
|
+
if (dir === 'l' || dir === 'r') self.unhideColumns(orderIndex0, orderIndex1);else self.unhideRows(orderIndex0, orderIndex1);
|
|
6163
|
+
return;
|
|
6164
|
+
}
|
|
6165
|
+
|
|
5729
6166
|
var group = self.getColumnGroupAt(pos.x, pos.y);
|
|
5730
6167
|
if (!group) group = self.getRowGroupAt(pos.x, pos.y);
|
|
5731
6168
|
|
|
@@ -6145,11 +6582,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6145
6582
|
}
|
|
6146
6583
|
|
|
6147
6584
|
if (self.currentCell && self.currentCell.columnIndex !== undefined && self.dragMode === 'frozen-column-marker') {
|
|
6585
|
+
var dataWidth = self.refreshScrollCacheX();
|
|
6148
6586
|
self.scrollBox.scrollLeft = 0;
|
|
6149
6587
|
self.frozenColumn = self.currentCell.columnIndex + 1;
|
|
6150
6588
|
self.scrollBox.bar.h.x = rowHeaderCellWidth + self.scrollCache.x[self.frozenColumn - 1];
|
|
6151
|
-
self.scrollBox.box.h.x = rowHeaderCellWidth + self.scrollCache.x[self.frozenColumn - 1];
|
|
6152
|
-
|
|
6589
|
+
self.scrollBox.box.h.x = rowHeaderCellWidth + self.scrollCache.x[self.frozenColumn - 1]; // var dataWidth = self.scrollCache.x[self.scrollCache.x.length - 1];
|
|
6590
|
+
|
|
6153
6591
|
self.scrollBox.widthBoxRatio = (self.scrollBox.width - self.scrollCache.x[self.frozenColumn - 1]) / dataWidth;
|
|
6154
6592
|
self.scrollBox.scrollBoxWidth = self.scrollBox.width * self.scrollBox.widthBoxRatio - self.style.scrollBarWidth;
|
|
6155
6593
|
self.scrollBox.scrollBoxWidth = Math.max(self.scrollBox.scrollBoxWidth, self.style.scrollBarBoxMinSize);
|
|
@@ -6203,6 +6641,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6203
6641
|
move = /-move/.test(self.dragMode),
|
|
6204
6642
|
freeze = /frozen-row-marker|frozen-column-marker/.test(self.dragMode),
|
|
6205
6643
|
resize = /-resize/.test(self.dragMode);
|
|
6644
|
+
var onUnhideIndicator = self.hovers && self.hovers.unhideIndicator;
|
|
6206
6645
|
self.dragStart = overridePos || self.getLayerPos(e);
|
|
6207
6646
|
self.scrollStart = {
|
|
6208
6647
|
left: self.scrollBox.scrollLeft,
|
|
@@ -6221,7 +6660,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6221
6660
|
return;
|
|
6222
6661
|
}
|
|
6223
6662
|
|
|
6224
|
-
if (self.scrollModes.indexOf(self.dragStartObject.context) !== -1) {
|
|
6663
|
+
if (self.scrollModes.indexOf(self.dragStartObject.context) !== -1 && !onUnhideIndicator) {
|
|
6225
6664
|
self.scrollMode = self.dragStartObject.context;
|
|
6226
6665
|
self.scrollStartMode = self.dragStartObject.context;
|
|
6227
6666
|
self.scrollGrid(e);
|
|
@@ -6289,7 +6728,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
6289
6728
|
return self.mousemove(e);
|
|
6290
6729
|
}
|
|
6291
6730
|
|
|
6292
|
-
if (resize) {
|
|
6731
|
+
if (resize && !onUnhideIndicator) {
|
|
6293
6732
|
self.draggingItem = self.dragItem;
|
|
6294
6733
|
|
|
6295
6734
|
if (self.draggingItem.rowOpen) {
|
|
@@ -7070,6 +7509,90 @@ var createHTMLString = function createHTMLString(selectedData, isNeat) {
|
|
|
7070
7509
|
|
|
7071
7510
|
|
|
7072
7511
|
|
|
7512
|
+
/***/ }),
|
|
7513
|
+
|
|
7514
|
+
/***/ "./lib/groups/util.js":
|
|
7515
|
+
/*!****************************!*\
|
|
7516
|
+
!*** ./lib/groups/util.js ***!
|
|
7517
|
+
\****************************/
|
|
7518
|
+
/*! namespace exports */
|
|
7519
|
+
/*! export mergeHiddenRowRanges [provided] [no usage info] [missing usage info prevents renaming] */
|
|
7520
|
+
/*! other exports [not provided] [no usage info] */
|
|
7521
|
+
/*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
|
|
7522
|
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
7523
|
+
|
|
7524
|
+
"use strict";
|
|
7525
|
+
__webpack_require__.r(__webpack_exports__);
|
|
7526
|
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
7527
|
+
/* harmony export */ "mergeHiddenRowRanges": function() { return /* binding */ mergeHiddenRowRanges; }
|
|
7528
|
+
/* harmony export */ });
|
|
7529
|
+
|
|
7530
|
+
/**
|
|
7531
|
+
* Merge a new hidden row range into existed ranges array
|
|
7532
|
+
* @param {any[]} hiddenRowRanges tuples: Array<[bgeinRowIndex, endRowIndex]>
|
|
7533
|
+
* @param {number[]} newRange tuple: [beginRowIndex, endRowIndex]
|
|
7534
|
+
* @returns {boolean}
|
|
7535
|
+
*/
|
|
7536
|
+
|
|
7537
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
7538
|
+
|
|
7539
|
+
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."); }
|
|
7540
|
+
|
|
7541
|
+
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); }
|
|
7542
|
+
|
|
7543
|
+
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; }
|
|
7544
|
+
|
|
7545
|
+
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; }
|
|
7546
|
+
|
|
7547
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7548
|
+
|
|
7549
|
+
var mergeHiddenRowRanges = function mergeHiddenRowRanges(hiddenRowRanges, newRange) {
|
|
7550
|
+
var _newRange = _slicedToArray(newRange, 2),
|
|
7551
|
+
beginRowIndex = _newRange[0],
|
|
7552
|
+
endRowIndex = _newRange[1];
|
|
7553
|
+
|
|
7554
|
+
if (endRowIndex < beginRowIndex) return false;
|
|
7555
|
+
var inserted = false;
|
|
7556
|
+
|
|
7557
|
+
for (var i = 0; i < hiddenRowRanges.length; i++) {
|
|
7558
|
+
var range = hiddenRowRanges[i];
|
|
7559
|
+
if (beginRowIndex > range[1] + 1) continue;
|
|
7560
|
+
|
|
7561
|
+
if (beginRowIndex <= range[0] && endRowIndex >= range[0]) {
|
|
7562
|
+
hiddenRowRanges[i] = [beginRowIndex, Math.max(endRowIndex, range[1])];
|
|
7563
|
+
inserted = true;
|
|
7564
|
+
break;
|
|
7565
|
+
}
|
|
7566
|
+
|
|
7567
|
+
if (beginRowIndex >= range[0]) {
|
|
7568
|
+
hiddenRowRanges[i] = [range[0], Math.max(endRowIndex, range[1])];
|
|
7569
|
+
inserted = true;
|
|
7570
|
+
break;
|
|
7571
|
+
}
|
|
7572
|
+
}
|
|
7573
|
+
|
|
7574
|
+
if (!inserted) hiddenRowRanges.push([beginRowIndex, endRowIndex]); // merge intersections after sorting ranges
|
|
7575
|
+
|
|
7576
|
+
hiddenRowRanges.sort(function (a, b) {
|
|
7577
|
+
return a[0] - b[0];
|
|
7578
|
+
});
|
|
7579
|
+
|
|
7580
|
+
for (var _i2 = 0; _i2 < hiddenRowRanges.length - 1; _i2++) {
|
|
7581
|
+
var _range = hiddenRowRanges[_i2];
|
|
7582
|
+
var nextRange = hiddenRowRanges[_i2 + 1];
|
|
7583
|
+
|
|
7584
|
+
if (nextRange[0] <= _range[1] + 1) {
|
|
7585
|
+
hiddenRowRanges[_i2] = [_range[0], Math.max(_range[1], nextRange[1])];
|
|
7586
|
+
hiddenRowRanges.splice(_i2 + 1, 1);
|
|
7587
|
+
_i2--;
|
|
7588
|
+
}
|
|
7589
|
+
}
|
|
7590
|
+
|
|
7591
|
+
return true;
|
|
7592
|
+
};
|
|
7593
|
+
|
|
7594
|
+
|
|
7595
|
+
|
|
7073
7596
|
/***/ }),
|
|
7074
7597
|
|
|
7075
7598
|
/***/ "./lib/intf.js":
|
|
@@ -7171,6 +7694,21 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
7171
7694
|
self.scrollBox = {};
|
|
7172
7695
|
self.visibleRows = [];
|
|
7173
7696
|
self.visibleCells = [];
|
|
7697
|
+
/**
|
|
7698
|
+
* Each item of this array contains these properties:
|
|
7699
|
+
* - `x`, `y`, `x2`, `y2`
|
|
7700
|
+
* - `orderIndex0`, `orderIndex1`: The closed interval of the hiding rows/columns.
|
|
7701
|
+
* - `dir`: The directon of the unhide indicator. 'l' and 'r' for columns, 't' and 'b' for rows
|
|
7702
|
+
*/
|
|
7703
|
+
|
|
7704
|
+
self.visibleUnhideIndicators = [];
|
|
7705
|
+
/**
|
|
7706
|
+
* Each item is a tuple conatins two numbers:
|
|
7707
|
+
* its type difination: Array<[beginRowIndex, endRowIndex]>
|
|
7708
|
+
* Each tuple represents a closed Interval
|
|
7709
|
+
*/
|
|
7710
|
+
|
|
7711
|
+
self.hiddenRowRanges = [];
|
|
7174
7712
|
/**
|
|
7175
7713
|
* This array stored all groups information with context for drawing,
|
|
7176
7714
|
* it is generated by drawing functions,
|
|
@@ -7832,7 +8370,23 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
7832
8370
|
// useful when emitting cell events.
|
|
7833
8371
|
var newViewData = originalData.map(function (row, originalRowIndex) {
|
|
7834
8372
|
return [row, originalRowIndex];
|
|
7835
|
-
}); //
|
|
8373
|
+
}); // Remove hidden rows here. So we can keep the bound indexes correct
|
|
8374
|
+
|
|
8375
|
+
if (self.hiddenRowRanges.length > 0) {
|
|
8376
|
+
var ranges = self.hiddenRowRanges.sort(function (a, b) {
|
|
8377
|
+
return b[1] - a[1];
|
|
8378
|
+
});
|
|
8379
|
+
|
|
8380
|
+
for (var i = 0; i < ranges.length; i++) {
|
|
8381
|
+
var _ranges$i = _slicedToArray(ranges[i], 2),
|
|
8382
|
+
beginRowIndex = _ranges$i[0],
|
|
8383
|
+
endRowIndex = _ranges$i[1];
|
|
8384
|
+
|
|
8385
|
+
var countOfRows = endRowIndex - beginRowIndex + 1;
|
|
8386
|
+
newViewData.splice(beginRowIndex, countOfRows);
|
|
8387
|
+
}
|
|
8388
|
+
} // Apply filtering
|
|
8389
|
+
|
|
7836
8390
|
|
|
7837
8391
|
var _loop = function _loop() {
|
|
7838
8392
|
var _Object$entries2$_i = _slicedToArray(_Object$entries2[_i4], 2),
|
|
@@ -7867,8 +8421,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
7867
8421
|
|
|
7868
8422
|
var collapsedGroups = [];
|
|
7869
8423
|
|
|
7870
|
-
for (var
|
|
7871
|
-
var rows = self.groupedRows[
|
|
8424
|
+
for (var _i5 = 0; _i5 < self.groupedRows.length; _i5++) {
|
|
8425
|
+
var rows = self.groupedRows[_i5];
|
|
7872
8426
|
|
|
7873
8427
|
for (var j = 0; j < rows.length; j++) {
|
|
7874
8428
|
var r = rows[j];
|
|
@@ -7885,17 +8439,17 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
7885
8439
|
var newLen = 0;
|
|
7886
8440
|
var len = collapsedGroups.length;
|
|
7887
8441
|
|
|
7888
|
-
for (var
|
|
7889
|
-
var _r = collapsedGroups[
|
|
8442
|
+
for (var _i6 = 0; _i6 < len; _i6++) {
|
|
8443
|
+
var _r = collapsedGroups[_i6];
|
|
7890
8444
|
|
|
7891
|
-
if (
|
|
8445
|
+
if (_i6 === len - 1) {
|
|
7892
8446
|
collapsedGroups[newLen++] = _r;
|
|
7893
8447
|
break;
|
|
7894
8448
|
}
|
|
7895
8449
|
|
|
7896
8450
|
var to = _r[1];
|
|
7897
8451
|
|
|
7898
|
-
var _collapsedGroups = _slicedToArray(collapsedGroups[
|
|
8452
|
+
var _collapsedGroups = _slicedToArray(collapsedGroups[_i6 + 1], 2),
|
|
7899
8453
|
from2 = _collapsedGroups[0],
|
|
7900
8454
|
to2 = _collapsedGroups[1];
|
|
7901
8455
|
|
|
@@ -7904,8 +8458,8 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
7904
8458
|
continue;
|
|
7905
8459
|
}
|
|
7906
8460
|
|
|
7907
|
-
collapsedGroups[
|
|
7908
|
-
if (to2 > to) collapsedGroups[
|
|
8461
|
+
collapsedGroups[_i6 + 1] = _r;
|
|
8462
|
+
if (to2 > to) collapsedGroups[_i6 + 1][1] = to2;
|
|
7909
8463
|
}
|
|
7910
8464
|
|
|
7911
8465
|
collapsedGroups = collapsedGroups.slice(0, newLen); //#endregion merge groups
|
|
@@ -8468,6 +9022,19 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
8468
9022
|
};
|
|
8469
9023
|
};
|
|
8470
9024
|
|
|
9025
|
+
self.unhideColumns = function (orderIndex0, orderIndex1) {
|
|
9026
|
+
var orders = self.orders.columns;
|
|
9027
|
+
var schema = self.getSchema();
|
|
9028
|
+
|
|
9029
|
+
for (var i = orderIndex0; i <= orderIndex1; i++) {
|
|
9030
|
+
var columnIndex = orders[i];
|
|
9031
|
+
var s = schema[columnIndex];
|
|
9032
|
+
if (s && s.hidden) s.hidden = false;
|
|
9033
|
+
}
|
|
9034
|
+
|
|
9035
|
+
self.refresh();
|
|
9036
|
+
};
|
|
9037
|
+
|
|
8471
9038
|
self.getDomRoot = function () {
|
|
8472
9039
|
return self.shadowRoot ? self.shadowRoot.host : self.parentNode;
|
|
8473
9040
|
};
|
|
@@ -8707,6 +9274,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
8707
9274
|
self.intf.cut = self.cut;
|
|
8708
9275
|
self.intf.paste = self.paste;
|
|
8709
9276
|
self.intf.setStyleProperty = self.setStyleProperty;
|
|
9277
|
+
self.intf.hideColumns = self.hideColumns;
|
|
9278
|
+
self.intf.hideRows = self.hideRows;
|
|
9279
|
+
self.intf.unhideRows = self.unhideRows;
|
|
8710
9280
|
Object.defineProperty(self.intf, 'defaults', {
|
|
8711
9281
|
get: function get() {
|
|
8712
9282
|
return {
|
|
@@ -9770,7 +10340,7 @@ function canvasDatagrid(args) {
|
|
|
9770
10340
|
/*! namespace exports */
|
|
9771
10341
|
/*! export default [provided] [no usage info] [missing usage info prevents renaming] */
|
|
9772
10342
|
/*! other exports [not provided] [no usage info] */
|
|
9773
|
-
/*! runtime requirements: __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
|
|
10343
|
+
/*! runtime requirements: __webpack_require__, __webpack_require__.r, __webpack_exports__, __webpack_require__.d, __webpack_require__.* */
|
|
9774
10344
|
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
|
9775
10345
|
|
|
9776
10346
|
"use strict";
|
|
@@ -9778,6 +10348,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
9778
10348
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
9779
10349
|
/* harmony export */ "default": function() { return /* export default binding */ __WEBPACK_DEFAULT_EXPORT__; }
|
|
9780
10350
|
/* harmony export */ });
|
|
10351
|
+
/* harmony import */ var _groups_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./groups/util */ "./lib/groups/util.js");
|
|
9781
10352
|
/*jslint browser: true, unparam: true, todo: true*/
|
|
9782
10353
|
|
|
9783
10354
|
/*globals define: true, MutationObserver: false, requestAnimationFrame: false, performance: false, btoa: false*/
|
|
@@ -9789,6 +10360,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
9789
10360
|
|
|
9790
10361
|
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; }
|
|
9791
10362
|
|
|
10363
|
+
|
|
9792
10364
|
/* harmony default export */ function __WEBPACK_DEFAULT_EXPORT__(self) {
|
|
9793
10365
|
/**
|
|
9794
10366
|
* Converts a integer into a letter A - ZZZZZ...
|
|
@@ -10627,6 +11199,64 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
10627
11199
|
}
|
|
10628
11200
|
}
|
|
10629
11201
|
};
|
|
11202
|
+
/**
|
|
11203
|
+
* Hide column/columns
|
|
11204
|
+
* @memberof canvasDatagrid
|
|
11205
|
+
* @name hideColumns
|
|
11206
|
+
* @param {number} beginColumnOrderIndex
|
|
11207
|
+
* @param {number} [endColumnOrderIndex]
|
|
11208
|
+
*/
|
|
11209
|
+
|
|
11210
|
+
|
|
11211
|
+
self.hideColumns = function (beginColumnOrderIndex, endColumnOrderIndex) {
|
|
11212
|
+
var schema = self.getSchema();
|
|
11213
|
+
var orders = self.orders.columns;
|
|
11214
|
+
var count = 0;
|
|
11215
|
+
if (typeof endColumnOrderIndex !== 'number') endColumnOrderIndex = beginColumnOrderIndex;
|
|
11216
|
+
|
|
11217
|
+
for (var orderIndex = beginColumnOrderIndex; orderIndex <= endColumnOrderIndex; orderIndex++) {
|
|
11218
|
+
var columnIndex = orders[orderIndex];
|
|
11219
|
+
|
|
11220
|
+
if (columnIndex >= 0 && !schema[columnIndex].hidden) {
|
|
11221
|
+
count++;
|
|
11222
|
+
schema[columnIndex].hidden = true;
|
|
11223
|
+
}
|
|
11224
|
+
}
|
|
11225
|
+
|
|
11226
|
+
if (count > 0) {
|
|
11227
|
+
self.setStorageData();
|
|
11228
|
+
setTimeout(function () {
|
|
11229
|
+
self.resize(true);
|
|
11230
|
+
}, 10);
|
|
11231
|
+
}
|
|
11232
|
+
};
|
|
11233
|
+
/**
|
|
11234
|
+
* Hide rows
|
|
11235
|
+
* @memberof canvasDatagrid
|
|
11236
|
+
* @name hideRows
|
|
11237
|
+
* @param {number} beginRowIndex
|
|
11238
|
+
* @param {number} endRowIndex
|
|
11239
|
+
*/
|
|
11240
|
+
|
|
11241
|
+
|
|
11242
|
+
self.hideRows = function (beginRowIndex, endRowIndex) {
|
|
11243
|
+
if ((0,_groups_util__WEBPACK_IMPORTED_MODULE_0__.mergeHiddenRowRanges)(self.hiddenRowRanges, [beginRowIndex, endRowIndex])) self.refresh();
|
|
11244
|
+
};
|
|
11245
|
+
/**
|
|
11246
|
+
* Unhide rows
|
|
11247
|
+
* @memberof canvasDatagrid
|
|
11248
|
+
* @name unhideRows
|
|
11249
|
+
* @param {number} beginRowIndex
|
|
11250
|
+
* @param {number} endRowIndex
|
|
11251
|
+
*/
|
|
11252
|
+
|
|
11253
|
+
|
|
11254
|
+
self.unhideRows = function (beginRowIndex, endRowIndex) {
|
|
11255
|
+
self.hiddenRowRanges = self.hiddenRowRanges.filter(function (range) {
|
|
11256
|
+
return range[0] !== beginRowIndex || range[1] !== endRowIndex;
|
|
11257
|
+
});
|
|
11258
|
+
self.refresh();
|
|
11259
|
+
};
|
|
10630
11260
|
/**
|
|
10631
11261
|
* Resizes a column to fit the longest value in the column. Call without a value to resize all columns.
|
|
10632
11262
|
* Warning, can be slow on very large record sets (1m records ~3-5 seconds on an i7).
|
|
@@ -11287,6 +11917,25 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11287
11917
|
return c.columnIndex === x && c.rowIndex === y;
|
|
11288
11918
|
})[0];
|
|
11289
11919
|
};
|
|
11920
|
+
/**
|
|
11921
|
+
* Get an unhide indicator at grid pixel coordinate x and y.
|
|
11922
|
+
* @memberof canvasDatagrid
|
|
11923
|
+
* @name getUnhideIndicator
|
|
11924
|
+
* @method
|
|
11925
|
+
* @param {number} x Number of pixels from the left.
|
|
11926
|
+
* @param {number} y Number of pixels from the top.
|
|
11927
|
+
*/
|
|
11928
|
+
|
|
11929
|
+
|
|
11930
|
+
self.getUnhideIndicator = function (x, y) {
|
|
11931
|
+
var indicators = self.visibleUnhideIndicators;
|
|
11932
|
+
if (indicators.length <= 0) return;
|
|
11933
|
+
|
|
11934
|
+
for (var i = 0; i < indicators.length; i++) {
|
|
11935
|
+
var indicator = indicators[i];
|
|
11936
|
+
if (x >= indicator.x && y >= indicator.y && x <= indicator.x2 && y <= indicator.y2) return indicator;
|
|
11937
|
+
}
|
|
11938
|
+
};
|
|
11290
11939
|
/**
|
|
11291
11940
|
* Get a column group at grid pixel coordinate x and y.
|
|
11292
11941
|
* @memberof canvasDatagrid
|
|
@@ -11699,7 +12348,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11699
12348
|
}
|
|
11700
12349
|
|
|
11701
12350
|
self.ctx.font = self.style.columnHeaderCellFont;
|
|
11702
|
-
var t = self.ctx.measureText(col.title || col.name).width + self.style.
|
|
12351
|
+
var t = self.ctx.measureText(col.title || col.name).width + self.style.columnHeaderCellPaddingRight + self.style.columnHeaderCellPaddingLeft + self.style.cellAutoResizePadding;
|
|
11703
12352
|
m = t > m ? t : m;
|
|
11704
12353
|
formatter = self.formatters[col.type];
|
|
11705
12354
|
});
|