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
@@ -4,6 +4,7 @@ exports.__esModule = true;
4
4
  require("core-js/modules/es.array.push.js");
5
5
  var _event = _interopRequireDefault(require("../event"));
6
6
  var _overlays = _interopRequireDefault(require("../overlays"));
7
+ var _overlay = require("../overlay");
7
8
  var _settings = _interopRequireDefault(require("../settings"));
8
9
  var _master = _interopRequireDefault(require("../table/master"));
9
10
  var _viewport = _interopRequireDefault(require("../viewport"));
@@ -55,6 +56,21 @@ class Walkontable extends _base.default {
55
56
  (0, _element.addClass)(this.wtTable.wtRootElement.parentNode, newClassNames);
56
57
  }
57
58
 
59
+ /**
60
+ * Gets the overlay instance by its name.
61
+ *
62
+ * @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'} overlayName The overlay name.
63
+ * @returns {Overlay | null}
64
+ */
65
+ getOverlayByName(overlayName) {
66
+ var _this$wtOverlays;
67
+ if (!_overlay.CLONE_TYPES.includes(overlayName)) {
68
+ return null;
69
+ }
70
+ const camelCaseOverlay = overlayName.replace(/_([a-z])/g, match => match[1].toUpperCase());
71
+ return (_this$wtOverlays = this.wtOverlays[`${camelCaseOverlay}Overlay`]) !== null && _this$wtOverlays !== void 0 ? _this$wtOverlays : null;
72
+ }
73
+
58
74
  /**
59
75
  * @returns {ViewportDao}
60
76
  */
@@ -1,6 +1,7 @@
1
1
  import "core-js/modules/es.array.push.js";
2
2
  import Event from "../event.mjs";
3
3
  import Overlays from "../overlays.mjs";
4
+ import { CLONE_TYPES } from "../overlay/index.mjs";
4
5
  import Settings from "../settings.mjs";
5
6
  import MasterTable from "../table/master.mjs";
6
7
  import Viewport from "../viewport.mjs";
@@ -51,6 +52,21 @@ export default class Walkontable extends CoreAbstract {
51
52
  addClass(this.wtTable.wtRootElement.parentNode, newClassNames);
52
53
  }
53
54
 
55
+ /**
56
+ * Gets the overlay instance by its name.
57
+ *
58
+ * @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'} overlayName The overlay name.
59
+ * @returns {Overlay | null}
60
+ */
61
+ getOverlayByName(overlayName) {
62
+ var _this$wtOverlays;
63
+ if (!CLONE_TYPES.includes(overlayName)) {
64
+ return null;
65
+ }
66
+ const camelCaseOverlay = overlayName.replace(/_([a-z])/g, match => match[1].toUpperCase());
67
+ return (_this$wtOverlays = this.wtOverlays[`${camelCaseOverlay}Overlay`]) !== null && _this$wtOverlays !== void 0 ? _this$wtOverlays : null;
68
+ }
69
+
54
70
  /**
55
71
  * @returns {ViewportDao}
56
72
  */
