handsontable 14.5.0-next-2d9f0a9-20240730 → 14.6.0-next-4d69faf-20240924

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. package/3rdparty/walkontable/src/renderer/rows.js +10 -0
  2. package/3rdparty/walkontable/src/renderer/rows.mjs +11 -1
  3. package/3rdparty/walkontable/src/selection/manager.js +7 -7
  4. package/3rdparty/walkontable/src/selection/manager.mjs +7 -7
  5. package/3rdparty/walkontable/src/selection/scanner.js +7 -7
  6. package/3rdparty/walkontable/src/selection/scanner.mjs +7 -7
  7. package/CHANGELOG.md +29 -0
  8. package/base.js +2 -2
  9. package/base.mjs +2 -2
  10. package/core.d.ts +13 -2
  11. package/core.js +160 -9
  12. package/core.mjs +160 -9
  13. package/dataMap/metaManager/lazyFactoryMap.js +7 -7
  14. package/dataMap/metaManager/lazyFactoryMap.mjs +7 -7
  15. package/dataMap/metaManager/metaSchema.js +5 -6
  16. package/dataMap/metaManager/metaSchema.mjs +7 -8
  17. package/dataMap/metaManager/mods/dynamicCellMeta.js +7 -7
  18. package/dataMap/metaManager/mods/dynamicCellMeta.mjs +7 -7
  19. package/dataMap/metaManager/mods/extendMetaProperties.js +7 -7
  20. package/dataMap/metaManager/mods/extendMetaProperties.mjs +7 -7
  21. package/dataMap/metaManager/utils.js +7 -7
  22. package/dataMap/metaManager/utils.mjs +7 -7
  23. package/dist/handsontable.css +3 -17
  24. package/dist/handsontable.full.css +3 -17
  25. package/dist/handsontable.full.js +3498 -3219
  26. package/dist/handsontable.full.min.css +3 -3
  27. package/dist/handsontable.full.min.js +109 -119
  28. package/dist/handsontable.js +3172 -2897
  29. package/dist/handsontable.min.css +3 -3
  30. package/dist/handsontable.min.js +19 -19
  31. package/editors/autocompleteEditor/autocompleteEditor.d.ts +1 -1
  32. package/helpers/a11y.js +2 -0
  33. package/helpers/a11y.mjs +1 -0
  34. package/helpers/array.js +7 -7
  35. package/helpers/array.mjs +7 -7
  36. package/helpers/mixed.js +2 -2
  37. package/helpers/mixed.mjs +2 -2
  38. package/helpers/number.js +7 -7
  39. package/helpers/number.mjs +7 -7
  40. package/package.json +1 -1
  41. package/pluginHooks.d.ts +1 -1
  42. package/pluginHooks.js +1 -0
  43. package/pluginHooks.mjs +1 -0
  44. package/plugins/autoRowSize/autoRowSize.js +1 -2
  45. package/plugins/autoRowSize/autoRowSize.mjs +1 -2
  46. package/plugins/columnSorting/columnSorting.js +10 -1
  47. package/plugins/columnSorting/columnSorting.mjs +10 -1
  48. package/plugins/columnSorting/utils.js +7 -7
  49. package/plugins/columnSorting/utils.mjs +7 -7
  50. package/plugins/contextMenu/contextMenu.js +7 -0
  51. package/plugins/contextMenu/contextMenu.mjs +7 -0
  52. package/plugins/contextMenu/menu/menu.js +47 -14
  53. package/plugins/contextMenu/menu/menu.mjs +48 -15
  54. package/plugins/contextMenu/menu/menuItemRenderer.js +3 -4
  55. package/plugins/contextMenu/menu/menuItemRenderer.mjs +5 -6
  56. package/plugins/contextMenu/menu/positioner.js +4 -12
  57. package/plugins/contextMenu/menu/positioner.mjs +4 -12
  58. package/plugins/contextMenu/menu/utils.js +11 -0
  59. package/plugins/contextMenu/menu/utils.mjs +10 -0
  60. package/plugins/contextMenu/predefinedItems/alignment.js +56 -49
  61. package/plugins/contextMenu/predefinedItems/alignment.mjs +57 -50
  62. package/plugins/contextMenu/predefinedItems/readOnly.js +8 -0
  63. package/plugins/contextMenu/predefinedItems/readOnly.mjs +8 -0
  64. package/plugins/contextMenu/utils.js +26 -0
  65. package/plugins/contextMenu/utils.mjs +24 -0
  66. package/plugins/copyPaste/copyPaste.js +14 -14
  67. package/plugins/copyPaste/copyPaste.mjs +14 -14
  68. package/plugins/dropdownMenu/dropdownMenu.js +10 -4
  69. package/plugins/dropdownMenu/dropdownMenu.mjs +10 -4
  70. package/plugins/filters/component/condition.js +6 -1
  71. package/plugins/filters/component/condition.mjs +6 -1
  72. package/plugins/filters/component/value.js +6 -1
  73. package/plugins/filters/component/value.mjs +6 -1
  74. package/plugins/filters/conditionCollection.d.ts +4 -3
  75. package/plugins/filters/conditionCollection.js +26 -0
  76. package/plugins/filters/conditionCollection.mjs +26 -0
  77. package/plugins/filters/filters.js +4 -1
  78. package/plugins/filters/filters.mjs +4 -1
  79. package/plugins/filters/ui/multipleSelect.js +7 -9
  80. package/plugins/filters/ui/multipleSelect.mjs +7 -9
  81. package/plugins/filters/utils.js +7 -7
  82. package/plugins/filters/utils.mjs +7 -7
  83. package/plugins/formulas/formulas.js +7 -7
  84. package/plugins/formulas/formulas.mjs +7 -7
  85. package/plugins/hiddenColumns/hiddenColumns.js +7 -7
  86. package/plugins/hiddenColumns/hiddenColumns.mjs +7 -7
  87. package/plugins/hiddenRows/hiddenRows.js +7 -7
  88. package/plugins/hiddenRows/hiddenRows.mjs +7 -7
  89. package/plugins/mergeCells/cellsCollection.js +18 -16
  90. package/plugins/mergeCells/cellsCollection.mjs +19 -17
  91. package/plugins/mergeCells/mergeCells.js +7 -7
  92. package/plugins/mergeCells/mergeCells.mjs +7 -7
  93. package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.js +7 -7
  94. package/plugins/nestedHeaders/stateManager/nodeModifiers/collapse.mjs +7 -7
  95. package/plugins/nestedHeaders/stateManager/nodeModifiers/expand.js +7 -7
  96. package/plugins/nestedHeaders/stateManager/nodeModifiers/expand.mjs +7 -7
  97. package/plugins/nestedRows/nestedRows.js +7 -7
  98. package/plugins/nestedRows/nestedRows.mjs +7 -7
  99. package/plugins/trimRows/trimRows.js +7 -7
  100. package/plugins/trimRows/trimRows.mjs +7 -7
  101. package/plugins/undoRedo/undoRedo.js +9 -5
  102. package/plugins/undoRedo/undoRedo.mjs +9 -5
  103. package/renderers/checkboxRenderer/checkboxRenderer.js +18 -6
  104. package/renderers/checkboxRenderer/checkboxRenderer.mjs +18 -6
  105. package/selection/selection.js +7 -7
  106. package/selection/selection.mjs +7 -7
  107. package/selection/utils.js +7 -7
  108. package/selection/utils.mjs +7 -7
  109. package/shortcutContexts/grid.js +10 -3
  110. package/shortcutContexts/grid.mjs +10 -3
  111. package/shortcuts/keyObserver.js +7 -7
  112. package/shortcuts/keyObserver.mjs +7 -7
  113. package/shortcuts/utils.js +3 -1
  114. package/shortcuts/utils.mjs +3 -1
  115. package/translations/changesObservable/observable.js +7 -7
  116. package/translations/changesObservable/observable.mjs +7 -7
  117. package/translations/indexMapper.js +7 -7
  118. package/translations/indexMapper.mjs +7 -7
  119. package/utils/dataStructures/uniqueSet.js +7 -7
  120. package/utils/dataStructures/uniqueSet.mjs +7 -7
  121. package/utils/ghostTable.js +11 -9
  122. package/utils/ghostTable.mjs +12 -10
  123. package/utils/paginator.js +7 -7
  124. package/utils/paginator.mjs +7 -7
