handsontable 14.0.0-next-dd92f79-20231124 → 14.0.0-next-88de277-20231127

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. package/3rdparty/walkontable/src/overlay/_base.js +2 -2
  2. package/3rdparty/walkontable/src/overlay/_base.mjs +2 -2
  3. package/3rdparty/walkontable/src/renderer/columnHeaders.js +1 -1
  4. package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +2 -2
  5. package/3rdparty/walkontable/src/renderer/rows.js +1 -1
  6. package/3rdparty/walkontable/src/renderer/rows.mjs +2 -2
  7. package/3rdparty/walkontable/src/selection/manager.js +20 -6
  8. package/3rdparty/walkontable/src/selection/manager.mjs +20 -6
  9. package/base.js +2 -2
  10. package/base.mjs +2 -2
  11. package/core.js +1 -1
  12. package/core.mjs +1 -1
  13. package/dataMap/replaceData.js +3 -1
  14. package/dataMap/replaceData.mjs +3 -1
  15. package/dist/handsontable.css +62 -44
  16. package/dist/handsontable.full.css +62 -44
  17. package/dist/handsontable.full.js +123 -302
  18. package/dist/handsontable.full.min.css +5 -5
  19. package/dist/handsontable.full.min.js +64 -64
  20. package/dist/handsontable.js +123 -302
  21. package/dist/handsontable.min.css +5 -5
  22. package/dist/handsontable.min.js +19 -19
  23. package/dist/languages/all.js +2 -24
  24. package/dist/languages/all.min.js +1 -1
  25. package/dist/languages/en-US.js +1 -12
  26. package/dist/languages/en-US.min.js +1 -1
  27. package/dist/languages/pl-PL.js +1 -12
  28. package/dist/languages/pl-PL.min.js +1 -1
  29. package/editors/dateEditor/dateEditor.js +0 -7
  30. package/editors/dateEditor/dateEditor.mjs +1 -8
  31. package/editors/handsontableEditor/handsontableEditor.js +0 -7
  32. package/editors/handsontableEditor/handsontableEditor.mjs +1 -8
  33. package/editors/passwordEditor/passwordEditor.js +4 -0
  34. package/editors/passwordEditor/passwordEditor.mjs +5 -1
  35. package/helpers/a11y.js +2 -2
  36. package/helpers/a11y.mjs +1 -1
  37. package/helpers/dom/element.js +0 -29
  38. package/helpers/dom/element.mjs +0 -28
  39. package/helpers/mixed.js +2 -2
  40. package/helpers/mixed.mjs +2 -2
  41. package/i18n/constants.js +1 -14
  42. package/i18n/constants.mjs +1 -14
  43. package/i18n/languages/en-US.js +1 -12
  44. package/i18n/languages/en-US.mjs +1 -12
  45. package/i18n/languages/pl-PL.js +1 -12
  46. package/i18n/languages/pl-PL.mjs +1 -12
  47. package/languages/all.js +2 -24
  48. package/languages/en-US.js +1 -12
  49. package/languages/en-US.mjs +1 -12
  50. package/languages/index.js +2 -24
  51. package/languages/pl-PL.js +1 -12
  52. package/languages/pl-PL.mjs +1 -12
  53. package/package.json +1 -1
  54. package/plugins/collapsibleColumns/collapsibleColumns.js +2 -3
  55. package/plugins/collapsibleColumns/collapsibleColumns.mjs +3 -4
  56. package/plugins/columnSorting/columnSorting.js +4 -30
  57. package/plugins/columnSorting/columnSorting.mjs +6 -32
  58. package/plugins/contextMenu/menu/menuItemRenderer.js +0 -12
  59. package/plugins/contextMenu/menu/menuItemRenderer.mjs +2 -14
  60. package/plugins/dropdownMenu/dropdownMenu.js +1 -2
  61. package/plugins/dropdownMenu/dropdownMenu.mjs +2 -3
  62. package/plugins/filters/ui/input.js +3 -0
  63. package/plugins/filters/ui/input.mjs +3 -0
  64. package/plugins/hiddenColumns/hiddenColumns.js +0 -44
  65. package/plugins/hiddenColumns/hiddenColumns.mjs +1 -45
  66. package/plugins/hiddenRows/hiddenRows.js +0 -44
  67. package/plugins/hiddenRows/hiddenRows.mjs +1 -45
  68. package/plugins/multiColumnSorting/multiColumnSorting.js +0 -21
  69. package/plugins/multiColumnSorting/multiColumnSorting.mjs +1 -22
  70. package/plugins/nestedRows/nestedRows.js +1 -2
  71. package/plugins/nestedRows/nestedRows.mjs +1 -2
  72. package/plugins/nestedRows/ui/headers.js +3 -3
  73. package/plugins/nestedRows/ui/headers.mjs +4 -4
  74. package/renderers/autocompleteRenderer/autocompleteRenderer.js +0 -3
  75. package/renderers/autocompleteRenderer/autocompleteRenderer.mjs +1 -4
  76. package/renderers/checkboxRenderer/checkboxRenderer.js +0 -1
  77. package/renderers/checkboxRenderer/checkboxRenderer.mjs +0 -1
  78. package/renderers/dateRenderer/dateRenderer.js +0 -5
  79. package/renderers/dateRenderer/dateRenderer.mjs +0 -5
  80. package/renderers/handsontableRenderer/handsontableRenderer.js +0 -5
  81. package/renderers/handsontableRenderer/handsontableRenderer.mjs +0 -5
  82. package/renderers/selectRenderer/selectRenderer.js +0 -5
  83. package/renderers/selectRenderer/selectRenderer.mjs +0 -5
  84. package/selection/highlight/types/focus.js +2 -0
  85. package/selection/highlight/types/focus.mjs +2 -0
  86. package/selection/selection.js +0 -1
  87. package/selection/selection.mjs +0 -1
  88. package/tableView.js +35 -2
  89. package/tableView.mjs +35 -2