@@ -137,6 +137,9 @@ class WalkontableFacade {
137
137
  getOverlayName() {
138
138
  return this._wot.cloneOverlay ? this._wot.cloneOverlay.type : 'master';
139
139
  }
140
+ getOverlayByName(overlayName) {
141
+ return this._wot.getOverlayByName(overlayName);
142
+ }
140
143
  exportSettingsAsClassNames() {
141
144
  return this._wot.exportSettingsAsClassNames();
142
145
  }
@@ -133,6 +133,9 @@ export default class WalkontableFacade {
133
133
  getOverlayName() {
134
134
  return this._wot.cloneOverlay ? this._wot.cloneOverlay.type : 'master';
135
135
  }
136
+ getOverlayByName(overlayName) {
137
+ return this._wot.getOverlayByName(overlayName);
138
+ }
136
139
  exportSettingsAsClassNames() {
137
140
  return this._wot.exportSettingsAsClassNames();
138
141
  }
@@ -48,6 +48,17 @@ class Renderer {
48
48
  this.renderer.setAxisUtils(rowUtils, columnUtils);
49
49
  }
50
50
 
51
+ /**
52
+ * Sets the overlay that is currently rendered. If `null` is provided, the master overlay is set.
53
+ *
54
+ * @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'} overlayName The overlay name.
55
+ * @returns {Renderer}
56
+ */
57
+ setActiveOverlayName(overlayName) {
58
+ this.renderer.setActiveOverlayName(overlayName);
59
+ return this;
60
+ }
61
+
51
62
  /**
52
63
  * Sets filter calculators for newly calculated row and column position. The filters are used to transform visual
53
64
  * indexes (0 to N) to source indexes provided by Handsontable.
@@ -38,6 +38,17 @@ class Renderer {
38
38
  this.renderer.setAxisUtils(rowUtils, columnUtils);
39
39
  }
40
40
 
41
+ /**
42
+ * Sets the overlay that is currently rendered. If `null` is provided, the master overlay is set.
43
+ *
44
+ * @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'} overlayName The overlay name.
45
+ * @returns {Renderer}
46
+ */
47
+ setActiveOverlayName(overlayName) {
48
+ this.renderer.setActiveOverlayName(overlayName);
49
+ return this;
50
+ }
51
+
41
52
  /**
42
53
  * Sets filter calculators for newly calculated row and column position. The filters are used to transform visual
43
54
  * indexes (0 to N) to source indexes provided by Handsontable.
@@ -162,11 +162,26 @@ class TableRenderer {
162
162
  * @type {Function}
163
163
  */
164
164
  _defineProperty(this, "cellRenderer", void 0);
165
+ /**
166
+ * Holds the name of the currently active overlay.
167
+ *
168
+ * @type {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'}
169
+ */
170
+ _defineProperty(this, "activeOverlayName", void 0);
165
171
  this.rootNode = rootNode;
166
172
  this.rootDocument = this.rootNode.ownerDocument;
167
173
  this.cellRenderer = cellRenderer;
168
174
  }
169
175
 
176
+ /**
177
+ * Sets the overlay that is currently rendered. If `null` is provided, the master overlay is set.
178
+ *
179
+ * @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'} overlayName The overlay name.
180
+ */
181
+ setActiveOverlayName(overlayName) {
182
+ this.activeOverlayName = overlayName;
183
+ }
184
+
170
185
  /**
171
186
  * Set row and column util classes.
172
187
  *
@@ -300,7 +315,7 @@ class TableRenderer {
300
315
  const TR = rows.getRenderedNode(visibleRowIndex);
301
316
  if (TR.firstChild) {
302
317
  const sourceRowIndex = this.renderedRowToSource(visibleRowIndex);
303
- const rowHeight = this.rowUtils.getHeight(sourceRowIndex);
318
+ const rowHeight = this.rowUtils.getHeightByOverlayName(sourceRowIndex, this.activeOverlayName);
304
319
  if (rowHeight) {
305
320
  // Decrease height. 1 pixel will be "replaced" by 1px border top
306
321
  TR.firstChild.style.height = `${rowHeight - 1}px`;
@@ -159,11 +159,26 @@ export default class TableRenderer {
159
159
  * @type {Function}
160
160
  */
161
161
  _defineProperty(this, "cellRenderer", void 0);
162
+ /**
163
+ * Holds the name of the currently active overlay.
164
+ *
165
+ * @type {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'}
166
+ */
167
+ _defineProperty(this, "activeOverlayName", void 0);
162
168
  this.rootNode = rootNode;
163
169
  this.rootDocument = this.rootNode.ownerDocument;
164
170
  this.cellRenderer = cellRenderer;
165
171
  }
166
172
 