@@ -2,13 +2,13 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.createKeysObserver = createKeysObserver;
5
- require("core-js/modules/esnext.set.difference.v2.js");
6
- require("core-js/modules/esnext.set.intersection.v2.js");
7
- require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
8
- require("core-js/modules/esnext.set.is-subset-of.v2.js");
9
- require("core-js/modules/esnext.set.is-superset-of.v2.js");
10
- require("core-js/modules/esnext.set.symmetric-difference.v2.js");
11
- require("core-js/modules/esnext.set.union.v2.js");
5
+ require("core-js/modules/es.set.difference.v2.js");
6
+ require("core-js/modules/es.set.intersection.v2.js");
7
+ require("core-js/modules/es.set.is-disjoint-from.v2.js");
8
+ require("core-js/modules/es.set.is-subset-of.v2.js");
9
+ require("core-js/modules/es.set.is-superset-of.v2.js");
10
+ require("core-js/modules/es.set.symmetric-difference.v2.js");
11
+ require("core-js/modules/es.set.union.v2.js");
12
12
  /* eslint-disable jsdoc/require-description-complete-sentence */
13
13
 
14
14
  /**
@@ -1,10 +1,10 @@
1
- import "core-js/modules/esnext.set.difference.v2.js";
2
- import "core-js/modules/esnext.set.intersection.v2.js";
3
- import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
4
- import "core-js/modules/esnext.set.is-subset-of.v2.js";
5
- import "core-js/modules/esnext.set.is-superset-of.v2.js";
6
- import "core-js/modules/esnext.set.symmetric-difference.v2.js";
7
- import "core-js/modules/esnext.set.union.v2.js";
1
+ import "core-js/modules/es.set.difference.v2.js";
2
+ import "core-js/modules/es.set.intersection.v2.js";
3
+ import "core-js/modules/es.set.is-disjoint-from.v2.js";
4
+ import "core-js/modules/es.set.is-subset-of.v2.js";
5
+ import "core-js/modules/es.set.is-superset-of.v2.js";
6
+ import "core-js/modules/es.set.symmetric-difference.v2.js";
7
+ import "core-js/modules/es.set.union.v2.js";
8
8
  /* eslint-disable jsdoc/require-description-complete-sentence */
