handsontable 0.0.0-next-802f59c-20241024 → 0.0.0-next-627918e-20241025

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 (128) hide show
  1. package/3rdparty/walkontable/src/calculator/index.js +1 -2
  2. package/3rdparty/walkontable/src/calculator/index.mjs +2 -2
  3. package/3rdparty/walkontable/src/calculator/viewportRows.js +3 -3
  4. package/3rdparty/walkontable/src/calculator/viewportRows.mjs +3 -3
  5. package/3rdparty/walkontable/src/core/_base.js +3 -0
  6. package/3rdparty/walkontable/src/core/_base.mjs +3 -0
  7. package/3rdparty/walkontable/src/core/clone.js +1 -0
  8. package/3rdparty/walkontable/src/core/clone.mjs +1 -0
  9. package/3rdparty/walkontable/src/core/core.js +2 -0
  10. package/3rdparty/walkontable/src/core/core.mjs +2 -0
  11. package/3rdparty/walkontable/src/facade/core.js +3 -0
  12. package/3rdparty/walkontable/src/facade/core.mjs +3 -0
  13. package/3rdparty/walkontable/src/index.js +0 -1
  14. package/3rdparty/walkontable/src/index.mjs +2 -2
  15. package/3rdparty/walkontable/src/overlay/_base.js +3 -1
  16. package/3rdparty/walkontable/src/overlay/_base.mjs +3 -1
  17. package/3rdparty/walkontable/src/overlay/bottom.js +2 -2
  18. package/3rdparty/walkontable/src/overlay/bottom.mjs +2 -2
  19. package/3rdparty/walkontable/src/overlay/inlineStart.js +1 -1
  20. package/3rdparty/walkontable/src/overlay/inlineStart.mjs +1 -1
  21. package/3rdparty/walkontable/src/overlay/top.js +1 -1
  22. package/3rdparty/walkontable/src/overlay/top.mjs +1 -1
  23. package/3rdparty/walkontable/src/overlays.js +6 -7
  24. package/3rdparty/walkontable/src/overlays.mjs +6 -7
  25. package/3rdparty/walkontable/src/renderer/colGroup.js +1 -1
  26. package/3rdparty/walkontable/src/renderer/colGroup.mjs +1 -1
  27. package/3rdparty/walkontable/src/renderer/table.js +1 -1
  28. package/3rdparty/walkontable/src/renderer/table.mjs +1 -1
  29. package/3rdparty/walkontable/src/settings.js +8 -2
  30. package/3rdparty/walkontable/src/settings.mjs +8 -2
  31. package/3rdparty/walkontable/src/table.js +35 -8
  32. package/3rdparty/walkontable/src/table.mjs +35 -8
  33. package/3rdparty/walkontable/src/types.js +1 -0
  34. package/3rdparty/walkontable/src/types.mjs +1 -0
  35. package/3rdparty/walkontable/src/utils/column.js +43 -1
  36. package/3rdparty/walkontable/src/utils/column.mjs +43 -1
  37. package/3rdparty/walkontable/src/utils/columnStretching.js +197 -0
  38. package/3rdparty/walkontable/src/utils/columnStretching.mjs +193 -0
  39. package/3rdparty/walkontable/src/utils/stylesHandler.js +179 -0
  40. package/3rdparty/walkontable/src/utils/stylesHandler.mjs +175 -0
  41. package/3rdparty/walkontable/src/viewport.js +88 -66
  42. package/3rdparty/walkontable/src/viewport.mjs +89 -67
  43. package/base.js +2 -2
  44. package/base.mjs +2 -2
  45. package/core/hooks/constants.js +0 -2
  46. package/core/hooks/constants.mjs +0 -2
  47. package/core/hooks/index.d.ts +2 -2
  48. package/core.d.ts +2 -2
  49. package/core.js +18 -6
  50. package/core.mjs +18 -6
  51. package/dataMap/metaManager/metaSchema.js +17 -0
  52. package/dataMap/metaManager/metaSchema.mjs +17 -0
  53. package/dist/handsontable.css +17 -9
  54. package/dist/handsontable.full.css +17 -7
  55. package/dist/handsontable.full.js +4217 -4534
  56. package/dist/handsontable.full.min.css +5 -4
  57. package/dist/handsontable.full.min.js +26 -26
  58. package/dist/handsontable.js +3923 -4234
  59. package/dist/handsontable.min.css +5 -4
  60. package/dist/handsontable.min.js +24 -24
  61. package/editors/autocompleteEditor/autocompleteEditor.js +1 -1
  62. package/editors/autocompleteEditor/autocompleteEditor.mjs +1 -1
  63. package/editors/baseEditor/baseEditor.js +1 -1
  64. package/editors/baseEditor/baseEditor.mjs +1 -1
  65. package/editors/dateEditor/dateEditor.js +2 -0
  66. package/editors/dateEditor/dateEditor.mjs +2 -0
  67. package/editors/handsontableEditor/handsontableEditor.js +1 -1
  68. package/editors/handsontableEditor/handsontableEditor.mjs +1 -1
  69. package/editors/selectEditor/selectEditor.js +20 -9
  70. package/editors/selectEditor/selectEditor.mjs +20 -9
  71. package/editors/textEditor/textEditor.js +4 -11
  72. package/editors/textEditor/textEditor.mjs +4 -11
  73. package/helpers/mixed.js +2 -2
  74. package/helpers/mixed.mjs +2 -2
  75. package/helpers/themes.js +17 -0
  76. package/helpers/themes.mjs +13 -0
  77. package/index.d.ts +0 -7
  78. package/package.json +10 -8
  79. package/plugins/comments/commentEditor.js +8 -1
  80. package/plugins/comments/commentEditor.mjs +8 -1
  81. package/plugins/comments/comments.js +2 -2
  82. package/plugins/comments/comments.mjs +2 -2
  83. package/plugins/contextMenu/menu/menu.js +4 -4
  84. package/plugins/contextMenu/menu/menu.mjs +4 -4
  85. package/plugins/index.d.ts +0 -3
  86. package/plugins/index.js +0 -3
  87. package/plugins/index.mjs +1 -3
  88. package/plugins/manualColumnMove/manualColumnMove.js +3 -1
  89. package/plugins/manualColumnMove/manualColumnMove.mjs +3 -1
  90. package/plugins/manualColumnResize/manualColumnResize.js +12 -24
  91. package/plugins/manualColumnResize/manualColumnResize.mjs +12 -24
  92. package/plugins/manualRowMove/manualRowMove.js +1 -1
  93. package/plugins/manualRowMove/manualRowMove.mjs +1 -1
  94. package/plugins/manualRowResize/manualRowResize.js +1 -2
  95. package/plugins/manualRowResize/manualRowResize.mjs +2 -3
  96. package/plugins/mergeCells/mergeCells.js +1 -1
  97. package/plugins/mergeCells/mergeCells.mjs +1 -1
  98. package/plugins/nestedRows/ui/headers.js +3 -1
  99. package/plugins/nestedRows/ui/headers.mjs +3 -1
  100. package/settings.d.ts +1 -0
  101. package/styles/handsontable.css +1983 -0
  102. package/styles/handsontable.min.css +30 -0
  103. package/styles/ht-theme-gemini.css +706 -0
  104. package/styles/ht-theme-gemini.min.css +30 -0
  105. package/styles/ht-theme-main.css +714 -0
  106. package/styles/ht-theme-main.min.css +30 -0
  107. package/stylesManager.js +1 -0
  108. package/stylesManager.mjs +0 -0
  109. package/tableView.js +40 -39
  110. package/tableView.mjs +40 -39
  111. package/utils/autoResize.js +4 -1
  112. package/utils/autoResize.mjs +4 -1
  113. package/utils/ghostTable.js +1 -1
  114. package/utils/ghostTable.mjs +1 -1
  115. package/plugins/stretchColumns/calculator.js +0 -159
  116. package/plugins/stretchColumns/calculator.mjs +0 -155
  117. package/plugins/stretchColumns/index.d.ts +0 -1
  118. package/plugins/stretchColumns/index.js +0 -7
  119. package/plugins/stretchColumns/index.mjs +0 -1
  120. package/plugins/stretchColumns/strategies/_base.js +0 -85
  121. package/plugins/stretchColumns/strategies/_base.mjs +0 -81
  122. package/plugins/stretchColumns/strategies/all.js +0 -68
  123. package/plugins/stretchColumns/strategies/all.mjs +0 -64
  124. package/plugins/stretchColumns/strategies/last.js +0 -77
  125. package/plugins/stretchColumns/strategies/last.mjs +0 -73
  126. package/plugins/stretchColumns/stretchColumns.d.ts +0 -11
  127. package/plugins/stretchColumns/stretchColumns.js +0 -211
  128. package/plugins/stretchColumns/stretchColumns.mjs +0 -207