package/tableView.mjs CHANGED
@@ -1,10 +1,12 @@
1
1
  import "core-js/modules/es.array.push.js";
2
2
  import "core-js/modules/es.error.cause.js";
3
+ function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
3
4
  function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
4
5
  function _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError("Cannot initialize the same private elements twice on an object"); } }
5
6
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
7
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
7
8
  function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
9
+ function _classPrivateMethodGet(receiver, privateSet, fn) { if (!privateSet.has(receiver)) { throw new TypeError("attempted to get private field on non-instance"); } return fn; }
8
10
  function _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "get"); return _classApplyDescriptorGet(receiver, descriptor); }
9
11
  function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }
10
12
  function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, "set"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }
@@ -28,11 +30,25 @@ var _mouseDown = /*#__PURE__*/new WeakMap();
28
30
  var _table = /*#__PURE__*/new WeakMap();
29
31
  var _lastWidth = /*#__PURE__*/new WeakMap();
30
32
  var _lastHeight = /*#__PURE__*/new WeakMap();
33
+ var _getAriaColcount = /*#__PURE__*/new WeakSet();
34
+ var _updateAriaColcount = /*#__PURE__*/new WeakSet();
31
35
  class TableView {
32
36
  /**
33
37
  * @param {Hanstontable} hotInstance Instance of {@link Handsontable}.
34
38
  */
35
39
  constructor(hotInstance) {
40
+ /**
41
+ * Update the `aria-colcount` attribute by the provided value.
42
+ *
43
+ * @param {number} delta The number of columns to add or remove to the aria tag.
44
+ */
45
+ _classPrivateMethodInitSpec(this, _updateAriaColcount);
46
+ /**
47
+ * Return the value of the `aria-colcount` attribute.
48
+ *
49
+ * @returns {number} The value of the `aria-colcount` attribute.
50
+ */
51
+ _classPrivateMethodInitSpec(this, _getAriaColcount);
36
52
  /**
37
53
  * Instance of {@link Handsontable}.
38
54
  *
@@ -269,7 +285,7 @@ class TableView {
269
285
  }
270
286
  if (this.settings.ariaTags) {
271
287
  setAttribute(_classPrivateFieldGet(this, _table), [A11Y_PRESENTATION()]);
272
- setAttribute(rootElement, [A11Y_TREEGRID(), A11Y_ROWCOUNT(this.hot.countRows()), A11Y_COLCOUNT(this.hot.countCols()), A11Y_MULTISELECTABLE()]);
288
+ setAttribute(rootElement, [A11Y_TREEGRID(), A11Y_ROWCOUNT(-1), A11Y_COLCOUNT(this.hot.countCols()), A11Y_MULTISELECTABLE()]);
273
289
  }
274
290
  this.THEAD = rootDocument.createElement('THEAD');
275
291
  _classPrivateFieldGet(this, _table).appendChild(this.THEAD);
@@ -662,6 +678,13 @@ class TableView {
662
678
  }
663
679
  this.hot.runHooks('afterGetRowHeaderRenderers', headerRenderers);
664
680
  _classPrivateFieldSet(this, _rowHeadersCount, headerRenderers.length);
681
+ if (this.hot.getSettings().ariaTags) {
682
+ // Update the aria-colcount attribute.
683
+ // Only needs to be done once after initialization/data update.
684
+ if (_classPrivateMethodGet(this, _getAriaColcount, _getAriaColcount2).call(this) === this.hot.countCols()) {
685
+ _classPrivateMethodGet(this, _updateAriaColcount, _updateAriaColcount2).call(this, _classPrivateFieldGet(this, _rowHeadersCount));
686
+ }
687
+ }
665
688
  return headerRenderers;
666
689
  },
667
690
  columnHeaders: () => {
@@ -1154,6 +1177,10 @@ class TableView {
1154
1177
  const span = rootDocument.createElement('span');
1155
1178
  div.className = 'relative';
1156
1179
  span.className = 'colHeader';
1180
+ if (this.settings.ariaTags) {
1181
+ setAttribute(div, ...A11Y_PRESENTATION());
1182
+ setAttribute(span, ...A11Y_PRESENTATION());
1183
+ }
1157
1184
  this.updateCellHeader(span, visualColumnIndex, label, headerLevel);
1158
1185
  div.appendChild(span);
1159
1186
  TH.appendChild(div);
@@ -1297,7 +1324,6 @@ class TableView {
1297
1324
  getRowHeadersCount() {
1298
1325
  return _classPrivateFieldGet(this, _rowHeadersCount);
1299
1326
  }
1300
-
1301
1327
  /**
1302
1328
  * Destroys internal WalkOnTable's instance. Detaches all of the bonded listeners.
1303
1329
  *
@@ -1308,4 +1334,11 @@ class TableView {
1308
1334
  this.eventManager.destroy();
1309
1335
  }
1310
1336
  }
1337
+ function _getAriaColcount2() {
1338
+ return parseInt(this.hot.rootElement.getAttribute(A11Y_COLCOUNT()[0]), 10);
1339
+ }
1340
+ function _updateAriaColcount2(delta) {
1341
+ const colCount = _classPrivateMethodGet(this, _getAriaColcount, _getAriaColcount2).call(this) + delta;
1342
+ setAttribute(this.hot.rootElement, ...A11Y_COLCOUNT(colCount));
1343
+ }
1311
1344
  export default TableView;