handsontable 0.0.0-next-e54c3d6-20231026 → 0.0.0-next-42d5bd7-20231027

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 (63) hide show
  1. package/3rdparty/walkontable/src/renderer/columnHeaders.js +3 -0
  2. package/3rdparty/walkontable/src/renderer/columnHeaders.mjs +4 -1
  3. package/3rdparty/walkontable/src/renderer/rowHeaders.js +3 -0
  4. package/3rdparty/walkontable/src/renderer/rowHeaders.mjs +4 -1
  5. package/base.js +2 -2
  6. package/base.mjs +2 -2
  7. package/core.js +1 -1
  8. package/core.mjs +1 -1
  9. package/dist/handsontable.css +45 -63
  10. package/dist/handsontable.full.css +45 -63
  11. package/dist/handsontable.full.js +253 -24
  12. package/dist/handsontable.full.min.css +5 -5
  13. package/dist/handsontable.full.min.js +105 -105
  14. package/dist/handsontable.js +253 -24
  15. package/dist/handsontable.min.css +5 -5
  16. package/dist/handsontable.min.js +19 -19
  17. package/dist/languages/all.js +24 -2
  18. package/dist/languages/all.min.js +1 -1
  19. package/dist/languages/en-US.js +12 -1
  20. package/dist/languages/en-US.min.js +1 -1
  21. package/dist/languages/pl-PL.js +12 -1
  22. package/dist/languages/pl-PL.min.js +1 -1
  23. package/helpers/a11y.js +2 -0
  24. package/helpers/a11y.mjs +1 -0
  25. package/helpers/dom/element.js +29 -0
  26. package/helpers/dom/element.mjs +28 -0
  27. package/helpers/mixed.js +1 -1
  28. package/helpers/mixed.mjs +1 -1
  29. package/i18n/constants.js +27 -1
  30. package/i18n/constants.mjs +14 -1
  31. package/i18n/languages/en-US.js +12 -1
  32. package/i18n/languages/en-US.mjs +12 -1
  33. package/i18n/languages/pl-PL.js +12 -1
  34. package/i18n/languages/pl-PL.mjs +12 -1
  35. package/languages/all.js +24 -2
  36. package/languages/en-US.js +12 -1
  37. package/languages/en-US.mjs +12 -1
  38. package/languages/index.js +24 -2
  39. package/languages/pl-PL.js +12 -1
  40. package/languages/pl-PL.mjs +12 -1
  41. package/package.json +1 -1
  42. package/plugins/collapsibleColumns/collapsibleColumns.js +3 -2
  43. package/plugins/collapsibleColumns/collapsibleColumns.mjs +4 -3
  44. package/plugins/columnSorting/columnSorting.js +29 -3
  45. package/plugins/columnSorting/columnSorting.mjs +31 -5
  46. package/plugins/contextMenu/menu/menuItemRenderer.js +12 -0
  47. package/plugins/contextMenu/menu/menuItemRenderer.mjs +14 -2
  48. package/plugins/dropdownMenu/dropdownMenu.js +2 -1
  49. package/plugins/dropdownMenu/dropdownMenu.mjs +3 -2
  50. package/plugins/filters/ui/input.js +0 -3
  51. package/plugins/filters/ui/input.mjs +0 -3
  52. package/plugins/filters/ui/select.js +6 -0
  53. package/plugins/filters/ui/select.mjs +6 -0
  54. package/plugins/hiddenColumns/hiddenColumns.js +48 -3
  55. package/plugins/hiddenColumns/hiddenColumns.mjs +47 -2
  56. package/plugins/hiddenRows/hiddenRows.js +48 -3
  57. package/plugins/hiddenRows/hiddenRows.mjs +47 -2
  58. package/plugins/multiColumnSorting/multiColumnSorting.js +21 -0
  59. package/plugins/multiColumnSorting/multiColumnSorting.mjs +22 -1
  60. package/plugins/nestedRows/nestedRows.js +2 -1
  61. package/plugins/nestedRows/nestedRows.mjs +2 -1
  62. package/plugins/nestedRows/ui/headers.js +3 -3
  63. package/plugins/nestedRows/ui/headers.mjs +4 -4
@@ -1,10 +1,12 @@
1
1
  import { APPEND_COLUMN_CONFIG_STRATEGY, ColumnSorting } from "../columnSorting/index.mjs";
2
2
  import { registerRootComparator } from "../columnSorting/sortService/index.mjs";