9
9
 
10
10
  /**
@@ -36,7 +36,9 @@ const getKeysList = normalizedKeys => {
36
36
  return normalizedKeys.split('+');
37
37
  };
38
38
  exports.getKeysList = getKeysList;
39
- const specialCharactersSet = new Map([[186, 'semicolon'], [187, 'equal'], [188, 'comma'], [189, 'minus'], [190, 'period'], [191, 'slash'], [192, 'backquote'], [219, 'bracketleft'], [220, 'backslash'], [221, 'bracketright'], [222, 'quote']]);
39
+ const specialCharactersSet = new Map([[96, 'numpad0'], [97, 'numpad1'], [98, 'numpad2'], [99, 'numpad3'], [100, 'numpad4'], [101, 'numpad5'], [102, 'numpad6'], [103, 'numpad7'], [104, 'numpad8'], [105, 'numpad9'], [106, 'multiply'], [107, 'add'], [108, 'decimal'],
40
+ // firefox
41
+ [109, 'subtract'], [110, 'decimal'], [111, 'divide'], [112, 'f1'], [113, 'f2'], [114, 'f3'], [115, 'f4'], [116, 'f5'], [117, 'f6'], [118, 'f7'], [119, 'f8'], [120, 'f9'], [121, 'f10'], [122, 'f11'], [123, 'f12'], [186, 'semicolon'], [187, 'equal'], [188, 'comma'], [189, 'minus'], [190, 'period'], [191, 'slash'], [192, 'backquote'], [219, 'bracketleft'], [220, 'backslash'], [221, 'bracketright'], [222, 'quote']]);
40
42
 
41
43
  /**
42
44
  * Normalizes a keyboard event key value to a key before its modification.
@@ -31,7 +31,9 @@ export const normalizeKeys = keys => {
31
31
  export const getKeysList = normalizedKeys => {
32
32
  return normalizedKeys.split('+');
33
33
  };
34
- const specialCharactersSet = new Map([[186, 'semicolon'], [187, 'equal'], [188, 'comma'], [189, 'minus'], [190, 'period'], [191, 'slash'], [192, 'backquote'], [219, 'bracketleft'], [220, 'backslash'], [221, 'bracketright'], [222, 'quote']]);
34
+ const specialCharactersSet = new Map([[96, 'numpad0'], [97, 'numpad1'], [98, 'numpad2'], [99, 'numpad3'], [100, 'numpad4'], [101, 'numpad5'], [102, 'numpad6'], [103, 'numpad7'], [104, 'numpad8'], [105, 'numpad9'], [106, 'multiply'], [107, 'add'], [108, 'decimal'],
35
+ // firefox
36
+ [109, 'subtract'], [110, 'decimal'], [111, 'divide'], [112, 'f1'], [113, 'f2'], [114, 'f3'], [115, 'f4'], [116, 'f5'], [117, 'f6'], [118, 'f7'], [119, 'f8'], [120, 'f9'], [121, 'f10'], [122, 'f11'], [123, 'f12'], [186, 'semicolon'], [187, 'equal'], [188, 'comma'], [189, 'minus'], [190, 'period'], [191, 'slash'], [192, 'backquote'], [219, 'bracketleft'], [220, 'backslash'], [221, 'bracketright'], [222, 'quote']]);
35
37
 
36
38
  /**
37
39
  * Normalizes a keyboard event key value to a key before its modification.
@@ -2,13 +2,13 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
- require("core-js/modules/esnext.set.difference.v2.js");
6
- require("core-js/modules/esnext.set.intersection.v2.js");
7
- require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
8
- require("core-js/modules/esnext.set.is-subset-of.v2.js");
9
- require("core-js/modules/esnext.set.is-superset-of.v2.js");
10
- require("core-js/modules/esnext.set.symmetric-difference.v2.js");
11
- require("core-js/modules/esnext.set.union.v2.js");
5
+ require("core-js/modules/es.set.difference.v2.js");
6
+ require("core-js/modules/es.set.intersection.v2.js");
7
+ require("core-js/modules/es.set.is-disjoint-from.v2.js");
8
+ require("core-js/modules/es.set.is-subset-of.v2.js");
9
+ require("core-js/modules/es.set.is-superset-of.v2.js");
10
+ require("core-js/modules/es.set.symmetric-difference.v2.js");
11
+ require("core-js/modules/es.set.union.v2.js");
12
12
  var _observer = require("./observer");
13
13
  var _utils = require("./utils");
14
14
  function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
@@ -1,11 +1,11 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
- import "core-js/modules/esnext.set.difference.v2.js";
3
- import "core-js/modules/esnext.set.intersection.v2.js";
4
- import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
5
- import "core-js/modules/esnext.set.is-subset-of.v2.js";
6
- import "core-js/modules/esnext.set.is-superset-of.v2.js";
7
- import "core-js/modules/esnext.set.symmetric-difference.v2.js";
8
- import "core-js/modules/esnext.set.union.v2.js";
2
+ import "core-js/modules/es.set.difference.v2.js";
3
+ import "core-js/modules/es.set.intersection.v2.js";
4
+ import "core-js/modules/es.set.is-disjoint-from.v2.js";
5
+ import "core-js/modules/es.set.is-subset-of.v2.js";
6
+ import "core-js/modules/es.set.is-superset-of.v2.js";
7
+ import "core-js/modules/es.set.symmetric-difference.v2.js";
8
+ import "core-js/modules/es.set.union.v2.js";
9
9
  function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
10
10
  function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
11
11
  function _classPrivateFieldGet(s, a) { return s.get(_assertClassBrand(s, a)); }
@@ -2,13 +2,13 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  require("core-js/modules/es.error.cause.js");
5
- require("core-js/modules/esnext.set.difference.v2.js");
6
- require("core-js/modules/esnext.set.intersection.v2.js");
7
- require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
8
- require("core-js/modules/esnext.set.is-subset-of.v2.js");
9
- require("core-js/modules/esnext.set.is-superset-of.v2.js");
10
- require("core-js/modules/esnext.set.symmetric-difference.v2.js");
11
- require("core-js/modules/esnext.set.union.v2.js");
5
+ require("core-js/modules/es.set.difference.v2.js");
6
+ require("core-js/modules/es.set.intersection.v2.js");
7
+ require("core-js/modules/es.set.is-disjoint-from.v2.js");
8
+ require("core-js/modules/es.set.is-subset-of.v2.js");
9
+ require("core-js/modules/es.set.is-superset-of.v2.js");
10
+ require("core-js/modules/es.set.symmetric-difference.v2.js");
11
+ require("core-js/modules/es.set.union.v2.js");
12
12
  var _array = require("../helpers/array");
13
13
  var _maps = require("./maps");
14
14
  var _mapCollections = require("./mapCollections");
@@ -2,13 +2,13 @@ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object
2
2
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
3
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
4
  import "core-js/modules/es.error.cause.js";
5
- import "core-js/modules/esnext.set.difference.v2.js";
6
- import "core-js/modules/esnext.set.intersection.v2.js";
7
- import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
8
- import "core-js/modules/esnext.set.is-subset-of.v2.js";
9
- import "core-js/modules/esnext.set.is-superset-of.v2.js";
10
- import "core-js/modules/esnext.set.symmetric-difference.v2.js";
11
- import "core-js/modules/esnext.set.union.v2.js";
5
+ import "core-js/modules/es.set.difference.v2.js";
6
+ import "core-js/modules/es.set.intersection.v2.js";
7
+ import "core-js/modules/es.set.is-disjoint-from.v2.js";
8
+ import "core-js/modules/es.set.is-subset-of.v2.js";
9
+ import "core-js/modules/es.set.is-superset-of.v2.js";
10
+ import "core-js/modules/es.set.symmetric-difference.v2.js";
11
+ import "core-js/modules/es.set.union.v2.js";
12
12
  import { arrayMap } from "../helpers/array.mjs";
13
13
  import { createIndexMap, getListWithInsertedItems, getListWithRemovedItems, HidingMap, IndexesSequence, TrimmingMap } from "./maps/index.mjs";
14
14
  import { AggregatedCollection, MapCollection } from "./mapCollections/index.mjs";
@@ -3,13 +3,13 @@
3
3
  exports.__esModule = true;
4
4
  exports.createUniqueSet = createUniqueSet;
5
5
  require("core-js/modules/es.error.cause.js");
6
- require("core-js/modules/esnext.set.difference.v2.js");
7
- require("core-js/modules/esnext.set.intersection.v2.js");
8
- require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
9
- require("core-js/modules/esnext.set.is-subset-of.v2.js");
10
- require("core-js/modules/esnext.set.is-superset-of.v2.js");
11
- require("core-js/modules/esnext.set.symmetric-difference.v2.js");
12
- require("core-js/modules/esnext.set.union.v2.js");
6
+ require("core-js/modules/es.set.difference.v2.js");
7
+ require("core-js/modules/es.set.intersection.v2.js");
8
+ require("core-js/modules/es.set.is-disjoint-from.v2.js");
9
+ require("core-js/modules/es.set.is-subset-of.v2.js");
10
+ require("core-js/modules/es.set.is-superset-of.v2.js");
11
+ require("core-js/modules/es.set.symmetric-difference.v2.js");
12
+ require("core-js/modules/es.set.union.v2.js");
13
13
  var _function = require("../../helpers/function");
14
14
  const DEFAULT_ERROR_ITEM_EXISTS = item => `'${item}' value is already declared in a unique set.`;
15
15
 
@@ -1,11 +1,11 @@
1
1
  import "core-js/modules/es.error.cause.js";
2
- import "core-js/modules/esnext.set.difference.v2.js";
3
- import "core-js/modules/esnext.set.intersection.v2.js";
4
- import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
5
- import "core-js/modules/esnext.set.is-subset-of.v2.js";
6
- import "core-js/modules/esnext.set.is-superset-of.v2.js";
7
- import "core-js/modules/esnext.set.symmetric-difference.v2.js";
8
- import "core-js/modules/esnext.set.union.v2.js";
2
+ import "core-js/modules/es.set.difference.v2.js";
3
+ import "core-js/modules/es.set.intersection.v2.js";
4
+ import "core-js/modules/es.set.is-disjoint-from.v2.js";
5
+ import "core-js/modules/es.set.is-subset-of.v2.js";
6
+ import "core-js/modules/es.set.is-superset-of.v2.js";
7
+ import "core-js/modules/es.set.symmetric-difference.v2.js";
8
+ import "core-js/modules/es.set.union.v2.js";
9
9
  import { isFunction } from "../../helpers/function.mjs";
10
10
  const DEFAULT_ERROR_ITEM_EXISTS = item => `'${item}' value is already declared in a unique set.`;
11
11
 
@@ -148,8 +148,15 @@ class GhostTable {
148
148
  this.injectTable();
149
149
  }
150
150
  (0, _array.arrayEach)(this.rows, row => {
151
+ // In cases when the cell's content produces the height with a decimal point, the height
152
+ // needs to be rounded up to make sure that there will be a space for the cell's content.
153
+ // The `.offsetHeight` always returns the rounded number (floored), so it's not suitable for this case.
154
+ const {
155
+ height
156
+ } = row.table.getBoundingClientRect();
157
+
151
158
  // -1 <- reduce border-top from table
152
- callback(row.row, (0, _element.outerHeight)(row.table) - 1);
159
+ callback(row.row, Math.ceil(height) - 1);
153
160
  });
154
161
  }
155
162
 
@@ -163,14 +170,9 @@ class GhostTable {
163
170
  this.injectTable();
164
171
  }
165
172
  (0, _array.arrayEach)(this.columns, column => {
166
- // The GhostTable class is responsible for calculating the columns' width based on the
167
- // contents rendered in the cells. In some cases, when the column's width calculated by
168
- // the browser is a decimal point with a fractional component. For example, 35.32px.
169
- // The usage of the `.offsetWidth` (or our helper `outerWidth`) is incorrect.
170
- // The `outerWidth` in the mentioned example (35.32px) would return 35 pixels that
171
- // would cause the text to not fit in the cell, thus increasing the row height.
172
- // That's why the `getBoundingClientRect` method is used. The method returns the number
173
- // that is rounded up to make sure that there will be a space for the cell's content.
173
+ // In cases when the cell's content produces the width with a decimal point, the width
174
+ // needs to be rounded up to make sure that there will be a space for the cell's content.
175
+ // The `.offsetWidth` always returns the rounded number (floored), so it's not suitable for this case.
174
176
  const {
175
177
  width
176
178
  } = column.table.getBoundingClientRect();
@@ -3,7 +3,7 @@ import "core-js/modules/es.array.push.js";
3
3
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
4
4
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
5
5
  function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
6
- import { addClass, outerHeight } from "./../helpers/dom/element.mjs";
6
+ import { addClass } from "./../helpers/dom/element.mjs";
7
7
  import { arrayEach } from "./../helpers/array.mjs";
8
8
  /**
9
9
  * @class GhostTable
@@ -145,8 +145,15 @@ class GhostTable {
145
145
  this.injectTable();
146
146
  }
147
147
  arrayEach(this.rows, row => {
148
+ // In cases when the cell's content produces the height with a decimal point, the height
149
+ // needs to be rounded up to make sure that there will be a space for the cell's content.
150
+ // The `.offsetHeight` always returns the rounded number (floored), so it's not suitable for this case.
151
+ const {
152
+ height
153
+ } = row.table.getBoundingClientRect();
154
+
148
155
  // -1 <- reduce border-top from table
149
- callback(row.row, outerHeight(row.table) - 1);
156
+ callback(row.row, Math.ceil(height) - 1);
150
157
  });
151
158
  }
152
159
 
@@ -160,14 +167,9 @@ class GhostTable {
160
167
  this.injectTable();
161
168
  }
162
169
  arrayEach(this.columns, column => {
163
- // The GhostTable class is responsible for calculating the columns' width based on the
164
- // contents rendered in the cells. In some cases, when the column's width calculated by
165
- // the browser is a decimal point with a fractional component. For example, 35.32px.
166
- // The usage of the `.offsetWidth` (or our helper `outerWidth`) is incorrect.
167
- // The `outerWidth` in the mentioned example (35.32px) would return 35 pixels that
168
- // would cause the text to not fit in the cell, thus increasing the row height.
169
- // That's why the `getBoundingClientRect` method is used. The method returns the number
170
- // that is rounded up to make sure that there will be a space for the cell's content.
170
+ // In cases when the cell's content produces the width with a decimal point, the width
171
+ // needs to be rounded up to make sure that there will be a space for the cell's content.
172
+ // The `.offsetWidth` always returns the rounded number (floored), so it's not suitable for this case.
171
173
  const {
172
174
  width
173
175
  } = column.table.getBoundingClientRect();
@@ -2,13 +2,13 @@
2
2
 
3
3
  exports.__esModule = true;
4
4
  exports.createPaginator = createPaginator;
5
- require("core-js/modules/esnext.set.difference.v2.js");
6
- require("core-js/modules/esnext.set.intersection.v2.js");
7
- require("core-js/modules/esnext.set.is-disjoint-from.v2.js");
8
- require("core-js/modules/esnext.set.is-subset-of.v2.js");
9
- require("core-js/modules/esnext.set.is-superset-of.v2.js");
10
- require("core-js/modules/esnext.set.symmetric-difference.v2.js");
11
- require("core-js/modules/esnext.set.union.v2.js");
5
+ require("core-js/modules/es.set.difference.v2.js");
6
+ require("core-js/modules/es.set.intersection.v2.js");
7
+ require("core-js/modules/es.set.is-disjoint-from.v2.js");
8
+ require("core-js/modules/es.set.is-subset-of.v2.js");
9
+ require("core-js/modules/es.set.is-superset-of.v2.js");
10
+ require("core-js/modules/es.set.symmetric-difference.v2.js");
11
+ require("core-js/modules/es.set.union.v2.js");
12
12
  var _number = require("../helpers/number");
13
13
  /**
14
14
  * @typedef Paginator
@@ -1,10 +1,10 @@
1
- import "core-js/modules/esnext.set.difference.v2.js";
2
- import "core-js/modules/esnext.set.intersection.v2.js";
3
- import "core-js/modules/esnext.set.is-disjoint-from.v2.js";
4
- import "core-js/modules/esnext.set.is-subset-of.v2.js";
5
- import "core-js/modules/esnext.set.is-superset-of.v2.js";
6
- import "core-js/modules/esnext.set.symmetric-difference.v2.js";
7
- import "core-js/modules/esnext.set.union.v2.js";
1
+ import "core-js/modules/es.set.difference.v2.js";
2
+ import "core-js/modules/es.set.intersection.v2.js";
3
+ import "core-js/modules/es.set.is-disjoint-from.v2.js";
4
+ import "core-js/modules/es.set.is-subset-of.v2.js";
5
+ import "core-js/modules/es.set.is-superset-of.v2.js";
6
+ import "core-js/modules/es.set.symmetric-difference.v2.js";
7
+ import "core-js/modules/es.set.union.v2.js";
8
8
  import { clamp } from "../helpers/number.mjs";
9
9
  /**
10
10
  * @typedef Paginator