173
+ /**
174
+ * Sets the overlay that is currently rendered. If `null` is provided, the master overlay is set.
175
+ *
176
+ * @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'} overlayName The overlay name.
177
+ */
178
+ setActiveOverlayName(overlayName) {
179
+ this.activeOverlayName = overlayName;
180
+ }
181
+
167
182
  /**
168
183
  * Set row and column util classes.
169
184
  *
@@ -297,7 +312,7 @@ export default class TableRenderer {
297
312
  const TR = rows.getRenderedNode(visibleRowIndex);
298
313
  if (TR.firstChild) {
299
314
  const sourceRowIndex = this.renderedRowToSource(visibleRowIndex);
300
- const rowHeight = this.rowUtils.getHeight(sourceRowIndex);
315
+ const rowHeight = this.rowUtils.getHeightByOverlayName(sourceRowIndex, this.activeOverlayName);
301
316
  if (rowHeight) {
302
317
  // Decrease height. 1 pixel will be "replaced" by 1px border top
303
318
  TR.firstChild.style.height = `${rowHeight - 1}px`;
@@ -39,7 +39,8 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
39
39
  * @property {Option} renderAllColumns Option `renderAllColumns`.
40
40
  * @property {Option} renderAllRows Option `renderAllRows`.
41
41
  * @property {Option} rowHeaders Option `rowHeaders`.
42
- * @property {Option} rowHeight Option `,`.
42
+ * @property {Option} rowHeightOption `rowHeight`.
43
+ * @property {Option} rowHeightByOverlayName Option `rowHeightByOverlayName`.
43
44
  * @property {Option} shouldRenderBottomOverlay Option `shouldRenderBottomOverlay`.
44
45
  * @property {Option} shouldRenderInlineStartOverlay Option `shouldRenderInlineStartOverlay`.
45
46
  * @property {Option} shouldRenderTopOverlay Option `shouldRenderTopOverlay`.
@@ -183,6 +184,9 @@ class Settings {
183
184
  rowHeight() {
184
185
  // return undefined means use default size for the rendered cell content
185
186
  },
187
+ rowHeightByOverlayName() {
188
+ // return undefined means use default size for the rendered cell content
189
+ },
186
190
  defaultRowHeight: 23,
187
191
  defaultColumnWidth: 50,
188
192
  selections: null,
@@ -36,7 +36,8 @@ import { objectEach } from "../../../helpers/object.mjs";
36
36
  * @property {Option} renderAllColumns Option `renderAllColumns`.
37
37
  * @property {Option} renderAllRows Option `renderAllRows`.
38
38
  * @property {Option} rowHeaders Option `rowHeaders`.
39
- * @property {Option} rowHeight Option `,`.
39
+ * @property {Option} rowHeightOption `rowHeight`.
40
+ * @property {Option} rowHeightByOverlayName Option `rowHeightByOverlayName`.
40
41
  * @property {Option} shouldRenderBottomOverlay Option `shouldRenderBottomOverlay`.
41
42
  * @property {Option} shouldRenderInlineStartOverlay Option `shouldRenderInlineStartOverlay`.
42
43
  * @property {Option} shouldRenderTopOverlay Option `shouldRenderTopOverlay`.
@@ -178,6 +179,9 @@ export default class Settings {
178
179
  rowHeight() {
179
180
  // return undefined means use default size for the rendered cell content
180
181
  },
182
+ rowHeightByOverlayName() {
183
+ // return undefined means use default size for the rendered cell content
184
+ },
181
185
  defaultRowHeight: 23,
182
186
  defaultColumnWidth: 50,
183
187
  selections: null,
@@ -302,7 +302,7 @@ class Table {
302
302
  this.tableRenderer.setHeaderContentRenderers(rowHeaders, []);
303
303
  }
304
304
  this.resetOversizedRows();
305
- this.tableRenderer.setViewportSize(this.getRenderedRowsCount(), this.getRenderedColumnsCount()).setFilters(this.rowFilter, this.columnFilter).render();
305
+ this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(), this.getRenderedColumnsCount()).setFilters(this.rowFilter, this.columnFilter).render();
306
306
  let workspaceWidth;
307
307
  if (this.isMaster) {
308
308
  workspaceWidth = this.dataAccessObject.workspaceWidth;
@@ -298,7 +298,7 @@ class Table {
298
298
  this.tableRenderer.setHeaderContentRenderers(rowHeaders, []);
299
299
  }
300
300
  this.resetOversizedRows();
301
- this.tableRenderer.setViewportSize(this.getRenderedRowsCount(), this.getRenderedColumnsCount()).setFilters(this.rowFilter, this.columnFilter).render();
301
+ this.tableRenderer.setActiveOverlayName(this.name).setViewportSize(this.getRenderedRowsCount(), this.getRenderedColumnsCount()).setFilters(this.rowFilter, this.columnFilter).render();
302
302
  let workspaceWidth;
303
303
  if (this.isMaster) {
304
304
  workspaceWidth = this.dataAccessObject.workspaceWidth;
@@ -42,5 +42,21 @@ class RowUtils {
42
42
  }
43
43
  return height;
44
44
  }
45
+
46
+ /**
47
+ * Returns row height based on passed source index for the specified overlay type.
48
+ *
49
+ * @param {number} sourceIndex Row source index.
50
+ * @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'} overlayName The overlay name.
51
+ * @returns {number}
52
+ */
53
+ getHeightByOverlayName(sourceIndex, overlayName) {
54
+ let height = this.wtSettings.getSetting('rowHeightByOverlayName', sourceIndex, overlayName);
55
+ const oversizedHeight = this.dataAccessObject.wtViewport.oversizedRows[sourceIndex];
56
+ if (oversizedHeight !== undefined) {
57
+ height = height === undefined ? oversizedHeight : Math.max(height, oversizedHeight);
58
+ }
59
+ return height;
60
+ }
45
61
  }
46
62
  exports.default = RowUtils;
@@ -39,4 +39,20 @@ export default class RowUtils {
39
39
  }
40
40
  return height;
41
41
  }