3
3
  import { wasHeaderClickedProperly } from "../columnSorting/utils.mjs";
4
- import { addClass, removeClass } from "../../helpers/dom/element.mjs";
4
+ import { addClass, removeClass, setAttribute, removeAttribute } from "../../helpers/dom/element.mjs";
5
5
  import { rootComparator } from "./rootComparator.mjs";
6
6
  import { warnAboutPluginsConflict } from "./utils.mjs";
7
7
  import { getClassesToAdd, getClassesToRemove } from "./domHelpers.mjs";
8
+ import { A11Y_HIDDEN, A11Y_LABEL } from "../../helpers/a11y.mjs";
9
+ import { COLUMN_HEADER_LABEL_MULTI_COLUMN_SORT_ORDER } from "../../i18n/constants.mjs";
8
10
  export const PLUGIN_KEY = 'multiColumnSorting';
9
11
  export const PLUGIN_PRIORITY = 170;
10
12
  const CONFLICTED_PLUGIN_KEY = 'columnSorting';
@@ -263,6 +265,25 @@ export class MultiColumnSorting extends ColumnSorting {
263
265
  }
264
266
  }
265
267
 
268
+ /**
269
+ * Update sorting indicator.
270
+ *
271
+ * @private
272
+ * @param {number} column Visual column index.
273
+ * @param {HTMLElement} headerSpanElement Header span element.
274
+ */
275
+ updateSortingIndicator(column, headerSpanElement) {
276
+ super.updateSortingIndicator(column, headerSpanElement);
277
+ const indicatorElement = headerSpanElement.querySelector('.columnSortingIndicator');
278
+ if (!indicatorElement || !this.hot.getSettings().ariaTags || !this.columnStatesManager.isColumnSorted(column) || this.columnStatesManager.getNumberOfSortedColumns() <= 1) {
279
+ return;
280
+ }
281
+ const multiColumnSortingOrder = this.columnStatesManager.getIndexOfColumnInSortQueue(column) + 1;
282
+ const a11yLabelAttribute = A11Y_LABEL(`${this.hot.getTranslatedPhrase(COLUMN_HEADER_LABEL_MULTI_COLUMN_SORT_ORDER)} ${multiColumnSortingOrder}.`);
283
+ removeAttribute(indicatorElement, A11Y_HIDDEN()[0]);
284
+ setAttribute(indicatorElement, ...a11yLabelAttribute);
285
+ }
286
+
266
287
  /**
267
288
  * Overwriting base plugin's `onUpdateSettings` method. Please keep in mind that `onAfterUpdateSettings` isn't called
268
289
  * for `updateSettings` in specific situations.
@@ -167,7 +167,8 @@ class NestedRows extends _base.BasePlugin {
167
167
  /**
168
168
  * Updates the plugin's state.
169
169
  *
170
- * This method is executed when [`updateSettings()`](@/api/core.md#updatesettings) is invoked with any of the following configuration options:
170
+ * This method is executed when [`updateSettings()`](@/api/core.md#updatesettings) is invoked with any of the
171
+ * following configuration options:
171
172
  * - [`nestedRows`](@/api/options.md#nestedrows)
172
173
  */
173
174
  updatePlugin() {
@@ -161,7 +161,8 @@ export class NestedRows extends BasePlugin {
161
161
  /**
162
162
  * Updates the plugin's state.
163
163
  *
164
- * This method is executed when [`updateSettings()`](@/api/core.md#updatesettings) is invoked with any of the following configuration options:
164
+ * This method is executed when [`updateSettings()`](@/api/core.md#updatesettings) is invoked with any of the
165
+ * following configuration options:
165
166
  * - [`nestedRows`](@/api/options.md#nestedrows)
166
167
  */
167
168
  updatePlugin() {
@@ -6,6 +6,7 @@ var _number = require("../../../helpers/number");
6
6
  var _element = require("../../../helpers/dom/element");
7
7
  var _base = _interopRequireDefault(require("./_base"));
8
8
  var _a11y = require("../../../helpers/a11y");
9
+ var _constants = require("../../../i18n/constants");
9
10
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
11
  /**
11
12
  * Class responsible for the UI in the Nested Rows' row headers.
@@ -24,7 +25,6 @@ class HeadersUI extends _base.default {
24
25
  return {
25
26
  indicatorContainer: 'ht_nestingLevels',
26
27
  parent: 'ht_nestingParent',
27
- indicator: 'ht_nestingLevel',
28
28
  emptyIndicator: 'ht_nestingLevel_empty',
29
29
  button: 'ht_nestingButton',
30
30
  expandButton: 'ht_nestingExpand',
@@ -102,12 +102,12 @@ class HeadersUI extends _base.default {
102
102
  if (this.collapsingUI.areChildrenCollapsed(rowIndex)) {
103
103
  (0, _element.addClass)(buttonsContainer, `${HeadersUI.CSS_CLASSES.button} ${HeadersUI.CSS_CLASSES.expandButton}`);
104
104
  if (ariaEnabled) {
105
- (0, _element.setAttribute)(TH, [(0, _a11y.A11Y_EXPANDED)(false)]);
105
+ (0, _element.setAttribute)(TH, [(0, _a11y.A11Y_EXPANDED)(false), (0, _a11y.A11Y_DESCRIPTION)(this.hot.getTranslatedPhrase(_constants.ROW_HEADER_DESCRIPTION_EXPAND_ROW))]);
106
106
  }
107
107
  } else {
108
108
  (0, _element.addClass)(buttonsContainer, `${HeadersUI.CSS_CLASSES.button} ${HeadersUI.CSS_CLASSES.collapseButton}`);
109
109
  if (ariaEnabled) {
110
- (0, _element.setAttribute)(TH, [(0, _a11y.A11Y_EXPANDED)(true)]);
110
+ (0, _element.setAttribute)(TH, [(0, _a11y.A11Y_EXPANDED)(true), (0, _a11y.A11Y_DESCRIPTION)(this.hot.getTranslatedPhrase(_constants.ROW_HEADER_DESCRIPTION_COLLAPSE_ROW))]);
111
111
  }
112
112
  }
113
113
  innerDiv.appendChild(buttonsContainer);
@@ -2,7 +2,8 @@ import { arrayEach } from "../../../helpers/array.mjs";
2
2
  import { rangeEach } from "../../../helpers/number.mjs";
3
3
  import { addClass, setAttribute } from "../../../helpers/dom/element.mjs";
4
4
  import BaseUI from "./_base.mjs";
5
- import { A11Y_EXPANDED, A11Y_HIDDEN } from "../../../helpers/a11y.mjs";
5
+ import { A11Y_DESCRIPTION, A11Y_EXPANDED, A11Y_HIDDEN } from "../../../helpers/a11y.mjs";
6
+ import { ROW_HEADER_DESCRIPTION_COLLAPSE_ROW, ROW_HEADER_DESCRIPTION_EXPAND_ROW } from "../../../i18n/constants.mjs";
6
7
  /**
7
8
  * Class responsible for the UI in the Nested Rows' row headers.
8
9
  *
@@ -20,7 +21,6 @@ class HeadersUI extends BaseUI {
20
21
  return {
21
22
  indicatorContainer: 'ht_nestingLevels',
22
23
  parent: 'ht_nestingParent',
23
- indicator: 'ht_nestingLevel',
24
24
  emptyIndicator: 'ht_nestingLevel_empty',
25
25
  button: 'ht_nestingButton',
26
26
  expandButton: 'ht_nestingExpand',
@@ -98,12 +98,12 @@ class HeadersUI extends BaseUI {
98
98
  if (this.collapsingUI.areChildrenCollapsed(rowIndex)) {
99
99
  addClass(buttonsContainer, `${HeadersUI.CSS_CLASSES.button} ${HeadersUI.CSS_CLASSES.expandButton}`);
100
100
  if (ariaEnabled) {
101
- setAttribute(TH, [A11Y_EXPANDED(false)]);
101
+ setAttribute(TH, [A11Y_EXPANDED(false), A11Y_DESCRIPTION(this.hot.getTranslatedPhrase(ROW_HEADER_DESCRIPTION_EXPAND_ROW))]);
102
102
  }
103
103
  } else {
104
104
  addClass(buttonsContainer, `${HeadersUI.CSS_CLASSES.button} ${HeadersUI.CSS_CLASSES.collapseButton}`);
105
105
  if (ariaEnabled) {
106
- setAttribute(TH, [A11Y_EXPANDED(true)]);
106
+ setAttribute(TH, [A11Y_EXPANDED(true), A11Y_DESCRIPTION(this.hot.getTranslatedPhrase(ROW_HEADER_DESCRIPTION_COLLAPSE_ROW))]);
107
107
  }
108
108
  }
109
109
  innerDiv.appendChild(buttonsContainer);