handsontable 0.0.0-next-69c01d0-20240613 → 0.0.0-next-f0353d0-20240614

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of handsontable might be problematic. Click here for more details.

Files changed (47) hide show
  1. package/3rdparty/walkontable/src/core/core.js +16 -0
  2. package/3rdparty/walkontable/src/core/core.mjs +16 -0
  3. package/3rdparty/walkontable/src/facade/core.js +3 -0
  4. package/3rdparty/walkontable/src/facade/core.mjs +3 -0
  5. package/3rdparty/walkontable/src/renderer/index.js +11 -0
  6. package/3rdparty/walkontable/src/renderer/index.mjs +11 -0
  7. package/3rdparty/walkontable/src/renderer/table.js +16 -1
  8. package/3rdparty/walkontable/src/renderer/table.mjs +16 -1
  9. package/3rdparty/walkontable/src/settings.js +5 -1
  10. package/3rdparty/walkontable/src/settings.mjs +5 -1
  11. package/3rdparty/walkontable/src/table.js +1 -1
  12. package/3rdparty/walkontable/src/table.mjs +1 -1
  13. package/3rdparty/walkontable/src/utils/row.js +16 -0
  14. package/3rdparty/walkontable/src/utils/row.mjs +16 -0
  15. package/base.js +2 -2
  16. package/base.mjs +2 -2
  17. package/common.d.ts +3 -0
  18. package/core.js +0 -6
  19. package/core.mjs +0 -6
  20. package/dist/handsontable.css +2 -2
  21. package/dist/handsontable.full.css +2 -2
  22. package/dist/handsontable.full.js +504 -249
  23. package/dist/handsontable.full.min.css +2 -2
  24. package/dist/handsontable.full.min.js +80 -80
  25. package/dist/handsontable.js +504 -249
  26. package/dist/handsontable.min.css +2 -2
  27. package/dist/handsontable.min.js +14 -14
  28. package/helpers/mixed.js +1 -1
  29. package/helpers/mixed.mjs +1 -1
  30. package/package.json +1 -1
  31. package/pluginHooks.d.ts +3 -1
  32. package/pluginHooks.js +11 -0
  33. package/pluginHooks.mjs +11 -0
  34. package/plugins/mergeCells/calculations/autofill.js +1 -1
  35. package/plugins/mergeCells/calculations/autofill.mjs +1 -1
  36. package/plugins/mergeCells/cellCoords.js +61 -22
  37. package/plugins/mergeCells/cellCoords.mjs +61 -22
  38. package/plugins/mergeCells/cellsCollection.js +46 -53
  39. package/plugins/mergeCells/cellsCollection.mjs +46 -53
  40. package/plugins/mergeCells/mergeCells.js +133 -92
  41. package/plugins/mergeCells/mergeCells.mjs +134 -93
  42. package/plugins/mergeCells/renderer.js +70 -0
  43. package/plugins/mergeCells/renderer.mjs +66 -0
  44. package/tableView.js +92 -22
  45. package/tableView.mjs +92 -22
  46. package/plugins/mergeCells/utils.js +0 -28
  47. package/plugins/mergeCells/utils.mjs +0 -24
package/tableView.js CHANGED
@@ -340,7 +340,7 @@ class TableView {
340
340
  // immediate click on "holder" means click on the right side of vertical scrollbar
341
341
  const {
342
342
  holder
343
- } = this.hot.view._wt.wtTable;
343
+ } = this._wt.wtTable;
344
344
  if (next === holder) {
345
345
  const scrollbarWidth = (0, _element.getScrollbarWidth)(rootDocument);
346
346
  if (rootDocument.elementFromPoint(eventX + scrollbarWidth, eventY) !== holder || rootDocument.elementFromPoint(eventX, eventY + scrollbarWidth) !== holder) {
@@ -687,6 +687,11 @@ class TableView {
687
687
  const visualIndex = this.hot.rowIndexMapper.getVisualFromRenderableIndex(renderedRowIndex);
688
688
  return this.hot.getRowHeight(visualIndex === null ? renderedRowIndex : visualIndex);
689
689
  },
690
+ rowHeightByOverlayName: (renderedRowIndex, overlayType) => {
691
+ const visualIndex = this.hot.rowIndexMapper.getVisualFromRenderableIndex(renderedRowIndex);
692
+ const visualRowIndex = visualIndex === null ? renderedRowIndex : visualIndex;
693
+ return this.hot.runHooks('modifyRowHeightByOverlayName', this.hot.getRowHeight(visualRowIndex), visualRowIndex, overlayType);
694
+ },
690
695
  cellRenderer: (renderedRowIndex, renderedColumnIndex, TD) => {
691
696
  const [visualRowIndex, visualColumnIndex] = this.translateFromRenderableToVisualIndex(renderedRowIndex, renderedColumnIndex);
692
697
 
@@ -1015,7 +1020,7 @@ class TableView {
1015
1020
  if ((0, _element.isInput)(el)) {
1016
1021
  return true;
1017
1022
  }
1018
- const isChildOfTableBody = (0, _element.isChildOf)(el, this.hot.view._wt.wtTable.spreader);
1023
+ const isChildOfTableBody = (0, _element.isChildOf)(el, this._wt.wtTable.spreader);
1019
1024
  if (this.settings.fragmentSelection === true && isChildOfTableBody) {
1020
1025
  return true;
1021
1026
  }
@@ -1246,75 +1251,119 @@ class TableView {
1246
1251
  }
1247
1252
 
1248
1253
  /**
1249
- * Returns the first fully visible row in the table viewport.
1254
+ * Returns the first rendered row in the DOM (usually is not visible).
1255
+ *
1256
+ * @returns {number}
1257
+ */
1258
+ getFirstRenderedVisibleRow() {
1259
+ return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedRow());
1260
+ }
1261
+
1262
+ /**
1263
+ * Returns the last rendered row in the DOM (usually is not visible).
1264
+ *
1265
+ * @returns {number}
1266
+ */
1267
+ getLastRenderedVisibleRow() {
1268
+ return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedRow());
1269
+ }
1270
+
1271
+ /**
1272
+ * Returns the first rendered column in the DOM (usually is not visible).
1273
+ *
1274
+ * @returns {number}
1275
+ */
1276
+ getFirstRenderedVisibleColumn() {
1277
+ return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedColumn());
1278
+ }
1279
+
1280
+ /**
1281
+ * Returns the last rendered column in the DOM (usually is not visible).
1282
+ *
1283
+ * @returns {number}
1284
+ */
1285
+ getLastRenderedVisibleColumn() {
1286
+ return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedColumn());
1287
+ }
1288
+
1289
+ /**
1290
+ * Returns the first fully visible row in the table viewport. When the table has overlays the method returns
1291
+ * the first row of the master table that is not overlapped by overlay.
1250
1292
  *
1251
1293
  * @returns {number}
1252
1294
  */
1253
1295
  getFirstFullyVisibleRow() {
1254
- return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstVisibleRow());
1296
+ return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleRow());
1255
1297
  }
1256
1298
 
1257
1299
  /**
1258
- * Returns the last fully visible row in the table viewport.
1300
+ * Returns the last fully visible row in the table viewport. When the table has overlays the method returns
1301
+ * the first row of the master table that is not overlapped by overlay.
1259
1302
  *
1260
1303
  * @returns {number}
1261
1304
  */
1262
1305
  getLastFullyVisibleRow() {
1263
- return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastVisibleRow());
1306
+ return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleRow());
1264
1307
  }
1265
1308
 
1266
1309
  /**
1267
- * Returns the first fully visible column in the table viewport.
1310
+ * Returns the first fully visible column in the table viewport. When the table has overlays the method returns
1311
+ * the first row of the master table that is not overlapped by overlay.
1268
1312
  *
1269
1313
  * @returns {number}
1270
1314
  */
1271
1315
  getFirstFullyVisibleColumn() {
1272
- return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstVisibleColumn());
1316
+ return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleColumn());
1273
1317
  }
1274
1318
 
1275
1319
  /**
1276
- * Returns the last fully visible column in the table viewport.
1320
+ * Returns the last fully visible column in the table viewport. When the table has overlays the method returns
1321
+ * the first row of the master table that is not overlapped by overlay.
1277
1322
  *
1278
1323
  * @returns {number}
1279
1324
  */
1280
1325
  getLastFullyVisibleColumn() {
1281
- return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastVisibleColumn());
1326
+ return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleColumn());
1282
1327
  }
1283
1328
 