42
+
43
+ /**
44
+ * Returns row height based on passed source index for the specified overlay type.
45
+ *
46
+ * @param {number} sourceIndex Row source index.
47
+ * @param {'inline_start'|'top'|'top_inline_start_corner'|'bottom'|'bottom_inline_start_corner'|'master'} overlayName The overlay name.
48
+ * @returns {number}
49
+ */
50
+ getHeightByOverlayName(sourceIndex, overlayName) {
51
+ let height = this.wtSettings.getSetting('rowHeightByOverlayName', sourceIndex, overlayName);
52
+ const oversizedHeight = this.dataAccessObject.wtViewport.oversizedRows[sourceIndex];
53
+ if (oversizedHeight !== undefined) {
54
+ height = height === undefined ? oversizedHeight : Math.max(height, oversizedHeight);
55
+ }
56
+ return height;
57
+ }
42
58
  }
package/base.js CHANGED
@@ -45,8 +45,8 @@ Handsontable.hooks = _pluginHooks.default.getSingleton();
45
45
  Handsontable.CellCoords = _src.CellCoords;
46
46
  Handsontable.CellRange = _src.CellRange;
47
47
  Handsontable.packageName = 'handsontable';
48
- Handsontable.buildDate = "13/06/2024 08:02:08";
49
- Handsontable.version = "0.0.0-next-69c01d0-20240613";
48
+ Handsontable.buildDate = "14/06/2024 06:27:04";
49
+ Handsontable.version = "0.0.0-next-f0353d0-20240614";
50
50
  Handsontable.languages = {
51
51
  dictionaryKeys: _registry.dictionaryKeys,
52
52
  getLanguageDictionary: _registry.getLanguageDictionary,
package/base.mjs CHANGED
@@ -35,8 +35,8 @@ Handsontable.hooks = Hooks.getSingleton();
35
35
  Handsontable.CellCoords = CellCoords;
36
36
  Handsontable.CellRange = CellRange;
37
37
  Handsontable.packageName = 'handsontable';
38
- Handsontable.buildDate = "13/06/2024 08:02:14";
39
- Handsontable.version = "0.0.0-next-69c01d0-20240613";
38
+ Handsontable.buildDate = "14/06/2024 06:27:10";
39
+ Handsontable.version = "0.0.0-next-f0353d0-20240614";
40
40
  Handsontable.languages = {
41
41
  dictionaryKeys,
42
42
  getLanguageDictionary,
package/common.d.ts CHANGED
@@ -72,3 +72,6 @@ export interface ColumnDataGetterSetterFunction {
72
72
  (row: RowObject | CellValue[]): CellValue;
73
73
  (row: RowObject | CellValue[], value: CellValue): void;
74
74
  }
75
+
76
+ export type OverlayType = 'inline_start' | 'top' | 'top_inline_start_corner' | 'bottom' |
77
+ 'bottom_inline_start_corner' | 'master';
package/core.js CHANGED
@@ -3505,12 +3505,6 @@ function Core(rootElement, userSettings) {
3505
3505
  * @returns {number}
3506
3506
  */
3507
3507
  this._getRowHeightFromSettings = function (row) {
3508
- // let cellProperties = instance.getCellMeta(row, 0);
3509
- // let height = cellProperties.height;
3510
- //
3511
- // if (height === undefined || height === tableMeta.height) {
3512
- // height = cellProperties.rowHeights;
3513
- // }
3514
3508
  let height = tableMeta.rowHeights;
3515
3509
  if (height !== undefined && height !== null) {
3516
3510
  switch (typeof height) {
package/core.mjs CHANGED
@@ -3500,12 +3500,6 @@ export default function Core(rootElement, userSettings) {
3500
3500
  * @returns {number}
3501
3501
  */
3502
3502
  this._getRowHeightFromSettings = function (row) {
3503
- // let cellProperties = instance.getCellMeta(row, 0);
3504
- // let height = cellProperties.height;
3505
- //
3506
- // if (height === undefined || height === tableMeta.height) {
3507
- // height = cellProperties.rowHeights;
3508
- // }
3509
3503
  let height = tableMeta.rowHeights;
3510
3504
  if (height !== undefined && height !== null) {
3511
3505
  switch (typeof height) {
@@ -25,8 +25,8 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-69c01d0-20240613
29
- * Release date: 11/06/2024 (built at 13/06/2024 08:02:18)
28
+ * Version: 0.0.0-next-f0353d0-20240614
29
+ * Release date: 11/06/2024 (built at 14/06/2024 06:27:14)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles
@@ -25,8 +25,8 @@
25
25
  * INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING FROM
26
26
  * USE OR INABILITY TO USE THIS SOFTWARE.
27
27
  *
28
- * Version: 0.0.0-next-69c01d0-20240613
29
- * Release date: 11/06/2024 (built at 13/06/2024 08:02:18)
28
+ * Version: 0.0.0-next-f0353d0-20240614
29
+ * Release date: 11/06/2024 (built at 14/06/2024 06:27:14)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles