handsontable 0.0.0-next-49dc220-20231121 → 0.0.0-next-b86a8be-20231123
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of handsontable might be problematic. Click here for more details.
- package/3rdparty/walkontable/src/selection/manager.js +31 -14
- package/3rdparty/walkontable/src/selection/manager.mjs +31 -14
- package/base.js +2 -2
- package/base.mjs +2 -2
- package/core.js +1 -1
- package/core.mjs +1 -1
- package/dist/handsontable.css +62 -44
- package/dist/handsontable.full.css +62 -44
- package/dist/handsontable.full.js +93 -289
- package/dist/handsontable.full.min.css +5 -5
- package/dist/handsontable.full.min.js +101 -101
- package/dist/handsontable.js +93 -289
- package/dist/handsontable.min.css +5 -5
- package/dist/handsontable.min.js +32 -32
- package/dist/languages/all.js +2 -24
- package/dist/languages/all.min.js +1 -1
- package/dist/languages/en-US.js +1 -12
- package/dist/languages/en-US.min.js +1 -1
- package/dist/languages/pl-PL.js +1 -12
- package/dist/languages/pl-PL.min.js +1 -1
- package/helpers/a11y.js +0 -2
- package/helpers/a11y.mjs +0 -1
- package/helpers/dom/element.js +0 -29
- package/helpers/dom/element.mjs +0 -28
- package/helpers/mixed.js +1 -1
- package/helpers/mixed.mjs +1 -1
- package/i18n/constants.js +1 -27
- package/i18n/constants.mjs +1 -14
- package/i18n/languages/en-US.js +1 -12
- package/i18n/languages/en-US.mjs +1 -12
- package/i18n/languages/pl-PL.js +1 -12
- package/i18n/languages/pl-PL.mjs +1 -12
- package/languages/all.js +2 -24
- package/languages/en-US.js +1 -12
- package/languages/en-US.mjs +1 -12
- package/languages/index.js +2 -24
- package/languages/pl-PL.js +1 -12
- package/languages/pl-PL.mjs +1 -12
- package/package.json +1 -1
- package/plugins/collapsibleColumns/collapsibleColumns.js +2 -3
- package/plugins/collapsibleColumns/collapsibleColumns.mjs +3 -4
- package/plugins/columnSorting/columnSorting.js +4 -30
- package/plugins/columnSorting/columnSorting.mjs +6 -32
- package/plugins/contextMenu/menu/menuItemRenderer.js +0 -12
- package/plugins/contextMenu/menu/menuItemRenderer.mjs +2 -14
- package/plugins/dropdownMenu/dropdownMenu.js +1 -2
- package/plugins/dropdownMenu/dropdownMenu.mjs +2 -3
- package/plugins/filters/ui/input.js +3 -0
- package/plugins/filters/ui/input.mjs +3 -0
- package/plugins/filters/ui/select.js +0 -6
- package/plugins/filters/ui/select.mjs +0 -6
- package/plugins/hiddenColumns/hiddenColumns.js +1 -45
- package/plugins/hiddenColumns/hiddenColumns.mjs +1 -45
- package/plugins/hiddenRows/hiddenRows.js +1 -45
- package/plugins/hiddenRows/hiddenRows.mjs +1 -45
- package/plugins/multiColumnSorting/multiColumnSorting.js +0 -21
- package/plugins/multiColumnSorting/multiColumnSorting.mjs +1 -22
- package/plugins/nestedRows/nestedRows.js +1 -2
- package/plugins/nestedRows/nestedRows.mjs +1 -2
- package/plugins/nestedRows/ui/headers.js +3 -3
- package/plugins/nestedRows/ui/headers.mjs +4 -4
- package/selection/highlight/types/focus.js +6 -0
- package/selection/highlight/types/focus.mjs +6 -0
- package/tableView.js +2 -0
- package/tableView.mjs +2 -0
|
@@ -5,8 +5,6 @@ exports.createMenuItemRenderer = createMenuItemRenderer;
|
|
|
5
5
|
var _utils = require("./utils");
|
|
6
6
|
var _element = require("../../../helpers/dom/element");
|
|
7
7
|
var _a11y = require("../../../helpers/a11y");
|
|
8
|
-
const SUBMENU_INDICATOR_CLASSNAME = 'submenuIndicator';
|
|
9
|
-
|
|
10
8
|
/**
|
|
11
9
|
* Creates the menu renderer function.
|
|
12
10
|
*
|
|
@@ -39,16 +37,6 @@ function createMenuItemRenderer(mainTableHot) {
|
|
|
39
37
|
const isFocusable = !(0, _utils.isItemDisabled)(item, mainTableHot) && !(0, _utils.isItemSelectionDisabled)(item) && !(0, _utils.isItemSeparator)(item);
|
|
40
38
|
(0, _element.setAttribute)(TD, [(0, _a11y.A11Y_MENU_ITEM)(), (0, _a11y.A11Y_LABEL)(itemValue), ...(isFocusable ? [(0, _a11y.A11Y_TABINDEX)(-1)] : []), ...((0, _utils.isItemDisabled)(item, mainTableHot) ? [(0, _a11y.A11Y_DISABLED)()] : []), ...((0, _utils.isItemSubMenu)(item) ? [(0, _a11y.A11Y_EXPANDED)(false)] : [])]);
|
|
41
39
|
}
|
|
42
|
-
if ((0, _utils.isItemSubMenu)(item)) {
|
|
43
|
-
const submenuIndicatorElement = TD.querySelector('.submenuIndicator');
|
|
44
|
-
if (!submenuIndicatorElement) {
|
|
45
|
-
(0, _element.appendElement)(TD, {
|
|
46
|
-
tagName: 'div',
|
|
47
|
-
attributes: mainTableHot.getSettings().ariaTags ? [(0, _a11y.A11Y_HIDDEN)()] : [],
|
|
48
|
-
className: SUBMENU_INDICATOR_CLASSNAME
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
40
|
TD.className = '';
|
|
53
41
|
TD.appendChild(wrapper);
|
|
54
42
|
if ((0, _utils.isItemSeparator)(item)) {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { isItemSubMenu, isItemDisabled, isItemSelectionDisabled, isItemSeparator } from "./utils.mjs";
|
|
2
|
-
import { addClass,
|
|
3
|
-
import { A11Y_DISABLED, A11Y_EXPANDED,
|
|
4
|
-
const SUBMENU_INDICATOR_CLASSNAME = 'submenuIndicator';
|
|
5
|
-
|
|
2
|
+
import { addClass, empty, fastInnerHTML, setAttribute } from "../../../helpers/dom/element.mjs";
|
|
3
|
+
import { A11Y_DISABLED, A11Y_EXPANDED, A11Y_LABEL, A11Y_MENU_ITEM, A11Y_TABINDEX } from "../../../helpers/a11y.mjs";
|
|
6
4
|
/**
|
|
7
5
|
* Creates the menu renderer function.
|
|
8
6
|
*
|
|
@@ -35,16 +33,6 @@ export function createMenuItemRenderer(mainTableHot) {
|
|
|
35
33
|
const isFocusable = !isItemDisabled(item, mainTableHot) && !isItemSelectionDisabled(item) && !isItemSeparator(item);
|
|
36
34
|
setAttribute(TD, [A11Y_MENU_ITEM(), A11Y_LABEL(itemValue), ...(isFocusable ? [A11Y_TABINDEX(-1)] : []), ...(isItemDisabled(item, mainTableHot) ? [A11Y_DISABLED()] : []), ...(isItemSubMenu(item) ? [A11Y_EXPANDED(false)] : [])]);
|
|
37
35
|
}
|
|
38
|
-
if (isItemSubMenu(item)) {
|
|
39
|
-
const submenuIndicatorElement = TD.querySelector('.submenuIndicator');
|
|
40
|
-
if (!submenuIndicatorElement) {
|
|
41
|
-
appendElement(TD, {
|
|
42
|
-
tagName: 'div',
|
|
43
|
-
attributes: mainTableHot.getSettings().ariaTags ? [A11Y_HIDDEN()] : [],
|
|
44
|
-
className: SUBMENU_INDICATOR_CLASSNAME
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
36
|
TD.className = '';
|
|
49
37
|
TD.appendChild(wrapper);
|
|
50
38
|
if (isItemSeparator(item)) {
|
|
@@ -12,7 +12,6 @@ var _itemsFactory = require("../contextMenu/itemsFactory");
|
|
|
12
12
|
var _menu = require("../contextMenu/menu");
|
|
13
13
|
var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
|
|
14
14
|
var _predefinedItems = require("../contextMenu/predefinedItems");
|
|
15
|
-
var _constants = require("../../i18n/constants");
|
|
16
15
|
var _a11y = require("../../helpers/a11y");
|
|
17
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
17
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
|
@@ -492,7 +491,7 @@ function _onAfterGetColHeader2(col, TH) {
|
|
|
492
491
|
button.type = 'button';
|
|
493
492
|
button.tabIndex = -1;
|
|
494
493
|
if (this.hot.getSettings().ariaTags) {
|
|
495
|
-
(0, _element.setAttribute)(button, [(0, _a11y.
|
|
494
|
+
(0, _element.setAttribute)(button, [(0, _a11y.A11Y_HIDDEN)(), (0, _a11y.A11Y_LABEL)(' ')]);
|
|
496
495
|
(0, _element.setAttribute)(TH, [(0, _a11y.A11Y_HASPOPUP)('menu')]);
|
|
497
496
|
}
|
|
498
497
|
|
|
@@ -15,8 +15,7 @@ import { ItemsFactory } from "../contextMenu/itemsFactory.mjs";
|
|
|
15
15
|
import { Menu } from "../contextMenu/menu/index.mjs";
|
|
16
16
|
import Hooks from "../../pluginHooks.mjs";
|
|
17
17
|
import { COLUMN_LEFT, COLUMN_RIGHT, REMOVE_COLUMN, CLEAR_COLUMN, READ_ONLY, ALIGNMENT, SEPARATOR } from "../contextMenu/predefinedItems/index.mjs";
|
|
18
|
-
import {
|
|
19
|
-
import { A11Y_LABEL, A11Y_HASPOPUP } from "../../helpers/a11y.mjs";
|
|
18
|
+
import { A11Y_HASPOPUP, A11Y_HIDDEN, A11Y_LABEL } from "../../helpers/a11y.mjs";
|
|
20
19
|
Hooks.getSingleton().register('afterDropdownMenuDefaultOptions');
|
|
21
20
|
Hooks.getSingleton().register('beforeDropdownMenuShow');
|
|
22
21
|
Hooks.getSingleton().register('afterDropdownMenuShow');
|
|
@@ -485,7 +484,7 @@ function _onAfterGetColHeader2(col, TH) {
|
|
|
485
484
|
button.type = 'button';
|
|
486
485
|
button.tabIndex = -1;
|
|
487
486
|
if (this.hot.getSettings().ariaTags) {
|
|
488
|
-
setAttribute(button, [A11Y_LABEL(
|
|
487
|
+
setAttribute(button, [A11Y_HIDDEN(), A11Y_LABEL(' ')]);
|
|
489
488
|
setAttribute(TH, [A11Y_HASPOPUP('menu')]);
|
|
490
489
|
}
|
|
491
490
|
|
|
@@ -63,8 +63,11 @@ class InputUI extends _base.BaseUI {
|
|
|
63
63
|
*/
|
|
64
64
|
build() {
|
|
65
65
|
super.build();
|
|
66
|
+
const icon = this.hot.rootDocument.createElement('div');
|
|
66
67
|
_classPrivateFieldSet(this, _input, this._element.firstChild);
|
|
67
68
|
(0, _element.addClass)(this._element, 'htUIInput');
|
|
69
|
+
(0, _element.addClass)(icon, 'htUIInputIcon');
|
|
70
|
+
this._element.appendChild(icon);
|
|
68
71
|
this.update();
|
|
69
72
|
}
|
|
70
73
|
|
|
@@ -60,8 +60,11 @@ export class InputUI extends BaseUI {
|
|
|
60
60
|
*/
|
|
61
61
|
build() {
|
|
62
62
|
super.build();
|
|
63
|
+
const icon = this.hot.rootDocument.createElement('div');
|
|
63
64
|
_classPrivateFieldSet(this, _input, this._element.firstChild);
|
|
64
65
|
addClass(this._element, 'htUIInput');
|
|
66
|
+
addClass(icon, 'htUIInputIcon');
|
|
67
|
+
this._element.appendChild(icon);
|
|
65
68
|
this.update();
|
|
66
69
|
}
|
|
67
70
|
|
|
@@ -5,11 +5,9 @@ exports.__esModule = true;
|
|
|
5
5
|
var _menu2 = require("../../../plugins/contextMenu/menu");
|
|
6
6
|
var _object = require("../../../helpers/object");
|
|
7
7
|
var _array = require("../../../helpers/array");
|
|
8
|
-
var _element = require("../../../helpers/dom/element");
|
|
9
8
|
var C = _interopRequireWildcard(require("../../../i18n/constants"));
|
|
10
9
|
var _predefinedItems = require("../../../plugins/contextMenu/predefinedItems");
|
|
11
10
|
var _base = require("./_base");
|
|
12
|
-
var _a11y = require("../../../helpers/a11y");
|
|
13
11
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
12
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
13
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
|
@@ -171,10 +169,6 @@ class SelectUI extends _base.BaseUI {
|
|
|
171
169
|
_classPrivateFieldSet(this, _caption, caption);
|
|
172
170
|
_classPrivateFieldSet(this, _captionElement, caption.element);
|
|
173
171
|
_classPrivateFieldSet(this, _dropdown, dropdown);
|
|
174
|
-
if (this.hot.getSettings().ariaTags) {
|
|
175
|
-
(0, _element.setAttribute)(dropdown.element, [(0, _a11y.A11Y_HIDDEN)()]);
|
|
176
|
-
(0, _element.setAttribute)(this._element, [(0, _a11y.A11Y_LISTBOX)()]);
|
|
177
|
-
}
|
|
178
172
|
(0, _array.arrayEach)([caption, dropdown], element => this._element.appendChild(element.element));
|
|
179
173
|
_classPrivateFieldGet(this, _menu).addLocalHook('select', command => _classPrivateMethodGet(this, _onMenuSelect, _onMenuSelect2).call(this, command));
|
|
180
174
|
_classPrivateFieldGet(this, _menu).addLocalHook('afterClose', () => _classPrivateMethodGet(this, _onMenuClosed, _onMenuClosed2).call(this));
|
|
@@ -11,11 +11,9 @@ function _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) {
|
|
|
11
11
|
import { Menu } from "../../../plugins/contextMenu/menu/index.mjs";
|
|
12
12
|
import { clone, extend } from "../../../helpers/object.mjs";
|
|
13
13
|
import { arrayEach } from "../../../helpers/array.mjs";
|
|
14
|
-
import { setAttribute } from "../../../helpers/dom/element.mjs";
|
|
15
14
|
import * as C from "../../../i18n/constants.mjs";
|
|
16
15
|
import { SEPARATOR } from "../../../plugins/contextMenu/predefinedItems/index.mjs";
|
|
17
16
|
import { BaseUI } from "./_base.mjs";
|
|
18
|
-
import { A11Y_HIDDEN, A11Y_LISTBOX } from "../../../helpers/a11y.mjs";
|
|
19
17
|
/**
|
|
20
18
|
* @private
|
|
21
19
|
* @class SelectUI
|
|
@@ -166,10 +164,6 @@ export class SelectUI extends BaseUI {
|
|
|
166
164
|
_classPrivateFieldSet(this, _caption, caption);
|
|
167
165
|
_classPrivateFieldSet(this, _captionElement, caption.element);
|
|
168
166
|
_classPrivateFieldSet(this, _dropdown, dropdown);
|
|
169
|
-
if (this.hot.getSettings().ariaTags) {
|
|
170
|
-
setAttribute(dropdown.element, [A11Y_HIDDEN()]);
|
|
171
|
-
setAttribute(this._element, [A11Y_LISTBOX()]);
|
|
172
|
-
}
|
|
173
167
|
arrayEach([caption, dropdown], element => this._element.appendChild(element.element));
|
|
174
168
|
_classPrivateFieldGet(this, _menu).addLocalHook('select', command => _classPrivateMethodGet(this, _onMenuSelect, _onMenuSelect2).call(this, command));
|
|
175
169
|
_classPrivateFieldGet(this, _menu).addLocalHook('afterClose', () => _classPrivateMethodGet(this, _onMenuClosed, _onMenuClosed2).call(this));
|
|
@@ -14,8 +14,6 @@ var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
|
|
|
14
14
|
var _hideColumn = _interopRequireDefault(require("./contextMenuItem/hideColumn"));
|
|
15
15
|
var _showColumn = _interopRequireDefault(require("./contextMenuItem/showColumn"));
|
|
16
16
|
var _translations = require("../../translations");
|
|
17
|
-
var _a11y = require("../../helpers/a11y");
|
|
18
|
-
var _constants = require("../../i18n/constants");
|
|
19
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
18
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
|
21
19
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
|
@@ -33,9 +31,6 @@ _pluginHooks.default.getSingleton().register('afterUnhideColumns');
|
|
|
33
31
|
const PLUGIN_KEY = 'hiddenColumns';
|
|
34
32
|
exports.PLUGIN_KEY = PLUGIN_KEY;
|
|
35
33
|
const PLUGIN_PRIORITY = 310;
|
|
36
|
-
exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
|
|
37
|
-
const BEFORE_INDICATOR_CLASSNAME = 'beforeHiddenColumnIndicator';
|
|
38
|
-
const AFTER_INDICATOR_CLASSNAME = 'afterHiddenColumnIndicator';
|
|
39
34
|
|
|
40
35
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
|
41
36
|
|
|
@@ -143,9 +138,9 @@ const AFTER_INDICATOR_CLASSNAME = 'afterHiddenColumnIndicator';
|
|
|
143
138
|
* ```
|
|
144
139
|
* :::
|
|
145
140
|
*/
|
|
141
|
+
exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
|
|
146
142
|
var _settings = /*#__PURE__*/new WeakMap();
|
|
147
143
|
var _hiddenColumnsMap = /*#__PURE__*/new WeakMap();
|
|
148
|
-
var _clearIndicatorElements = /*#__PURE__*/new WeakSet();
|
|
149
144
|
var _onModifyColWidth = /*#__PURE__*/new WeakSet();
|
|
150
145
|
var _onAfterGetCellMeta = /*#__PURE__*/new WeakSet();
|
|
151
146
|
var _onModifyCopyableRange = /*#__PURE__*/new WeakSet();
|
|
@@ -195,12 +190,6 @@ class HiddenColumns extends _base.BasePlugin {
|
|
|
195
190
|
* @returns {number}
|
|
196
191
|
*/
|
|
197
192
|
_classPrivateMethodInitSpec(this, _onModifyColWidth);
|
|
198
|
-
/**
|
|
199
|
-
* Remove the indicator elements from the provided column header element.
|
|
200
|
-
*
|
|
201
|
-
* @param {HTMLElement} TH Column header element.
|
|
202
|
-
*/
|
|
203
|
-
_classPrivateMethodInitSpec(this, _clearIndicatorElements);
|
|
204
193
|
/**
|
|
205
194
|
* Cached plugin settings.
|
|
206
195
|
*
|
|
@@ -290,15 +279,8 @@ class HiddenColumns extends _base.BasePlugin {
|
|
|
290
279
|
* Disables the plugin functionality for this Handsontable instance.
|
|
291
280
|
*/
|
|
292
281
|
disablePlugin() {
|
|
293
|
-
const clearColHeader = (columnIndex, TH) => {
|
|
294
|
-
_classPrivateMethodGet(this, _clearIndicatorElements, _clearIndicatorElements2).call(this, TH);
|
|
295
|
-
};
|
|
296
282
|
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
|
297
283
|
_classPrivateFieldSet(this, _settings, {});
|
|
298
|
-
this.hot.addHook('afterGetColHeader', clearColHeader);
|
|
299
|
-
this.hot.addHookOnce('afterViewRender', () => {
|
|
300
|
-
this.hot.removeHook('afterGetColHeader', clearColHeader);
|
|
301
|
-
});
|
|
302
284
|
super.disablePlugin();
|
|
303
285
|
this.resetCellsMeta();
|
|
304
286
|
}
|
|
@@ -450,11 +432,6 @@ class HiddenColumns extends _base.BasePlugin {
|
|
|
450
432
|
}
|
|
451
433
|
}
|
|
452
434
|
exports.HiddenColumns = HiddenColumns;
|
|
453
|
-
function _clearIndicatorElements2(TH) {
|
|
454
|
-
Array.from(TH.querySelectorAll(`.${AFTER_INDICATOR_CLASSNAME}, .${BEFORE_INDICATOR_CLASSNAME}`)).forEach(element => {
|
|
455
|
-
element.remove();
|
|
456
|
-
});
|
|
457
|
-
}
|
|
458
435
|
function _onModifyColWidth2(width, column) {
|
|
459
436
|
// Hook is triggered internally only for the visible columns. Conditional will be handled for the API
|
|
460
437
|
// calls of the `getColWidth` function on not visible indexes.
|
|
@@ -526,35 +503,14 @@ function _onModifyCopyableRange2(ranges) {
|
|
|
526
503
|
return newRanges;
|
|
527
504
|
}
|
|
528
505
|
function _onAfterGetColHeader2(column, TH) {
|
|
529
|
-
const areAriaTagsEnabled = this.hot.getSettings().ariaTags;
|
|
530
|
-
const beforeHiddenColumnIndicatorElement = TH.querySelector('.beforeHiddenColumnIndicator');
|
|
531
|
-
const afterHiddenColumnIndicatorElement = TH.querySelector('.afterHiddenColumnIndicator');
|
|
532
506
|
if (!_classPrivateFieldGet(this, _settings).indicators || column < 0) {
|
|
533
|
-
beforeHiddenColumnIndicatorElement === null || beforeHiddenColumnIndicatorElement === void 0 || beforeHiddenColumnIndicatorElement.remove();
|
|
534
|
-
afterHiddenColumnIndicatorElement === null || afterHiddenColumnIndicatorElement === void 0 || afterHiddenColumnIndicatorElement.remove();
|
|
535
507
|
return;
|
|
536
508
|
}
|
|
537
509
|
const classList = [];
|
|
538
510
|
if (column >= 1 && this.isHidden(column - 1)) {
|
|
539
|
-
if (!afterHiddenColumnIndicatorElement) {
|
|
540
|
-
const attributesToAdd = areAriaTagsEnabled ? [(0, _a11y.A11Y_LABEL)(this.hot.getTranslatedPhrase(_constants.COLUMN_HEADER_LABEL_AFTER_HIDDEN_COLUMN))] : [];
|
|
541
|
-
(0, _element.appendElement)(TH, {
|
|
542
|
-
tagName: 'div',
|
|
543
|
-
attributes: attributesToAdd,
|
|
544
|
-
className: AFTER_INDICATOR_CLASSNAME
|
|
545
|
-
});
|
|
546
|
-
}
|
|
547
511
|
classList.push('afterHiddenColumn');
|
|
548
512
|
}
|
|
549
513
|
if (column < this.hot.countCols() - 1 && this.isHidden(column + 1)) {
|
|
550
|
-
if (!beforeHiddenColumnIndicatorElement) {
|
|
551
|
-
const attributesToAdd = areAriaTagsEnabled ? [(0, _a11y.A11Y_LABEL)(this.hot.getTranslatedPhrase(_constants.COLUMN_HEADER_LABEL_BEFORE_HIDDEN_COLUMN))] : [];
|
|
552
|
-
(0, _element.appendElement)(TH, {
|
|
553
|
-
tagName: 'div',
|
|
554
|
-
attributes: attributesToAdd,
|
|
555
|
-
className: BEFORE_INDICATOR_CLASSNAME
|
|
556
|
-
});
|
|
557
|
-
}
|
|
558
514
|
classList.push('beforeHiddenColumn');
|
|
559
515
|
}
|
|
560
516
|
(0, _element.addClass)(TH, classList);
|
|
@@ -10,7 +10,7 @@ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _
|
|
|
10
10
|
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
|
11
11
|
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
|
12
12
|
import { BasePlugin } from "../base/index.mjs";
|
|
13
|
-
import { addClass
|
|
13
|
+
import { addClass } from "../../helpers/dom/element.mjs";
|
|
14
14
|
import { rangeEach } from "../../helpers/number.mjs";
|
|
15
15
|
import { arrayEach, arrayMap, arrayReduce } from "../../helpers/array.mjs";
|
|
16
16
|
import { isObject } from "../../helpers/object.mjs";
|
|
@@ -20,16 +20,12 @@ import Hooks from "../../pluginHooks.mjs";
|
|
|
20
20
|
import hideColumnItem from "./contextMenuItem/hideColumn.mjs";
|
|
21
21
|
import showColumnItem from "./contextMenuItem/showColumn.mjs";
|
|
22
22
|
import { HidingMap } from "../../translations/index.mjs";
|
|
23
|
-
import { A11Y_LABEL } from "../../helpers/a11y.mjs";
|
|
24
|
-
import { COLUMN_HEADER_LABEL_AFTER_HIDDEN_COLUMN, COLUMN_HEADER_LABEL_BEFORE_HIDDEN_COLUMN } from "../../i18n/constants.mjs";
|
|
25
23
|
Hooks.getSingleton().register('beforeHideColumns');
|
|
26
24
|
Hooks.getSingleton().register('afterHideColumns');
|
|
27
25
|
Hooks.getSingleton().register('beforeUnhideColumns');
|
|
28
26
|
Hooks.getSingleton().register('afterUnhideColumns');
|
|
29
27
|
export const PLUGIN_KEY = 'hiddenColumns';
|
|
30
28
|
export const PLUGIN_PRIORITY = 310;
|
|
31
|
-
const BEFORE_INDICATOR_CLASSNAME = 'beforeHiddenColumnIndicator';
|
|
32
|
-
const AFTER_INDICATOR_CLASSNAME = 'afterHiddenColumnIndicator';
|
|
33
29
|
|
|
34
30
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
|
35
31
|
|
|
@@ -139,7 +135,6 @@ const AFTER_INDICATOR_CLASSNAME = 'afterHiddenColumnIndicator';
|
|
|
139
135
|
*/
|
|
140
136
|
var _settings = /*#__PURE__*/new WeakMap();
|
|
141
137
|
var _hiddenColumnsMap = /*#__PURE__*/new WeakMap();
|
|
142
|
-
var _clearIndicatorElements = /*#__PURE__*/new WeakSet();
|
|
143
138
|
var _onModifyColWidth = /*#__PURE__*/new WeakSet();
|
|
144
139
|
var _onAfterGetCellMeta = /*#__PURE__*/new WeakSet();
|
|
145
140
|
var _onModifyCopyableRange = /*#__PURE__*/new WeakSet();
|
|
@@ -189,12 +184,6 @@ export class HiddenColumns extends BasePlugin {
|
|
|
189
184
|
* @returns {number}
|
|
190
185
|
*/
|
|
191
186
|
_classPrivateMethodInitSpec(this, _onModifyColWidth);
|
|
192
|
-
/**
|
|
193
|
-
* Remove the indicator elements from the provided column header element.
|
|
194
|
-
*
|
|
195
|
-
* @param {HTMLElement} TH Column header element.
|
|
196
|
-
*/
|
|
197
|
-
_classPrivateMethodInitSpec(this, _clearIndicatorElements);
|
|
198
187
|
/**
|
|
199
188
|
* Cached plugin settings.
|
|
200
189
|
*
|
|
@@ -284,15 +273,8 @@ export class HiddenColumns extends BasePlugin {
|
|
|
284
273
|
* Disables the plugin functionality for this Handsontable instance.
|
|
285
274
|
*/
|
|
286
275
|
disablePlugin() {
|
|
287
|
-
const clearColHeader = (columnIndex, TH) => {
|
|
288
|
-
_classPrivateMethodGet(this, _clearIndicatorElements, _clearIndicatorElements2).call(this, TH);
|
|
289
|
-
};
|
|
290
276
|
this.hot.columnIndexMapper.unregisterMap(this.pluginName);
|
|
291
277
|
_classPrivateFieldSet(this, _settings, {});
|
|
292
|
-
this.hot.addHook('afterGetColHeader', clearColHeader);
|
|
293
|
-
this.hot.addHookOnce('afterViewRender', () => {
|
|
294
|
-
this.hot.removeHook('afterGetColHeader', clearColHeader);
|
|
295
|
-
});
|
|
296
278
|
super.disablePlugin();
|
|
297
279
|
this.resetCellsMeta();
|
|
298
280
|
}
|
|
@@ -443,11 +425,6 @@ export class HiddenColumns extends BasePlugin {
|
|
|
443
425
|
super.destroy();
|
|
444
426
|
}
|
|
445
427
|
}
|
|
446
|
-
function _clearIndicatorElements2(TH) {
|
|
447
|
-
Array.from(TH.querySelectorAll(`.${AFTER_INDICATOR_CLASSNAME}, .${BEFORE_INDICATOR_CLASSNAME}`)).forEach(element => {
|
|
448
|
-
element.remove();
|
|
449
|
-
});
|
|
450
|
-
}
|
|
451
428
|
function _onModifyColWidth2(width, column) {
|
|
452
429
|
// Hook is triggered internally only for the visible columns. Conditional will be handled for the API
|
|
453
430
|
// calls of the `getColWidth` function on not visible indexes.
|
|
@@ -519,35 +496,14 @@ function _onModifyCopyableRange2(ranges) {
|
|
|
519
496
|
return newRanges;
|
|
520
497
|
}
|
|
521
498
|
function _onAfterGetColHeader2(column, TH) {
|
|
522
|
-
const areAriaTagsEnabled = this.hot.getSettings().ariaTags;
|
|
523
|
-
const beforeHiddenColumnIndicatorElement = TH.querySelector('.beforeHiddenColumnIndicator');
|
|
524
|
-
const afterHiddenColumnIndicatorElement = TH.querySelector('.afterHiddenColumnIndicator');
|
|
525
499
|
if (!_classPrivateFieldGet(this, _settings).indicators || column < 0) {
|
|
526
|
-
beforeHiddenColumnIndicatorElement === null || beforeHiddenColumnIndicatorElement === void 0 || beforeHiddenColumnIndicatorElement.remove();
|
|
527
|
-
afterHiddenColumnIndicatorElement === null || afterHiddenColumnIndicatorElement === void 0 || afterHiddenColumnIndicatorElement.remove();
|
|
528
500
|
return;
|
|
529
501
|
}
|
|
530
502
|
const classList = [];
|
|
531
503
|
if (column >= 1 && this.isHidden(column - 1)) {
|
|
532
|
-
if (!afterHiddenColumnIndicatorElement) {
|
|
533
|
-
const attributesToAdd = areAriaTagsEnabled ? [A11Y_LABEL(this.hot.getTranslatedPhrase(COLUMN_HEADER_LABEL_AFTER_HIDDEN_COLUMN))] : [];
|
|
534
|
-
appendElement(TH, {
|
|
535
|
-
tagName: 'div',
|
|
536
|
-
attributes: attributesToAdd,
|
|
537
|
-
className: AFTER_INDICATOR_CLASSNAME
|
|
538
|
-
});
|
|
539
|
-
}
|
|
540
504
|
classList.push('afterHiddenColumn');
|
|
541
505
|
}
|
|
542
506
|
if (column < this.hot.countCols() - 1 && this.isHidden(column + 1)) {
|
|
543
|
-
if (!beforeHiddenColumnIndicatorElement) {
|
|
544
|
-
const attributesToAdd = areAriaTagsEnabled ? [A11Y_LABEL(this.hot.getTranslatedPhrase(COLUMN_HEADER_LABEL_BEFORE_HIDDEN_COLUMN))] : [];
|
|
545
|
-
appendElement(TH, {
|
|
546
|
-
tagName: 'div',
|
|
547
|
-
attributes: attributesToAdd,
|
|
548
|
-
className: BEFORE_INDICATOR_CLASSNAME
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
507
|
classList.push('beforeHiddenColumn');
|
|
552
508
|
}
|
|
553
509
|
addClass(TH, classList);
|
|
@@ -14,8 +14,6 @@ var _pluginHooks = _interopRequireDefault(require("../../pluginHooks"));
|
|
|
14
14
|
var _hideRow = _interopRequireDefault(require("./contextMenuItem/hideRow"));
|
|
15
15
|
var _showRow = _interopRequireDefault(require("./contextMenuItem/showRow"));
|
|
16
16
|
var _translations = require("../../translations");
|
|
17
|
-
var _a11y = require("../../helpers/a11y");
|
|
18
|
-
var _constants = require("../../i18n/constants");
|
|
19
17
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
18
|
function _classPrivateMethodInitSpec(obj, privateSet) { _checkPrivateRedeclaration(obj, privateSet); privateSet.add(obj); }
|
|
21
19
|
function _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }
|
|
@@ -33,9 +31,6 @@ _pluginHooks.default.getSingleton().register('afterUnhideRows');
|
|
|
33
31
|
const PLUGIN_KEY = 'hiddenRows';
|
|
34
32
|
exports.PLUGIN_KEY = PLUGIN_KEY;
|
|
35
33
|
const PLUGIN_PRIORITY = 320;
|
|
36
|
-
exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
|
|
37
|
-
const AFTER_INDICATOR_CLASSNAME = 'afterHiddenRowIndicator';
|
|
38
|
-
const BEFORE_INDICATOR_CLASSNAME = 'beforeHiddenRowIndicator';
|
|
39
34
|
|
|
40
35
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
|
41
36
|
|
|
@@ -143,9 +138,9 @@ const BEFORE_INDICATOR_CLASSNAME = 'beforeHiddenRowIndicator';
|
|
|
143
138
|
* ```
|
|
144
139
|
* :::
|
|
145
140
|
*/
|
|
141
|
+
exports.PLUGIN_PRIORITY = PLUGIN_PRIORITY;
|
|
146
142
|
var _settings = /*#__PURE__*/new WeakMap();
|
|
147
143
|
var _hiddenRowsMap = /*#__PURE__*/new WeakMap();
|
|
148
|
-
var _clearIndicatorElements = /*#__PURE__*/new WeakSet();
|
|
149
144
|
var _onModifyRowHeight = /*#__PURE__*/new WeakSet();
|
|
150
145
|
var _onAfterGetCellMeta = /*#__PURE__*/new WeakSet();
|
|
151
146
|
var _onModifyCopyableRange = /*#__PURE__*/new WeakSet();
|
|
@@ -195,12 +190,6 @@ class HiddenRows extends _base.BasePlugin {
|
|
|
195
190
|
* @returns {number}
|
|
196
191
|
*/
|
|
197
192
|
_classPrivateMethodInitSpec(this, _onModifyRowHeight);
|
|
198
|
-
/**
|
|
199
|
-
* Remove the indicator elements from the provided row header element.
|
|
200
|
-
*
|
|
201
|
-
* @param {HTMLElement} TH Column header element.
|
|
202
|
-
*/
|
|
203
|
-
_classPrivateMethodInitSpec(this, _clearIndicatorElements);
|
|
204
193
|
/**
|
|
205
194
|
* Cached settings from Handsontable settings.
|
|
206
195
|
*
|
|
@@ -290,15 +279,8 @@ class HiddenRows extends _base.BasePlugin {
|
|
|
290
279
|
* Disables the plugin functionality for this Handsontable instance.
|
|
291
280
|
*/
|
|
292
281
|
disablePlugin() {
|
|
293
|
-
const clearRowHeader = (columnIndex, TH) => {
|
|
294
|
-
_classPrivateMethodGet(this, _clearIndicatorElements, _clearIndicatorElements2).call(this, TH);
|
|
295
|
-
};
|
|
296
282
|
this.hot.rowIndexMapper.unregisterMap(this.pluginName);
|
|
297
283
|
_classPrivateFieldSet(this, _settings, {});
|
|
298
|
-
this.hot.addHook('afterGetRowHeader', clearRowHeader);
|
|
299
|
-
this.hot.addHookOnce('afterViewRender', () => {
|
|
300
|
-
this.hot.removeHook('afterGetRowHeader', clearRowHeader);
|
|
301
|
-
});
|
|
302
284
|
super.disablePlugin();
|
|
303
285
|
this.resetCellsMeta();
|
|
304
286
|
}
|
|
@@ -447,11 +429,6 @@ class HiddenRows extends _base.BasePlugin {
|
|
|
447
429
|
}
|
|
448
430
|
}
|
|
449
431
|
exports.HiddenRows = HiddenRows;
|
|
450
|
-
function _clearIndicatorElements2(TH) {
|
|
451
|
-
Array.from(TH.querySelectorAll(`.${AFTER_INDICATOR_CLASSNAME}, .${BEFORE_INDICATOR_CLASSNAME}`)).forEach(element => {
|
|
452
|
-
element.remove();
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
432
|
function _onModifyRowHeight2(height, row) {
|
|
456
433
|
// Hook is triggered internally only for the visible rows. Conditional will be handled for the API
|
|
457
434
|
// calls of the `getRowHeight` function on not visible indexes.
|
|
@@ -518,35 +495,14 @@ function _onModifyCopyableRange2(ranges) {
|
|
|
518
495
|
return newRanges;
|
|
519
496
|
}
|
|
520
497
|
function _onAfterGetRowHeader2(row, TH) {
|
|
521
|
-
const areAriaTagsEnabled = this.hot.getSettings().ariaTags;
|
|
522
|
-
const beforeHiddenRowIndicatorElement = TH.querySelector('.beforeHiddenRowIndicator');
|
|
523
|
-
const afterHiddenRowIndicatorElement = TH.querySelector('.afterHiddenRowIndicator');
|
|
524
498
|
if (!_classPrivateFieldGet(this, _settings).indicators || row < 0) {
|
|
525
|
-
beforeHiddenRowIndicatorElement === null || beforeHiddenRowIndicatorElement === void 0 || beforeHiddenRowIndicatorElement.remove();
|
|
526
|
-
afterHiddenRowIndicatorElement === null || afterHiddenRowIndicatorElement === void 0 || afterHiddenRowIndicatorElement.remove();
|
|
527
499
|
return;
|
|
528
500
|
}
|
|
529
501
|
const classList = [];
|
|
530
502
|
if (row >= 1 && this.isHidden(row - 1)) {
|
|
531
|
-
if (!afterHiddenRowIndicatorElement) {
|
|
532
|
-
const attributesToAdd = areAriaTagsEnabled ? [(0, _a11y.A11Y_LABEL)(this.hot.getTranslatedPhrase(_constants.ROW_HEADER_LABEL_AFTER_HIDDEN_ROW))] : [];
|
|
533
|
-
(0, _element.appendElement)(TH, {
|
|
534
|
-
tagName: 'div',
|
|
535
|
-
attributes: attributesToAdd,
|
|
536
|
-
className: AFTER_INDICATOR_CLASSNAME
|
|
537
|
-
});
|
|
538
|
-
}
|
|
539
503
|
classList.push('afterHiddenRow');
|
|
540
504
|
}
|
|
541
505
|
if (row < this.hot.countRows() - 1 && this.isHidden(row + 1)) {
|
|
542
|
-
if (!beforeHiddenRowIndicatorElement) {
|
|
543
|
-
const attributesToAdd = areAriaTagsEnabled ? [(0, _a11y.A11Y_LABEL)(this.hot.getTranslatedPhrase(_constants.ROW_HEADER_LABEL_BEFORE_HIDDEN_ROW))] : [];
|
|
544
|
-
(0, _element.appendElement)(TH, {
|
|
545
|
-
tagName: 'div',
|
|
546
|
-
attributes: attributesToAdd,
|
|
547
|
-
className: BEFORE_INDICATOR_CLASSNAME
|
|
548
|
-
});
|
|
549
|
-
}
|
|
550
506
|
classList.push('beforeHiddenRow');
|
|
551
507
|
}
|
|
552
508
|
(0, _element.addClass)(TH, classList);
|
|
@@ -10,7 +10,7 @@ function _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _
|
|
|
10
10
|
function _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError("attempted to " + action + " private field on non-instance"); } return privateMap.get(receiver); }
|
|
11
11
|
function _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError("attempted to set read only private field"); } descriptor.value = value; } }
|
|
12
12
|
import { BasePlugin } from "../base/index.mjs";
|
|
13
|
-
import { addClass
|
|
13
|
+
import { addClass } from "../../helpers/dom/element.mjs";
|
|
14
14
|
import { rangeEach } from "../../helpers/number.mjs";
|
|
15
15
|
import { arrayEach, arrayMap, arrayReduce } from "../../helpers/array.mjs";
|
|
16
16
|
import { isObject } from "../../helpers/object.mjs";
|
|
@@ -20,16 +20,12 @@ import Hooks from "../../pluginHooks.mjs";
|
|
|
20
20
|
import hideRowItem from "./contextMenuItem/hideRow.mjs";
|
|
21
21
|
import showRowItem from "./contextMenuItem/showRow.mjs";
|
|
22
22
|
import { HidingMap } from "../../translations/index.mjs";
|
|
23
|
-
import { A11Y_LABEL } from "../../helpers/a11y.mjs";
|
|
24
|
-
import { ROW_HEADER_LABEL_AFTER_HIDDEN_ROW, ROW_HEADER_LABEL_BEFORE_HIDDEN_ROW } from "../../i18n/constants.mjs";
|
|
25
23
|
Hooks.getSingleton().register('beforeHideRows');
|
|
26
24
|
Hooks.getSingleton().register('afterHideRows');
|
|
27
25
|
Hooks.getSingleton().register('beforeUnhideRows');
|
|
28
26
|
Hooks.getSingleton().register('afterUnhideRows');
|
|
29
27
|
export const PLUGIN_KEY = 'hiddenRows';
|
|
30
28
|
export const PLUGIN_PRIORITY = 320;
|
|
31
|
-
const AFTER_INDICATOR_CLASSNAME = 'afterHiddenRowIndicator';
|
|
32
|
-
const BEFORE_INDICATOR_CLASSNAME = 'beforeHiddenRowIndicator';
|
|
33
29
|
|
|
34
30
|
/* eslint-disable jsdoc/require-description-complete-sentence */
|
|
35
31
|
|
|
@@ -139,7 +135,6 @@ const BEFORE_INDICATOR_CLASSNAME = 'beforeHiddenRowIndicator';
|
|
|
139
135
|
*/
|
|
140
136
|
var _settings = /*#__PURE__*/new WeakMap();
|
|
141
137
|
var _hiddenRowsMap = /*#__PURE__*/new WeakMap();
|
|
142
|
-
var _clearIndicatorElements = /*#__PURE__*/new WeakSet();
|
|
143
138
|
var _onModifyRowHeight = /*#__PURE__*/new WeakSet();
|
|
144
139
|
var _onAfterGetCellMeta = /*#__PURE__*/new WeakSet();
|
|
145
140
|
var _onModifyCopyableRange = /*#__PURE__*/new WeakSet();
|
|
@@ -189,12 +184,6 @@ export class HiddenRows extends BasePlugin {
|
|
|
189
184
|
* @returns {number}
|
|
190
185
|
*/
|
|
191
186
|
_classPrivateMethodInitSpec(this, _onModifyRowHeight);
|
|
192
|
-
/**
|
|
193
|
-
* Remove the indicator elements from the provided row header element.
|
|
194
|
-
*
|
|
195
|
-
* @param {HTMLElement} TH Column header element.
|
|
196
|
-
*/
|
|
197
|
-
_classPrivateMethodInitSpec(this, _clearIndicatorElements);
|
|
198
187
|
/**
|
|
199
188
|
* Cached settings from Handsontable settings.
|
|
200
189
|
*
|
|
@@ -284,15 +273,8 @@ export class HiddenRows extends BasePlugin {
|
|
|
284
273
|
* Disables the plugin functionality for this Handsontable instance.
|
|
285
274
|
*/
|
|
286
275
|
disablePlugin() {
|
|
287
|
-
const clearRowHeader = (columnIndex, TH) => {
|
|
288
|
-
_classPrivateMethodGet(this, _clearIndicatorElements, _clearIndicatorElements2).call(this, TH);
|
|
289
|
-
};
|
|
290
276
|
this.hot.rowIndexMapper.unregisterMap(this.pluginName);
|
|
291
277
|
_classPrivateFieldSet(this, _settings, {});
|
|
292
|
-
this.hot.addHook('afterGetRowHeader', clearRowHeader);
|
|
293
|
-
this.hot.addHookOnce('afterViewRender', () => {
|
|
294
|
-
this.hot.removeHook('afterGetRowHeader', clearRowHeader);
|
|
295
|
-
});
|
|
296
278
|
super.disablePlugin();
|
|
297
279
|
this.resetCellsMeta();
|
|
298
280
|
}
|
|
@@ -440,11 +422,6 @@ export class HiddenRows extends BasePlugin {
|
|
|
440
422
|
super.destroy();
|
|
441
423
|
}
|
|
442
424
|
}
|
|
443
|
-
function _clearIndicatorElements2(TH) {
|
|
444
|
-
Array.from(TH.querySelectorAll(`.${AFTER_INDICATOR_CLASSNAME}, .${BEFORE_INDICATOR_CLASSNAME}`)).forEach(element => {
|
|
445
|
-
element.remove();
|
|
446
|
-
});
|
|
447
|
-
}
|
|
448
425
|
function _onModifyRowHeight2(height, row) {
|
|
449
426
|
// Hook is triggered internally only for the visible rows. Conditional will be handled for the API
|
|
450
427
|
// calls of the `getRowHeight` function on not visible indexes.
|
|
@@ -511,35 +488,14 @@ function _onModifyCopyableRange2(ranges) {
|
|
|
511
488
|
return newRanges;
|
|
512
489
|
}
|
|
513
490
|
function _onAfterGetRowHeader2(row, TH) {
|
|
514
|
-
const areAriaTagsEnabled = this.hot.getSettings().ariaTags;
|
|
515
|
-
const beforeHiddenRowIndicatorElement = TH.querySelector('.beforeHiddenRowIndicator');
|
|
516
|
-
const afterHiddenRowIndicatorElement = TH.querySelector('.afterHiddenRowIndicator');
|
|
517
491
|
if (!_classPrivateFieldGet(this, _settings).indicators || row < 0) {
|
|
518
|
-
beforeHiddenRowIndicatorElement === null || beforeHiddenRowIndicatorElement === void 0 || beforeHiddenRowIndicatorElement.remove();
|
|
519
|
-
afterHiddenRowIndicatorElement === null || afterHiddenRowIndicatorElement === void 0 || afterHiddenRowIndicatorElement.remove();
|
|
520
492
|
return;
|
|
521
493
|
}
|
|
522
494
|
const classList = [];
|
|
523
495
|
if (row >= 1 && this.isHidden(row - 1)) {
|
|
524
|
-
if (!afterHiddenRowIndicatorElement) {
|
|
525
|
-
const attributesToAdd = areAriaTagsEnabled ? [A11Y_LABEL(this.hot.getTranslatedPhrase(ROW_HEADER_LABEL_AFTER_HIDDEN_ROW))] : [];
|
|
526
|
-
appendElement(TH, {
|
|
527
|
-
tagName: 'div',
|
|
528
|
-
attributes: attributesToAdd,
|
|
529
|
-
className: AFTER_INDICATOR_CLASSNAME
|
|
530
|
-
});
|
|
531
|
-
}
|
|
532
496
|
classList.push('afterHiddenRow');
|
|
533
497
|
}
|
|
534
498
|
if (row < this.hot.countRows() - 1 && this.isHidden(row + 1)) {
|
|
535
|
-
if (!beforeHiddenRowIndicatorElement) {
|
|
536
|
-
const attributesToAdd = areAriaTagsEnabled ? [A11Y_LABEL(this.hot.getTranslatedPhrase(ROW_HEADER_LABEL_BEFORE_HIDDEN_ROW))] : [];
|
|
537
|
-
appendElement(TH, {
|
|
538
|
-
tagName: 'div',
|
|
539
|
-
attributes: attributesToAdd,
|
|
540
|
-
className: BEFORE_INDICATOR_CLASSNAME
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
499
|
classList.push('beforeHiddenRow');
|
|
544
500
|
}
|
|
545
501
|
addClass(TH, classList);
|
|
@@ -9,8 +9,6 @@ var _element = require("../../helpers/dom/element");
|
|
|
9
9
|
var _rootComparator = require("./rootComparator");
|
|
10
10
|
var _utils2 = require("./utils");
|
|
11
11
|
var _domHelpers = require("./domHelpers");
|
|
12
|
-
var _a11y = require("../../helpers/a11y");
|
|
13
|
-
var _constants = require("../../i18n/constants");
|
|
14
12
|
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; }
|
|
15
13
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
16
14
|
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); }
|
|
@@ -274,25 +272,6 @@ class MultiColumnSorting extends _columnSorting.ColumnSorting {
|
|
|
274
272
|
}
|
|
275
273
|
}
|
|
276
274
|
|
|
277
|
-
/**
|
|
278
|
-
* Update sorting indicator.
|
|
279
|
-
*
|
|
280
|
-
* @private
|
|
281
|
-
* @param {number} column Visual column index.
|
|
282
|
-
* @param {HTMLElement} headerSpanElement Header span element.
|
|
283
|
-
*/
|
|
284
|
-
updateSortingIndicator(column, headerSpanElement) {
|
|
285
|
-
super.updateSortingIndicator(column, headerSpanElement);
|
|
286
|
-
const indicatorElement = headerSpanElement.querySelector('.columnSortingIndicator');
|
|
287
|
-
if (!indicatorElement || !this.hot.getSettings().ariaTags || !this.columnStatesManager.isColumnSorted(column) || this.columnStatesManager.getNumberOfSortedColumns() <= 1) {
|
|
288
|
-
return;
|
|
289
|
-
}
|
|
290
|
-
const multiColumnSortingOrder = this.columnStatesManager.getIndexOfColumnInSortQueue(column) + 1;
|
|
291
|
-
const a11yLabelAttribute = (0, _a11y.A11Y_LABEL)(`${this.hot.getTranslatedPhrase(_constants.COLUMN_HEADER_LABEL_MULTI_COLUMN_SORT_ORDER)} ${multiColumnSortingOrder}.`);
|
|
292
|
-
(0, _element.removeAttribute)(indicatorElement, (0, _a11y.A11Y_HIDDEN)()[0]);
|
|
293
|
-
(0, _element.setAttribute)(indicatorElement, ...a11yLabelAttribute);
|
|
294
|
-
}
|
|
295
|
-
|
|
296
275
|
/**
|
|
297
276
|
* Overwriting base plugin's `onUpdateSettings` method. Please keep in mind that `onAfterUpdateSettings` isn't called
|
|
298
277
|
* for `updateSettings` in specific situations.
|