1284
1329
  /**
1285
- * Returns the first partially visible row in the table viewport.
1330
+ * Returns the first partially visible row in the table viewport. When the table has overlays the method returns
1331
+ * the first row of the master table that is not overlapped by overlay.
1286
1332
  *
1287
1333
  * @returns {number}
1288
1334
  */
1289
1335
  getFirstPartiallyVisibleRow() {
1290
- return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstPartiallyVisibleRow());
1336
+ return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleRow());
1291
1337
  }
1292
1338
 
1293
1339
  /**
1294
- * Returns the last partially visible row in the table viewport.
1340
+ * Returns the last partially visible row in the table viewport. When the table has overlays the method returns
1341
+ * the first row of the master table that is not overlapped by overlay.
1295
1342
  *
1296
1343
  * @returns {number}
1297
1344
  */
1298
1345
  getLastPartiallyVisibleRow() {
1299
- return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastPartiallyVisibleRow());
1346
+ return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleRow());
1300
1347
  }
1301
1348
 
1302
1349
  /**
1303
- * Returns the first partially visible column in the table viewport.
1350
+ * Returns the first partially visible column in the table viewport. When the table has overlays the method returns
1351
+ * the first row of the master table that is not overlapped by overlay.
1304
1352
  *
1305
1353
  * @returns {number}
1306
1354
  */
1307
1355
  getFirstPartiallyVisibleColumn() {
1308
- return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstPartiallyVisibleColumn());
1356
+ return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleColumn());
1309
1357
  }
1310
1358
 
1311
1359
  /**
1312
- * Returns the last partially visible column in the table viewport.
1360
+ * Returns the last partially visible column in the table viewport. When the table has overlays the method returns
1361
+ * the first row of the master table that is not overlapped by overlay.
1313
1362
  *
1314
1363
  * @returns {number}
1315
1364
  */
1316
1365
  getLastPartiallyVisibleColumn() {
1317
- return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastPartiallyVisibleColumn());
1366
+ return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleColumn());
1318
1367
  }
1319
1368
 
1320
1369
  /**
@@ -1343,7 +1392,7 @@ class TableView {
1343
1392
  * @returns {number}
1344
1393
  */
1345
1394
  getViewportWidth() {
1346
- return this.hot.view._wt.wtViewport.getViewportWidth();
1395
+ return this._wt.wtViewport.getViewportWidth();
1347
1396
  }
1348
1397
 
1349
1398
  /**
@@ -1352,7 +1401,7 @@ class TableView {
1352
1401
  * @returns {number}
1353
1402
  */
1354
1403
  getWorkspaceWidth() {
1355
- return this.hot.view._wt.wtViewport.getWorkspaceWidth();
1404
+ return this._wt.wtViewport.getWorkspaceWidth();
1356
1405
  }
1357
1406
 
1358
1407
  /**
@@ -1363,7 +1412,7 @@ class TableView {
1363
1412
  * @returns {number}
1364
1413
  */
1365
1414
  getViewportHeight() {
1366
- return this.hot.view._wt.wtViewport.getViewportHeight();
1415
+ return this._wt.wtViewport.getViewportHeight();
1367
1416
  }
1368
1417
 
1369
1418
  /**
@@ -1372,7 +1421,28 @@ class TableView {
1372
1421
  * @returns {number}
1373
1422
  */
1374
1423
  getWorkspaceHeight() {
1375
- return this.hot.view._wt.wtViewport.getWorkspaceHeight();
1424
+ return this._wt.wtViewport.getWorkspaceHeight();
1425
+ }
1426
+
1427
+ /**
1428
+ * Checks to what overlay the provided element belongs.
1429
+ *
1430
+ * @param {HTMLElement} element The DOM element to check.
1431
+ * @returns {'master'|'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'}
1432
+ */
1433
+ getElementOverlayName(element) {
1434
+ var _this$_wt$wtOverlays$;
1435
+ return ((_this$_wt$wtOverlays$ = this._wt.wtOverlays.getParentOverlay(element)) !== null && _this$_wt$wtOverlays$ !== void 0 ? _this$_wt$wtOverlays$ : this._wt).wtTable.name;
1436
+ }
1437
+
1438
+ /**
1439
+ * Gets the overlay instance by its name.
1440
+ *
1441
+ * @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'} overlayName The overlay name.
1442
+ * @returns {Overlay | null}
1443
+ */
1444
+ getOverlayByName(overlayName) {
1445
+ return this._wt.getOverlayByName(overlayName);
1376
1446
  }
1377
1447
  /**
1378
1448
  * Destroys internal WalkOnTable's instance. Detaches all of the bonded listeners.
package/tableView.mjs CHANGED
@@ -336,7 +336,7 @@ class TableView {
336
336
  // immediate click on "holder" means click on the right side of vertical scrollbar
337
337
  const {
338
338
  holder
339
- } = this.hot.view._wt.wtTable;
339
+ } = this._wt.wtTable;
340
340
  if (next === holder) {
341
341
  const scrollbarWidth = getScrollbarWidth(rootDocument);
342
342
  if (rootDocument.elementFromPoint(eventX + scrollbarWidth, eventY) !== holder || rootDocument.elementFromPoint(eventX, eventY + scrollbarWidth) !== holder) {
@@ -683,6 +683,11 @@ class TableView {
683
683
  const visualIndex = this.hot.rowIndexMapper.getVisualFromRenderableIndex(renderedRowIndex);
684
684
  return this.hot.getRowHeight(visualIndex === null ? renderedRowIndex : visualIndex);
685
685
  },
686
+ rowHeightByOverlayName: (renderedRowIndex, overlayType) => {
687
+ const visualIndex = this.hot.rowIndexMapper.getVisualFromRenderableIndex(renderedRowIndex);
688
+ const visualRowIndex = visualIndex === null ? renderedRowIndex : visualIndex;
689
+ return this.hot.runHooks('modifyRowHeightByOverlayName', this.hot.getRowHeight(visualRowIndex), visualRowIndex, overlayType);
690
+ },
686
691
  cellRenderer: (renderedRowIndex, renderedColumnIndex, TD) => {
687
692
  const [visualRowIndex, visualColumnIndex] = this.translateFromRenderableToVisualIndex(renderedRowIndex, renderedColumnIndex);
688
693
 
@@ -1011,7 +1016,7 @@ class TableView {
1011
1016
  if (isInput(el)) {
1012
1017
  return true;
1013
1018
  }
1014
- const isChildOfTableBody = isChildOf(el, this.hot.view._wt.wtTable.spreader);
1019
+ const isChildOfTableBody = isChildOf(el, this._wt.wtTable.spreader);
1015
1020
  if (this.settings.fragmentSelection === true && isChildOfTableBody) {
1016
1021
  return true;
1017
1022
  }
@@ -1242,75 +1247,119 @@ class TableView {
1242
1247
  }
1243
1248
 
1244
1249
  /**
1245
- * Returns the first fully visible row in the table viewport.
1250
+ * Returns the first rendered row in the DOM (usually is not visible).
1251
+ *
1252
+ * @returns {number}
1253
+ */
1254
+ getFirstRenderedVisibleRow() {
1255
+ return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedRow());
1256
+ }
1257
+
1258
+ /**
1259
+ * Returns the last rendered row in the DOM (usually is not visible).
1260
+ *
1261
+ * @returns {number}
1262
+ */
1263
+ getLastRenderedVisibleRow() {
1264
+ return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedRow());
1265
+ }
1266
+
1267
+ /**
1268
+ * Returns the first rendered column in the DOM (usually is not visible).
1269
+ *
1270
+ * @returns {number}
1271
+ */
1272
+ getFirstRenderedVisibleColumn() {
1273
+ return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getFirstRenderedColumn());
1274
+ }
1275
+
1276
+ /**
1277
+ * Returns the last rendered column in the DOM (usually is not visible).
1278
+ *
1279
+ * @returns {number}
1280
+ */
1281
+ getLastRenderedVisibleColumn() {
1282
+ return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtTable.getLastRenderedColumn());
1283
+ }
1284
+
1285
+ /**
1286
+ * Returns the first fully visible row in the table viewport. When the table has overlays the method returns
1287
+ * the first row of the master table that is not overlapped by overlay.
1246
1288
  *
1247
1289
  * @returns {number}
1248
1290
  */
1249
1291
  getFirstFullyVisibleRow() {
1250
- return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstVisibleRow());
1292
+ return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleRow());
1251
1293
  }
1252
1294
 
1253
1295
  /**
1254
- * Returns the last fully visible row in the table viewport.
1296
+ * Returns the last fully visible row in the table viewport. When the table has overlays the method returns
1297
+ * the first row of the master table that is not overlapped by overlay.
1255
1298
  *
1256
1299
  * @returns {number}
1257
1300
  */
1258
1301
  getLastFullyVisibleRow() {
1259
- return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastVisibleRow());
1302
+ return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleRow());
1260
1303
  }
1261
1304
 
1262
1305
  /**
1263
- * Returns the first fully visible column in the table viewport.
1306
+ * Returns the first fully visible column in the table viewport. When the table has overlays the method returns
1307
+ * the first row of the master table that is not overlapped by overlay.
1264
1308
  *
1265
1309
  * @returns {number}
1266
1310
  */
1267
1311
  getFirstFullyVisibleColumn() {
1268
- return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstVisibleColumn());
1312
+ return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstVisibleColumn());
1269
1313
  }
1270
1314
 
1271
1315
  /**
1272
- * Returns the last fully visible column in the table viewport.
1316
+ * Returns the last fully visible column in the table viewport. When the table has overlays the method returns
1317
+ * the first row of the master table that is not overlapped by overlay.
1273
1318
  *
1274
1319
  * @returns {number}
1275
1320
  */
1276
1321
  getLastFullyVisibleColumn() {
1277
- return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastVisibleColumn());
1322
+ return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastVisibleColumn());
1278
1323
  }
1279
1324
 
1280
1325
  /**
1281
- * Returns the first partially visible row in the table viewport.
1326
+ * Returns the first partially visible row in the table viewport. When the table has overlays the method returns
1327
+ * the first row of the master table that is not overlapped by overlay.
1282
1328
  *
1283
1329
  * @returns {number}
1284
1330
  */
1285
1331
  getFirstPartiallyVisibleRow() {
1286
- return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstPartiallyVisibleRow());
1332
+ return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleRow());
1287
1333
  }
1288
1334
 
1289
1335
  /**
1290
- * Returns the last partially visible row in the table viewport.
1336
+ * Returns the last partially visible row in the table viewport. When the table has overlays the method returns
1337
+ * the first row of the master table that is not overlapped by overlay.
1291
1338
  *
1292
1339
  * @returns {number}
1293
1340
  */
1294
1341
  getLastPartiallyVisibleRow() {
1295
- return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastPartiallyVisibleRow());
1342
+ return this.hot.rowIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleRow());
1296
1343
  }
1297
1344
 
1298
1345
  /**
1299
- * Returns the first partially visible column in the table viewport.
1346
+ * Returns the first partially visible column in the table viewport. When the table has overlays the method returns
1347
+ * the first row of the master table that is not overlapped by overlay.
1300
1348
  *
1301
1349
  * @returns {number}
1302
1350
  */
1303
1351
  getFirstPartiallyVisibleColumn() {
1304
- return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getFirstPartiallyVisibleColumn());
1352
+ return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getFirstPartiallyVisibleColumn());
1305
1353
  }
1306
1354
 
1307
1355
  /**
1308
- * Returns the last partially visible column in the table viewport.
1356
+ * Returns the last partially visible column in the table viewport. When the table has overlays the method returns
1357
+ * the first row of the master table that is not overlapped by overlay.
1309
1358
  *
1310
1359
  * @returns {number}
1311
1360
  */
1312
1361
  getLastPartiallyVisibleColumn() {
1313
- return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this.hot.view._wt.wtScroll.getLastPartiallyVisibleColumn());
1362
+ return this.hot.columnIndexMapper.getVisualFromRenderableIndex(this._wt.wtScroll.getLastPartiallyVisibleColumn());
1314
1363
  }
1315
1364
 
1316
1365
  /**
@@ -1339,7 +1388,7 @@ class TableView {
1339
1388
  * @returns {number}
1340
1389
  */
1341
1390
  getViewportWidth() {
1342
- return this.hot.view._wt.wtViewport.getViewportWidth();
1391
+ return this._wt.wtViewport.getViewportWidth();
1343
1392
  }
1344
1393
 
1345
1394
  /**
@@ -1348,7 +1397,7 @@ class TableView {
1348
1397
  * @returns {number}
1349
1398
  */