@@ -1,4 +1,4 @@
1
- import { getScrollbarWidth, offset, outerHeight, outerWidth } from "../../../helpers/dom/element.mjs";
1
+ import { getScrollbarWidth, getStyle, offset, outerHeight, outerWidth } from "../../../helpers/dom/element.mjs";
2
2
  import { objectEach } from "../../../helpers/object.mjs";
3
3
  import { FullyVisibleColumnsCalculationType, FullyVisibleRowsCalculationType, PartiallyVisibleColumnsCalculationType, PartiallyVisibleRowsCalculationType, RenderedAllColumnsCalculationType, RenderedAllRowsCalculationType, RenderedColumnsCalculationType, RenderedRowsCalculationType, ViewportColumnsCalculator, ViewportRowsCalculator } from "./calculator/index.mjs";
4
4
  /**
@@ -24,6 +24,7 @@ class Viewport {
24
24
  this.oversizedColumnHeaders = [];
25
25
  this.hasOversizedColumnHeadersMarked = {};
26
26
  this.clientHeight = 0;
27
+ this.containerWidth = NaN;
27
28
  this.rowHeaderWidth = NaN;
28
29
  this.rowsVisibleCalculator = null;
29
30
  this.columnsVisibleCalculator = null;
@@ -52,65 +53,55 @@ class Viewport {
52
53
  }
53
54
  return height;
54
55
  }
55
-
56
- /**
57
- * @returns {number}
58
- */
59
- getViewportHeight() {
60
- let containerHeight = this.getWorkspaceHeight();
61
- if (containerHeight === Infinity) {
62
- return containerHeight;
63
- }
64
- const columnHeaderHeight = this.getColumnHeaderHeight();
65
- if (columnHeaderHeight > 0) {
66
- containerHeight -= columnHeaderHeight;
67
- }
68
- return containerHeight;
69
- }
70
-
71
- /**
72
- * Gets the width of the table workspace (in pixels). The workspace size in the current
73
- * implementation returns the width of the table holder element including scrollbar width when
74
- * the table has defined size and the width of the window excluding scrollbar width when
75
- * the table has no defined size (the window is a scrollable container).
76
- *
77
- * This is a bug, as the method should always return stable values, always without scrollbar width.
78
- * Changing this behavior would break the column calculators, which would also need to be adjusted.
79
- *
80
- * @returns {number}
81
- */
82
56
  getWorkspaceWidth() {
57
+ const {
58
+ wtSettings
59
+ } = this;
83
60
  const {
84
61
  rootDocument,
85
62
  rootWindow
86
63
  } = this.domBindings;
87
64
  const trimmingContainer = this.dataAccessObject.inlineStartOverlayTrimmingContainer;
65
+ const docOffsetWidth = rootDocument.documentElement.offsetWidth;
66
+ const totalColumns = wtSettings.getSetting('totalColumns');
67
+ const preventOverflow = wtSettings.getSetting('preventOverflow');
68
+ const isRtl = wtSettings.getSetting('rtlMode');
69
+ const tableRect = this.wtTable.TABLE.getBoundingClientRect();
70
+ const inlineStart = isRtl ? tableRect.right - docOffsetWidth : tableRect.left;
71
+ const tableOffset = docOffsetWidth - inlineStart;
88
72
  let width;
89
- if (trimmingContainer === rootWindow) {
90
- const totalColumns = this.wtSettings.getSetting('totalColumns');
91
- width = this.wtTable.holder.offsetWidth;
92
- if (this.getRowHeaderWidth() + this.sumColumnWidths(0, totalColumns) > width) {
93
- width = rootDocument.documentElement.clientWidth;
94
- }
73
+ let overflow;
74
+ if (preventOverflow) {
75
+ return outerWidth(this.wtTable.wtRootElement);
76
+ }
77
+ if (wtSettings.getSetting('freezeOverlays')) {
78
+ width = Math.min(tableOffset, docOffsetWidth);
95
79
  } else {
96
- width = trimmingContainer.clientWidth;
80
+ width = Math.min(this.getContainerFillWidth(), tableOffset, docOffsetWidth);
97
81
  }
98
- return width;
99
- }
100
-
101
- /**
102
- * @returns {number}
103
- */
104
- getViewportWidth() {
105
- const containerWidth = this.getWorkspaceWidth();
106
- if (containerWidth === Infinity) {
107
- return containerWidth;
82
+ if (trimmingContainer === rootWindow && totalColumns > 0 && this.sumColumnWidths(0, totalColumns - 1) > width) {
83
+ // in case sum of column widths is higher than available stylesheet width, let's assume using the whole window
84
+ // otherwise continue below, which will allow stretching
85
+ // this is used in `scroll_window.html`
86
+ // TODO test me
87
+ return rootDocument.documentElement.clientWidth;
108
88
  }
109
- const rowHeaderWidth = this.getRowHeaderWidth();
110
- if (rowHeaderWidth > 0) {
111
- return containerWidth - rowHeaderWidth;
89
+ if (trimmingContainer !== rootWindow) {
90
+ overflow = getStyle(this.dataAccessObject.inlineStartOverlayTrimmingContainer, 'overflow', rootWindow);
91
+ if (overflow === 'scroll' || overflow === 'hidden' || overflow === 'auto') {
92
+ // this is used in `scroll.html`
93
+ // TODO test me
94
+ return Math.max(width, trimmingContainer.clientWidth);
95
+ }
112
96
  }
113
- return containerWidth;
97
+ const stretchSetting = wtSettings.getSetting('stretchH');
98
+ if (stretchSetting === 'none' || !stretchSetting) {
99
+ // if no stretching is used, return the maximum used workspace width
100
+ return Math.max(width, outerWidth(this.wtTable.TABLE));
101
+ }
102
+
103
+ // if stretching is used, return the actual container width, so the columns can fit inside it
104
+ return width;
114
105
  }
115
106
 
116
107
  /**
@@ -131,24 +122,6 @@ class Viewport {
131
122
  return this.wtTable.hider.offsetWidth > this.getWorkspaceWidth();
132
123
  }
133
124
 
134
- /**
135
- * Checks if the table uses the window as a viewport and if there is a vertical scrollbar.
136
- *
137
- * @returns {boolean}
138
- */
139
- isVerticallyScrollableByWindow() {
140
- return this.dataAccessObject.topOverlayTrimmingContainer === this.domBindings.rootWindow;
141
- }
142
-
143
- /**
144
- * Checks if the table uses the window as a viewport and if there is a horizontal scrollbar.
145
- *
146
- * @returns {boolean}
147
- */
148
- isHorizontallyScrollableByWindow() {
149
- return this.dataAccessObject.inlineStartOverlayTrimmingContainer === this.domBindings.rootWindow;
150
- }
151
-
152
125
  /**
153
126
  * @param {number} from The visual column index from the width sum is start calculated.
154
127
  * @param {number} length The length of the column to traverse.
@@ -164,6 +137,24 @@ class Viewport {
164
137
  return sum;
165
138
  }
166
139
 
140
+ /**
141
+ * @returns {number}
142
+ */
143
+ getContainerFillWidth() {
144
+ if (this.containerWidth) {
145
+ return this.containerWidth;
146
+ }
147
+ const mainContainer = this.wtTable.holder;
148
+ const dummyElement = this.domBindings.rootDocument.createElement('div');
149
+ dummyElement.style.width = '100%';
150
+ dummyElement.style.height = '1px';
151
+ mainContainer.appendChild(dummyElement);
152
+ const fillWidth = dummyElement.offsetWidth;
153
+ this.containerWidth = fillWidth;
154
+ mainContainer.removeChild(dummyElement);
155
+ return fillWidth;
156
+ }
157
+
167
158
  /**
168
159
  * @returns {number}
169
160
  */
@@ -184,6 +175,21 @@ class Viewport {
184
175
  return this.columnHeaderHeight;
185
176
  }
186
177
 
178
+ /**
179
+ * @returns {number}
180
+ */
181
+ getViewportHeight() {
182
+ let containerHeight = this.getWorkspaceHeight();
183
+ if (containerHeight === Infinity) {
184
+ return containerHeight;
185
+ }
186
+ const columnHeaderHeight = this.getColumnHeaderHeight();
187
+ if (columnHeaderHeight > 0) {
188
+ containerHeight -= columnHeaderHeight;
189
+ }
190
+ return containerHeight;
191
+ }
192
+
187
193
  /**
188
194
  * @returns {number}
189
195
  */
@@ -218,6 +224,21 @@ class Viewport {
218
224
  return this.rowHeaderWidth;
219
225
  }
220
226
 
227
+ /**
228
+ * @returns {number}
229
+ */
230
+ getViewportWidth() {
231
+ const containerWidth = this.getWorkspaceWidth();
232
+ if (containerWidth === Infinity) {
233
+ return containerWidth;
234
+ }
235
+ const rowHeaderWidth = this.getRowHeaderWidth();
236
+ if (rowHeaderWidth > 0) {
237
+ return containerWidth - rowHeaderWidth;
238
+ }
239
+ return containerWidth;
240
+ }
241
+
221
242
  /**
222
243
  * Creates rows calculators. The type of the calculations can be chosen from the list:
223
244
  * - 'rendered' Calculates rows that should be rendered within the current table's viewport;
@@ -260,6 +281,7 @@ class Viewport {
260
281
  viewportHeight: height,
261
282
  scrollOffset: pos,
262
283
  totalRows: wtSettings.getSetting('totalRows'),
284
+ defaultRowHeight: this.instance.stylesHandler.getDefaultRowHeight(),
263
285
  rowHeightFn: sourceRow => wtTable.getRowHeight(sourceRow),
264
286
  overrideFn: wtSettings.getSettingPure('viewportRowCalculatorOverride'),
265
287
  horizontalScrollbarHeight: scrollbarHeight
package/base.js CHANGED
@@ -45,8 +45,8 @@ Handsontable.hooks = _hooks.Hooks.getSingleton();
45
45
  Handsontable.CellCoords = _src.CellCoords;
46
46
  Handsontable.CellRange = _src.CellRange;
47
47
  Handsontable.packageName = 'handsontable';
48
- Handsontable.buildDate = "24/10/2024 07:23:05";
49
- Handsontable.version = "0.0.0-next-802f59c-20241024";
48
+ Handsontable.buildDate = "25/10/2024 06:41:23";
49
+ Handsontable.version = "0.0.0-next-627918e-20241025";
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 = "24/10/2024 07:23:11";
39
- Handsontable.version = "0.0.0-next-802f59c-20241024";
38
+ Handsontable.buildDate = "25/10/2024 06:41:28";
39
+ Handsontable.version = "0.0.0-next-627918e-20241025";
40
40
  Handsontable.languages = {
41
41
  dictionaryKeys,
42
42
  getLanguageDictionary,
@@ -1368,7 +1368,6 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
1368
1368
  * @event Hooks#modifyColWidth
1369
1369
  * @param {number} width Current column width.
1370
1370
  * @param {number} column Visual column index.
1371
- * @param {string} [source] String that identifies source of hook call.
1372
1371
  */
1373
1372
  'modifyColWidth',
1374
1373
  /**
@@ -1405,7 +1404,6 @@ const REGISTERED_HOOKS = exports.REGISTERED_HOOKS = [/* eslint-disable jsdoc/req
1405
1404
  * @event Hooks#modifyRowHeight
1406
1405
  * @param {number} height Row height.
1407
1406
  * @param {number} row Visual row index.
1408
- * @param {string} [source] String that identifies source of hook call.
1409
1407
  */
1410
1408
  'modifyRowHeight',
1411
1409
  /**
@@ -1365,7 +1365,6 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
1365
1365
  * @event Hooks#modifyColWidth
1366
1366
  * @param {number} width Current column width.
1367
1367
  * @param {number} column Visual column index.
1368
- * @param {string} [source] String that identifies source of hook call.
1369
1368
  */
1370
1369
  'modifyColWidth',
1371
1370
  /**
@@ -1402,7 +1401,6 @@ export const REGISTERED_HOOKS = [/* eslint-disable jsdoc/require-description-com
1402
1401
  * @event Hooks#modifyRowHeight
1403
1402
  * @param {number} height Row height.
1404
1403
  * @param {number} row Visual row index.
1405
- * @param {string} [source] String that identifies source of hook call.
1406
1404
  */
1407
1405
  'modifyRowHeight',
1408
1406
  /**
@@ -237,7 +237,7 @@ export interface Events {
237
237
  modifyColHeader?: (column: number) => void;
238
238
  modifyColumnHeaderHeight?: () => void;
239
239
  modifyColumnHeaderValue?: (headerValue: string, visualColumnIndex: number, headerLevel: number) => void | string;
240
- modifyColWidth?: (width: number, column: number, source?: string) => void;
240
+ modifyColWidth?: (width: number, column: number) => void;
241
241
  modifyCopyableRange?: (copyableRanges: RangeType[]) => void;
242
242
  modifyFiltersMultiSelectValue?: (value: string, meta: CellProperties) => void | CellValue;
243
243
  modifyFocusedElement?: (row: number, column: number, focusedElement: HTMLElement) => void | HTMLElement;
@@ -248,7 +248,7 @@ export interface Events {
248
248
  modifyRowData?: (row: number) => void;
249
249
  modifyRowHeader?: (row: number) => void;
250
250
  modifyRowHeaderWidth?: (rowHeaderWidth: number) => void;
251
- modifyRowHeight?: (height: number, row: number, source?: string) => void | number;
251
+ modifyRowHeight?: (height: number, row: number) => void | number;
252
252
  modifyRowHeightByOverlayName?: (height: number, row: number, overlayType: OverlayType) => void | number;
253
253
  modifySourceData?: (row: number, column: number, valueHolder: { value: CellValue }, ioMode: 'get' | 'set') => void;
254
254
  modifyTransformEnd?: (delta: CellCoords) => void;
package/core.d.ts CHANGED
@@ -69,7 +69,7 @@ export default class Core {
69
69
  getColHeader(): Array<number | string>;
70
70
  getColHeader(column: number, headerLevel?: number): number | string;
71
71
  getColumnMeta(column: number): ColumnSettings;
72
- getColWidth(column: number, source?: string): number;
72
+ getColWidth(column: number): number;
73
73
  getCoords(element: Element | null): CellCoords;
74
74
  getCopyableData(row: number, column: number): string;
75
75
  getCopyableText(startRow: number, startColumn: number, endRow: number, endColumn: number): string;
@@ -99,7 +99,7 @@ export default class Core {
99
99
  getPlugin(pluginName: string): Plugins['basePlugin'];
100
100
  getRowHeader(): Array<string | number>;
101
101
  getRowHeader(row: number): string | number;
102
- getRowHeight(row: number, source?: string): number;
102
+ getRowHeight(row: number): number;
103
103
  getSchema(): RowObject;
104
104
  getSelected(): Array<[number, number, number, number]> | undefined;
105
105
  getSelectedLast(): number[] | undefined;
package/core.js CHANGED
@@ -43,6 +43,7 @@ var _index3 = require("./core/index");
43
43
  var _uniqueMap = require("./utils/dataStructures/uniqueMap");
44
44
  var _shortcuts = require("./shortcuts");
45
45
  var _shortcutContexts = require("./shortcutContexts");
46
+ var _themes = require("./helpers/themes");
46
47
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
47
48
  let activeGuid = null;
48
49
 
@@ -229,7 +230,20 @@ function Core(rootElement, userSettings) {
229
230
  this.renderCall = false;
230
231
  rootElement.insertBefore(this.container, rootElement.firstChild);
231
232
  if ((0, _rootInstance.isRootInstance)(this)) {
233
+ var _rootElement$parentNo;
232
234
  (0, _mixed._injectProductInfo)(userSettings.licenseKey, rootElement);
235
+ (0, _element.addClass)(rootElement, 'ht-wrapper');
236
+ const rootThemeClassName = (0, _themes.getThemeClassName)(rootElement.className);
237
+ if (rootThemeClassName) {
238
+ tableMeta.themeName = rootThemeClassName;
239
+ }
240
+ if (tableMeta.themeName) {
241
+ (0, _element.addClass)(rootElement, tableMeta.themeName);
242
+ }
243
+ const licenseInfo = (_rootElement$parentNo = rootElement.parentNode) === null || _rootElement$parentNo === void 0 ? void 0 : _rootElement$parentNo.querySelector('.hot-display-license-info');
244
+ if (licenseInfo) {
245
+ (0, _element.addClass)(licenseInfo, tableMeta.themeName);
246
+ }
233
247
  }
234
248
  this.guid = `ht_${(0, _string.randomString)()}`; // this is the namespace for global events
235
249
 
@@ -3494,13 +3508,12 @@ function Core(rootElement, userSettings) {
3494
3508
  * @memberof Core#
3495
3509
  * @function getColWidth
3496
3510
  * @param {number} column Visual column index.
3497
- * @param {string} [source] The source of the call.
3498
3511
  * @returns {number} Column width.
3499
3512
  * @fires Hooks#modifyColWidth
3500
3513
  */
3501
- this.getColWidth = function (column, source) {
3514
+ this.getColWidth = function (column) {
3502
3515
  let width = instance._getColWidthFromSettings(column);
3503
- width = instance.runHooks('modifyColWidth', width, column, source);
3516
+ width = instance.runHooks('modifyColWidth', width, column);
3504
3517
  if (width === undefined) {
3505
3518
  width = _src.DEFAULT_COLUMN_WIDTH;
3506
3519
  }
@@ -3560,13 +3573,12 @@ function Core(rootElement, userSettings) {
3560
3573
  * @memberof Core#
3561
3574
  * @function getRowHeight
3562
3575
  * @param {number} row A visual row index.
3563
- * @param {string} [source] The source of the call.
3564
3576
  * @returns {number|undefined} The height of the specified row, in pixels.
3565
3577
  * @fires Hooks#modifyRowHeight
3566
3578
  */
3567
- this.getRowHeight = function (row, source) {
3579
+ this.getRowHeight = function (row) {
3568
3580
  let height = instance._getRowHeightFromSettings(row);
3569
- height = instance.runHooks('modifyRowHeight', height, row, source);
3581
+ height = instance.runHooks('modifyRowHeight', height, row);
3570
3582
  return height;
3571
3583
  };
3572
3584
 
package/core.mjs CHANGED
@@ -39,6 +39,7 @@ import { installFocusCatcher, createViewportScroller } from "./core/index.mjs";
39
39
  import { createUniqueMap } from "./utils/dataStructures/uniqueMap.mjs";
40
40
  import { createShortcutManager } from "./shortcuts/index.mjs";
41
41
  import { registerAllShortcutContexts } from "./shortcutContexts/index.mjs";
42
+ import { getThemeClassName } from "./helpers/themes.mjs";
42
43
  let activeGuid = null;
43
44
 
44
45
  /**
@@ -224,7 +225,20 @@ export default function Core(rootElement, userSettings) {
224
225
  this.renderCall = false;
225
226
  rootElement.insertBefore(this.container, rootElement.firstChild);
226
227
  if (isRootInstance(this)) {
228
+ var _rootElement$parentNo;
227
229
  _injectProductInfo(userSettings.licenseKey, rootElement);
230
+ addClass(rootElement, 'ht-wrapper');
231
+ const rootThemeClassName = getThemeClassName(rootElement.className);
232
+ if (rootThemeClassName) {
233
+ tableMeta.themeName = rootThemeClassName;
234
+ }
235
+ if (tableMeta.themeName) {
236
+ addClass(rootElement, tableMeta.themeName);
237
+ }
238
+ const licenseInfo = (_rootElement$parentNo = rootElement.parentNode) === null || _rootElement$parentNo === void 0 ? void 0 : _rootElement$parentNo.querySelector('.hot-display-license-info');
239
+ if (licenseInfo) {
240
+ addClass(licenseInfo, tableMeta.themeName);
241
+ }
228
242
  }
229
243
  this.guid = `ht_${randomString()}`; // this is the namespace for global events
230
244
 
@@ -3489,13 +3503,12 @@ export default function Core(rootElement, userSettings) {
3489
3503
  * @memberof Core#
3490
3504
  * @function getColWidth
3491
3505
  * @param {number} column Visual column index.
3492
- * @param {string} [source] The source of the call.
3493
3506
  * @returns {number} Column width.
3494
3507
  * @fires Hooks#modifyColWidth
3495
3508
  */
3496
- this.getColWidth = function (column, source) {
3509
+ this.getColWidth = function (column) {
3497
3510
  let width = instance._getColWidthFromSettings(column);
3498
- width = instance.runHooks('modifyColWidth', width, column, source);
3511
+ width = instance.runHooks('modifyColWidth', width, column);
3499
3512
  if (width === undefined) {
3500
3513
  width = DEFAULT_COLUMN_WIDTH;
3501
3514
  }
@@ -3555,13 +3568,12 @@ export default function Core(rootElement, userSettings) {
3555
3568
  * @memberof Core#
3556
3569
  * @function getRowHeight
3557
3570
  * @param {number} row A visual row index.
3558
- * @param {string} [source] The source of the call.
3559
3571
  * @returns {number|undefined} The height of the specified row, in pixels.
3560
3572
  * @fires Hooks#modifyRowHeight
3561
3573
  */
3562
- this.getRowHeight = function (row, source) {
3574
+ this.getRowHeight = function (row) {
3563
3575
  let height = instance._getRowHeightFromSettings(row);
3564
- height = instance.runHooks('modifyRowHeight', height, row, source);
3576
+ height = instance.runHooks('modifyRowHeight', height, row);
3565
3577
  return height;
3566
3578
  };
3567
3579
 
@@ -4313,6 +4313,23 @@ var _default = () => {
4313
4313
  * ```
4314
4314
  */
4315
4315
  tableClassName: undefined,
4316
+ // TODO: add themeName description
4317
+ /**
4318
+ * The `themeName` option lets you add CSS class names
4319
+ *
4320
+ * @memberof Options#
4321
+ * @type {string|string[]}
4322
+ * @default undefined
4323
+ * @category Core
4324
+ *
4325
+ * @example
4326
+ * ```js
4327
+ * // add a `ht-theme-name` CSS class name
4328
+ * // to every Handsontable instance inside the `container` element
4329
+ * themeName: 'ht-theme-name',
4330
+ * ```
4331
+ */
4332
+ themeName: undefined,
4316
4333
  /**
4317
4334
  * The `tabMoves` option configures the action of the <kbd>**Tab**</kbd> key.
4318
4335
  *
@@ -4310,6 +4310,23 @@ export default () => {
4310
4310
  * ```
4311
4311
  */
4312
4312
  tableClassName: undefined,
4313
+ // TODO: add themeName description
4314
+ /**
4315
+ * The `themeName` option lets you add CSS class names
4316
+ *
4317
+ * @memberof Options#
4318
+ * @type {string|string[]}
4319
+ * @default undefined
4320
+ * @category Core
4321
+ *
4322
+ * @example
4323
+ * ```js
4324
+ * // add a `ht-theme-name` CSS class name
4325
+ * // to every Handsontable instance inside the `container` element
4326
+ * themeName: 'ht-theme-name',
4327
+ * ```
4328
+ */
4329
+ themeName: undefined,
4313
4330
  /**
4314
4331
  * The `tabMoves` option configures the action of the <kbd>**Tab**</kbd> key.
4315
4332
  *
@@ -25,13 +25,13 @@
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-802f59c-20241024
29
- * Release date: 17/10/2024 (built at 24/10/2024 07:23:15)
28
+ * Version: 0.0.0-next-627918e-20241025
29
+ * Release date: 17/10/2024 (built at 25/10/2024 06:42:23)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles
33
33
  */
34
- .handsontable .table th, .handsontable .table td {
34
+ .handsontable .table th, .handsontable .table td {
35
35
  border-top: none;
36
36
  }
37
37
 
@@ -589,6 +589,7 @@ innerBorderBottom - Property controlled by bottom overlay
589
589
  color: #000;
590
590
  border-radius: 0;
591
591
  background-color: #FFF;
592
+ box-sizing: border-box !important;
592
593
  /*overwrite styles potentionally made by a framework*/
593
594
  }
594
595
 
@@ -603,16 +604,25 @@ innerBorderBottom - Property controlled by bottom overlay
603
604
  }
604
605
 
605
606
  .htSelectEditor {
606
- -webkit-appearance: menulist-button !important;
607
607
  position: absolute;
608
- width: auto;
609
- border: 2px solid #4b89ff;
608
+
609
+ select {
610
+ -webkit-appearance: menulist-button !important;
611
+ width: 100%;
612
+ height: 100%;
613
+ border: 2px solid #4b89ff;
614
+ box-sizing: border-box !important;
615
+ }
610
616
  }
611
617
 
612
- .htSelectEditor:focus {
618
+ .htSelectEditor select:focus {
613
619
  outline: none;
614
620
  }
615
621
 
622
+ .htSelectEditor .htAutocompleteArrow {
623
+ display: none;
624
+ }
625
+
616
626
  /*
617
627
  TextRenderer readOnly cell
618
628
  */
@@ -2056,5 +2066,3 @@ textarea.HandsontableCopyPaste {
2056
2066
  left: 0;
2057
2067
  right: unset;
2058
2068
  }
2059
-
2060
- /*# sourceMappingURL=handsontable.css.map*/
@@ -25,13 +25,13 @@
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-802f59c-20241024
29
- * Release date: 17/10/2024 (built at 24/10/2024 07:23:15)
28
+ * Version: 0.0.0-next-627918e-20241025
29
+ * Release date: 17/10/2024 (built at 25/10/2024 06:42:23)
30
30
  */
31
31
  /**
32
32
  * Fix for bootstrap styles
33
33
  */
34
- .handsontable .table th, .handsontable .table td {
34
+ .handsontable .table th, .handsontable .table td {
35
35
  border-top: none;
36
36
  }
37
37
 
@@ -589,6 +589,7 @@ innerBorderBottom - Property controlled by bottom overlay
589
589
  color: #000;
590
590
  border-radius: 0;
591
591
  background-color: #FFF;
592
+ box-sizing: border-box !important;
592
593
  /*overwrite styles potentionally made by a framework*/
593
594
  }
594
595
 
@@ -603,16 +604,25 @@ innerBorderBottom - Property controlled by bottom overlay
603
604
  }
604
605
 
605
606
  .htSelectEditor {
606
- -webkit-appearance: menulist-button !important;
607
607
  position: absolute;
608
- width: auto;
609
- border: 2px solid #4b89ff;
608
+
609
+ select {
610
+ -webkit-appearance: menulist-button !important;
611
+ width: 100%;
612
+ height: 100%;
613
+ border: 2px solid #4b89ff;
614
+ box-sizing: border-box !important;
615
+ }
610
616
  }
611
617
 
612
- .htSelectEditor:focus {
618
+ .htSelectEditor select:focus {
613
619
  outline: none;
614
620
  }
615
621
 
622
+ .htSelectEditor .htAutocompleteArrow {
623
+ display: none;
624
+ }
625
+
616
626
  /*
617
627
  TextRenderer readOnly cell
618
628
  */