1350
1399
  getWorkspaceWidth() {
1351
- return this.hot.view._wt.wtViewport.getWorkspaceWidth();
1400
+ return this._wt.wtViewport.getWorkspaceWidth();
1352
1401
  }
1353
1402
 
1354
1403
  /**
@@ -1359,7 +1408,7 @@ class TableView {
1359
1408
  * @returns {number}
1360
1409
  */
1361
1410
  getViewportHeight() {
1362
- return this.hot.view._wt.wtViewport.getViewportHeight();
1411
+ return this._wt.wtViewport.getViewportHeight();
1363
1412
  }
1364
1413
 
1365
1414
  /**
@@ -1368,7 +1417,28 @@ class TableView {
1368
1417
  * @returns {number}
1369
1418
  */
1370
1419
  getWorkspaceHeight() {
1371
- return this.hot.view._wt.wtViewport.getWorkspaceHeight();
1420
+ return this._wt.wtViewport.getWorkspaceHeight();
1421
+ }
1422
+
1423
+ /**
1424
+ * Checks to what overlay the provided element belongs.
1425
+ *
1426
+ * @param {HTMLElement} element The DOM element to check.
1427
+ * @returns {'master'|'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'}
1428
+ */
1429
+ getElementOverlayName(element) {
1430
+ var _this$_wt$wtOverlays$;
1431
+ return ((_this$_wt$wtOverlays$ = this._wt.wtOverlays.getParentOverlay(element)) !== null && _this$_wt$wtOverlays$ !== void 0 ? _this$_wt$wtOverlays$ : this._wt).wtTable.name;
1432
+ }
1433
+
1434
+ /**
1435
+ * Gets the overlay instance by its name.
1436
+ *
1437
+ * @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'} overlayName The overlay name.
1438
+ * @returns {Overlay | null}
1439
+ */
1440
+ getOverlayByName(overlayName) {
1441
+ return this._wt.getOverlayByName(overlayName);
1372
1442
  }
1373
1443
  /**
1374
1444
  * Destroys internal WalkOnTable's instance. Detaches all of the bonded listeners.
@@ -1,28 +0,0 @@
1
- "use strict";
2
-
3
- exports.__esModule = true;
4
- exports.applySpanProperties = applySpanProperties;
5
- /**
6
- * Apply the `colspan`/`rowspan` properties.
7
- *
8
- * @param {HTMLElement} TD The soon-to-be-modified cell.
9
- * @param {MergedCellCoords} mergedCellInfo The merged cell in question.
10
- * @param {number} row Row index.
11
- * @param {number} col Column index.
12
- */
13
- function applySpanProperties(TD, mergedCellInfo, row, col) {
14
- if (mergedCellInfo) {
15
- if (mergedCellInfo.row === row && mergedCellInfo.col === col) {
16
- TD.setAttribute('rowspan', mergedCellInfo.rowspan.toString());
17
- TD.setAttribute('colspan', mergedCellInfo.colspan.toString());
18
- } else {
19
- TD.removeAttribute('rowspan');
20
- TD.removeAttribute('colspan');
21
- TD.style.display = 'none';
22
- }
23
- } else {
24
- TD.removeAttribute('rowspan');
25
- TD.removeAttribute('colspan');
26
- TD.style.display = '';
27
- }
28
- }
@@ -1,24 +0,0 @@
1
- /**
2
- * Apply the `colspan`/`rowspan` properties.
3
- *
4
- * @param {HTMLElement} TD The soon-to-be-modified cell.
5
- * @param {MergedCellCoords} mergedCellInfo The merged cell in question.
6
- * @param {number} row Row index.
7
- * @param {number} col Column index.
8
- */
9
- export function applySpanProperties(TD, mergedCellInfo, row, col) {
10
- if (mergedCellInfo) {
11
- if (mergedCellInfo.row === row && mergedCellInfo.col === col) {
12
- TD.setAttribute('rowspan', mergedCellInfo.rowspan.toString());
13
- TD.setAttribute('colspan', mergedCellInfo.colspan.toString());
14
- } else {
15
- TD.removeAttribute('rowspan');
16
- TD.removeAttribute('colspan');
17
- TD.style.display = 'none';
18
- }
19
- } else {
20
- TD.removeAttribute('rowspan');
21
- TD.removeAttribute('colspan');
22
- TD.style.display = '';
23
- }
24
- }